def m_ribbonButton_newSOOnRibbonButtonClicked( self, event ): newdialog = SO_DIALOG(self, flag='new') if newdialog.ShowModal() == wx.ID_OK: newdata = newdialog.getData() self.connectDb() for item in newdata.keys(): print 'key is %s,data is %s' % (item , newdata[item]) #data = (newdata[u'订单号'], newdata[u'客户号'], newdata[u'客户采购单号'], newdata[u'下单日期'], newdata[u'箱号范围'], newdata[u'交货日期'],newdata[u'总数量'], newdata[u'总金额'], newdata[u'内容'], newdata[u'注意事项']) #data = (newdata[u'订单号'], newdata[u'客户号'], newdata[u'客户采购单号'], newdata[u'下单日期'], newdata[u'箱号范围'], newdata[u'交货日期'], newdata[u'总数量']) # newdata[u'总金额'], newdata[u'内容'], newdata[u'注意事项']) #print self.cur.mogrify(SO_INSERT_NEWHEADER, data) #self.cur.execute(SO_INSERT_NEWHEADER, data) #self.conn.commit() #self.closeDb() #data = (newdata[u'订单号'], newdata[u'客户号'], newdata[u'下单日期']) #sql = """INSERT INTO soheader (订单号,客户号,下单日期) VALUES (%s,%s,%s);""" #print newdata[u'下单日期'] #self.cur.execute(sql, data) #self.conn.commit() #self.closeDb() event.Skip()
def OnCellDClicked(self, event): soshowdialog = SO_DIALOG(self, flag='read', data=self.selectedItem) soshowdialog.Center(wx.CENTER_ON_SCREEN) Detailcollables = [item[2] for item in SODETAIL] Detailtablecollables = [item[1] for item in SODETAIL] detailtable = SoTable(self.detaildata, None, Detailcollables, Detailtablecollables, None) soshowdialog.m_grid4.SetTable(detailtable) soshowdialog.m_grid4.AutoSizeColumns() if soshowdialog.ShowModal() == wx.ID_OK: soshowdialog.getData()