add Btype
This commit is contained in:
@@ -14,10 +14,10 @@ class AddressModel(QAbstractListModel):
|
||||
def data(self, index, role = Qt.DisplayRole):
|
||||
row = index.row()
|
||||
if role == Qt.DisplayRole:
|
||||
data= self.__address_data[row][2]
|
||||
data = self.__address_data[row][2]
|
||||
return data
|
||||
elif role == PyqcrmDataRoles.CITY_ROLE:
|
||||
data= self.__address_data[row][3]
|
||||
data = self.__address_data[row][3]
|
||||
return data
|
||||
return None
|
||||
|
||||
|
||||
12
lib/DB/BTypeDAO.py
Normal file
12
lib/DB/BTypeDAO.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from .DbManager import DbManager
|
||||
|
||||
|
||||
class BTypeDAO:
|
||||
def __init__(self):
|
||||
self.__con = DbManager().getConnection()
|
||||
self.__cur = self.__con.cursor()
|
||||
|
||||
def getBType(self):
|
||||
self.__cur.callproc("getBType")
|
||||
data = self.__cur.fetchall()
|
||||
return(data)
|
||||
19
lib/DB/BTypeModel.py
Normal file
19
lib/DB/BTypeModel.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from PySide6.QtCore import QAbstractListModel, Qt, QModelIndex
|
||||
from .BTypeDAO import BTypeDAO
|
||||
|
||||
|
||||
class BTypeModel(QAbstractListModel):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.__btype_data = BTypeDAO().getBType()
|
||||
|
||||
def rowCount(self, parent = QModelIndex()):
|
||||
return len(self.__btype_data)
|
||||
|
||||
def data(self, index, role = Qt.DisplayRole):
|
||||
row = index.row()
|
||||
if role == Qt.DisplayRole:
|
||||
data= self.__btype_data[row][1]
|
||||
return data
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user