Пример #1
0
    def getLastJancode(self):

        result = DaoBase().fetchAll('mst_item', {'no_code_flag': 1})
        if result:
            maxValue = 0
            for key, values in result.items():

                jan_code = int(values['jan_code'])
                if jan_code > maxValue:
                    maxValue = jan_code
            maxValue = str(maxValue+1)
        else:
            maxValue = "1"
        return maxValue
Пример #2
0
    def getLastJancode(self):

        result = DaoBase().fetchAll('mst_item', {'no_code_flag': 1})
        if result:
            maxValue = 0
            for key, values in result.items():

                jan_code = int(values['jan_code'])
                if jan_code > maxValue:
                    maxValue = jan_code
            maxValue = str(maxValue + 1)
        else:
            maxValue = "1"
        return maxValue
Пример #3
0
 def __init__(self, email=None):
     self.staff_name = None
     self.pw_hash = ""
     if email is not None:
         staff_data = DaoBase().fetchOne('mst_staff', {'email': email})
         if staff_data:
             self.staff_id = staff_data['id']
             self.staff_name = staff_data['name']
             self.email = staff_data['email']
             self.pw_hash = staff_data['password']
             self.authority = staff_data['authority']
Пример #4
0
    def getLastJancode(self):

        result = DaoBase().fetchAll('mst_item', {'no_code_flag': 1})

        if result:
            maxValue = 0
            for key, values in result.items():

                jan_code = int(values['jan_code'])
                if jan_code > maxValue:
                    maxValue = jan_code

            maxValue = str(maxValue + 1)
            count = 13 - maxValue.count("") + 1
            zeroCount = ""
            while count:
                zeroCount += "0"
                count -= 1
            maxValue = zeroCount + maxValue

        else:
            maxValue = "0000000000001"
        return maxValue
Пример #5
0
    def update_staff(self, editData, id):

        data = {
            'staff_cd': editData['staff_cd'],
            'name': editData['name'],
            'telphone': editData['telphone'],
            'email': editData['email'],
        }

        if editData['password'] != "":
            pw_hash = generate_password_hash(editData['password'])
            data['password'] = pw_hash

        result = DaoBase().updateRecord('mst_staff', data, id)
        return result
Пример #6
0
 def saveInboxData(self, id, data):
     result = DaoBase().updateRecord('mst_in_box', data, id)
     return result
Пример #7
0
 def addInbox(self, datas):
     tableName = 'mst_in_box'
     result = DaoBase().insertRecord(tableName, datas)
     return result
Пример #8
0
 def getInboxData(self, where):
     inboxData = DaoBase().fetchOne('mst_in_box', where)
     return inboxData
Пример #9
0
 def saveOutboxData(self, id, datas):
     result = DaoBase().updateRecord('mst_out_box', datas, id)
     return result
Пример #10
0
 def getOutboxesByCustomerId(self, id):
     outboxDatas = DaoBase().fetchAll('mst_out_box', {'customer_id': id})
     return outboxDatas
Пример #11
0
 def getCustomer(self, id):
     customerRecord = DaoBase().fetchOne('mst_customer', id)
     return customerRecord
Пример #12
0
 def insertCustomer(self, data):
     result = DaoBase().insertRecord('mst_customer', data)
     return result
Пример #13
0
 def saveItem(self, id, data):
     result = DaoBase().updateRecord('mst_item', data, id)
     return result
Пример #14
0
    def addItem(self, data):

        tableName = 'mst_item'
        result = DaoBase().insertRecord(tableName, data)
        return result
Пример #15
0
 def getItem(self, where):
     item = DaoBase().fetchOne('mst_item', where)
     return item
Пример #16
0
 def getCustomers(self):
     customerRecords = DaoBase().fetchAll('mst_customer')
     return customerRecords
Пример #17
0
 def getRelOutItems(self, where):
     relOutItems = DaoBase().fetchAll('rel_out_item', where)
     return relOutItems
Пример #18
0
 def updateCustomer(self, data, id):
     result = DaoBase().updateRecord('mst_customer', data, id)
     return result
Пример #19
0
 def getRelOutItem(self, where):
     relOutItem = DaoBase().fetchOne('rel_out_item', where)
     return relOutItem
Пример #20
0
 def getOutboxDatas(self, where):
     outboxDatas = DaoBase().fetchAll('mst_out_box', where)
     return outboxDatas
Пример #21
0
 def addRelOutItem(self, data):
     tableName = 'rel_out_item'
     result = DaoBase().insertRecord(tableName, data)
     return result
Пример #22
0
 def getOutboxData(self, where):
     outboxData = DaoBase().fetchOne('mst_out_box', where)
     return outboxData
Пример #23
0
 def saveRelOutItem(self, id, data):
     result = DaoBase().updateRecord('rel_out_item', data, id)
     return result
Пример #24
0
 def getInboxDatas(self, where):
     inboxDatas = DaoBase().fetchAll('mst_in_box', where)
     return inboxDatas
Пример #25
0
 def getMadeInInfos(self, where):
     madeInInfos = DaoBase().fetchAll('mst_made_in', where)
     return madeInInfos
Пример #26
0
 def getInboxesByCustomerId(self, id):
     inboxDatas = DaoBase().fetchAll('mst_in_box', {'customer_id': id})
     return inboxDatas
Пример #27
0
 def getMadeInInfo(self, where):
     madeInInfo = DaoBase().fetchOne('mst_made_in', where)
     return madeInInfo
Пример #28
0
 def getInboxDataWithEdit(self, id):
     inboxData = DaoBase().fetchOne('mst_in_box', id)
     return inboxData
Пример #29
0
    def addMadeInInfo(self, data):

        tableName = 'mst_made_in'
        result = DaoBase().insertRecord(tableName, data)
        return result
Пример #30
0
    def getInboxDataBySearch(self, where):

        result = DaoBase().fetchAllBySearch('mst_in_box', where)
        return result
Пример #31
0
 def saveMadeInInfo(self, id, data):
     result = DaoBase().updateRecord('mst_made_in', data, id)
     return result