def on_buttonBox_accepted(self): """ save data into file """ i_year = self.qdate.year() i_month = self.qdate.month() i_name = self.cfile.readCvalue( str(self.combo_select.currentText().toUtf8())) #declare Dfile object self.dfile = Dfile(i_year, i_month, i_name) #open file self.dfile.open_dfile() if self.dfile.ischeckRwrite(self.qdate.day()) == True: #write ui data into file i_big = self.spinBox_big.value() i_small = self.spinBox_small.value() i_oil = self.spinBox_oil.value() i_tri = self.spinBox_tri.value() i_stinky = self.spinBox_stinky.value() i_milk = self.spinBox_milk.value() spindata = [i_big, i_small, i_oil, i_tri, i_stinky, i_milk] self.dfile.write_dfile(spindata) #close file self.dfile.close_dfile()
def __init__(self, parent=None): """ Constructor """ QDialog.__init__(self, parent) self.setupUi(self) #construct Customer list class self.clist = Customer_list() #construct accounting class self.caccount = Dfile() #construct customer price class self.cprice = Customer_price() #construct standard table self.tablemodel = QStandardItemModel(31, len(PRODUCT_NAME)) self.setTableheader() #save customer list int self.list_customer = self.clist.readCompany() self.setCombo(1, self.list_customer)