def LoginButton(self, event): #连接cara_sale数据库 op = Sql_operation("car_sale") #获取users表中的用户名和密码信息,返回为二维元组 np = op.FindAll("user") #匹配标记 login_sign = 0 #匹配用户名和密码 for i in np: if (i[1] == self.user_name.GetValue()) and ( i[2] == self.user_password.GetValue()): login_sign = 1 if i[1]=='custom': login_sign=2 print(login_sign) print(i[1]) print(i[2]) break if login_sign == 0: self.showinfo.AppendText("用户名或密码错误!") elif login_sign == 1: print("登录成功!") operation = Maner(None, title="信息管理", size=(1024, 668)) operation.Show() self.Close(True) elif login_sign==2: print("登陆成功") operation=CustomManer(None,title="客户界面",size=(1024,668)) operation.Show() self.Close(True)
def OnLabelleftClick(self, event): #连接car_sale数据库 op = Sql_operation("car_sale") np = op.FindAll("custom") print("RowIdx: {0}".format(event.GetRow())) print("ColIdx: {0}".format(event.GetRow())) print(np[event.GetRow()]) event.Skip()
def DelAffirm(self,event): #连接car_sale数据库 op = Sql_operation("car_sale") del_id = self.del_id.GetValue() print(del_id) np = op.EDel(int(del_id)) del_button = DelOp(None,title="员工管理系统",size=(1024,720)) del_button.Show() self.Close(True)
def ExcelAffrim(self, event): #连接car_sale数据库 op = Sql_operation("car_sale") print("导出销售数据") np = op.SExcel() xls_button = ExcelOp(None, title="销售管理系统", size=(1024, 720)) xls_button.Show() self.Close(True)
def DelAffirm(self, event): #连接car_sale数据库 op = Sql_operation("car_sale") #向stu_information表添加学生信息 del_id = self.del_id.GetValue() print(del_id) np = op.CDel(str(del_id)) del_button = DelOp(None, title="用户管理系统", size=(1024, 668)) del_button.Show() self.Close(True)
def UpdateAffirm(self, event): #连接car_sale数据库 op = Sql_operation("car_sale") #向stu_information表添加学生信息 cname = self.cname.GetValue() print(cname) cage = self.cage.GetValue() print(cage) csex = self.csex.GetValue() print(csex) ctel = self.ctel.GetValue() print(ctel) Brecord = self.Brecord.GetValue() print(Brecord) np = op.CUpdate(cname, cage, csex, ctel, Brecord)
def CreateGrid(self): #连接car_sale数据库 op = Sql_operation("car_sale") #获取custom表中的学生信息,返回为二维元组 np = op.FindAll("custom") column_names = ("客户姓名", "年龄", "性别", "联系方式", "业务记录") cgrid = wx.grid.Grid(self.pnl) cgrid.CreateGrid(len(np), len(np[0])) for row in range(len(np)): #表格横向为对应表中的属性,纵向为首个属性的数据 cgrid.SetRowLabelValue(row, str(np[row][0])) for col in range(1, len(np[row])): cgrid.SetColLabelValue(col - 1, column_names[col]) cgrid.SetCellValue(row, col - 1, str(np[row][col])) cgrid.AutoSize() return cgrid
def UpdateAffirm(self,event): #连接car_sale数据库 op = Sql_operation("car_sale") eno = self.eno.GetValue() print(eno) ename = self.ename.GetValue() print(ename) eage = self.eage.GetValue() print(eage) esex = self.esex.GetValue() print(esex) ehome = self.ehome.GetValue() print(ehome) edu=self.edu.GetValue() print(edu) np = op.EUpdate(eno,ename,eage,esex,ehome,edu)
def CreateGrid(self): #连接car_sale数据库 op = Sql_operation("car_sale") #获取car表中的学生信息,返回为二维元组 np = op.FindAll("employ") column_names = ("员工编号","员工姓名","年龄","性别","籍贯","学历") cgrid = wx.grid.Grid(self.pnl) #CreateGrid(行数,列数) cgrid.CreateGrid(len(np),len(np[0])-1) for row in range(len(np)): #表格横向为对应表中的属性,纵向为首个属性的数据 cgrid.SetRowLabelValue(row,str(np[row][0])) for col in range(1,len(np[row])): cgrid.SetColLabelValue(col-1,column_names[col]) cgrid.SetCellValue(row,col-1,str(np[row][col])) cgrid.AutoSize() return cgrid
def UpdateAffirm(self,event): #连接car_sale数据库 op = Sql_operation("car_sale") #向stu_information表添加学生信息 car_no = self.car_no.GetValue() print(car_no) car_type = self.car_type.GetValue() print(car_type) car_color = self.car_color.GetValue() print(car_color) car_maner = self.car_maner.GetValue() print(car_maner) car_date = self.car_date.GetValue() print(car_date) car_price=self.car_price.GetValue() print(car_price) np = op.CarUpdate(car_no,car_type,car_color,car_maner,car_date,car_price)
def UpdateAffirm(self, event): #连接car_sale数据库 op = Sql_operation("car_sale") sale_car = self.sale_car.GetValue() print(sale_car) sale_type = self.sale_type.GetValue() print(sale_type) sale_color = self.sale_color.GetValue() print(sale_color) sale_date = self.sale_date.GetValue() print(sale_date) sale_num = self.sale_num.GetValue() print(sale_num) sale_man = self.sale_man.GetValue() print(sale_man) np = op.SUpdate(sale_car, sale_type, sale_color, sale_date, sale_num, sale_man)
def CreateGrid(self): #连接car_sale数据库 op = Sql_operation("car_sale") #获取car表中的学生信息,返回为二维元组 np = op.FindAll("sale") column_types = ("销售编号", "车辆编号", "销售车型", "车辆颜色", "销售日期", "销售数量", "销售员", "买家") cgrid = wx.grid.Grid(self.pnl) #CreateGrid(行数,列数) cgrid.CreateGrid(len(np), len(np[0]) - 1) for row in range(len(np)): #表格横向为对应表中的属性,纵向为首个属性的数据 #row[0]要显示的为第一列 cgrid.SetRowLabelValue(row, str(np[row][0])) for col in range(1, len(np[row])): cgrid.SetColLabelValue(col - 1, column_types[col]) cgrid.SetCellValue(row, col - 1, str(np[row][col])) cgrid.AutoSize() return cgrid