def srgroup(self, event): data = sq.wxsqsel('employee.db', 'Groups', 'groupname,Groupid ') fild_title = [u'کد گروه', u'نام گروه'] srch = wx.Dialog(self) pnlsr = sr.MyPanel1(srch, data, fild_title) srch.SetSize((259, 384)) srch.ShowModal() fs = pnlsr.retdata() self.fild2.SetValue(fs[0]) self.fild1.SetValue(fs[1]) self.Refresh() self.Layout() srch.Destroy()
def search(self, event): data = sq.wxsqsel('employee.db', 'employ', 'employid ,family , name') fild_title = [u'نام', u'نام خانوادگي', u'کد پرسنل'] srch = wx.Dialog(self) pnlsr = sr.MyPanel1(srch, data, fild_title) srch.SetSize((259, 384)) srch.ShowModal() fs = pnlsr.retdata() #print fs filds = self.showrecord(fs[0]) #print filds self.employfield(filds[0]) #gr.Layout() srch.Destroy()
def srshift(self, event): data = sq.wxsqsel('employee.db', 'Shifts', 'totime ,fromtime ,Shiftname') fild_title = [u'نام شيفت', u'از ساعت', u'تا ساعت'] srch = wx.Dialog(self) pnlsr = sr.MyPanel1(srch, data, fild_title) srch.SetSize((359, 384)) srch.ShowModal() fs = pnlsr.retdata() #print fs self.fild3.SetValue(fs[0]) self.fild2.SetValue(fs[1]) self.fild1.SetValue(fs[2]) self.Refresh() self.Layout() srch.Destroy()
def onsrch( self, event ): data = sq.wxsqsel('employee.db','employ','employid ,family , name') fild_title = [u'نام',u'نام خانوادگي',u'کد پرسنل'] gr = wx.Dialog(self) dlg = sr.MyPanel1(gr,data,fild_title) gr.SetSize((190,380)) gr.ShowModal() self.fs = dlg.retdata() self.filds = self.showrecord(self.fs[0]) for f in range(len(self.filds)): d=self.filds[f][0].split('/') dayname = JalaliDate(int(d[0]),int(d[1]),int(d[2])).strftime('%A') self.filds[f] = (dayname,)+self.filds[f] self.employfield(self.filds) gr.Destroy()
def srcbtn(self, event): data = sq.wxsqsel('employee.db', 'employ', 'employid ,family , name') fild_title = [u'نام', u'نام خانوادگي', u'کد پرسنل'] gr = wx.Dialog(self) dlg = sr.MyPanel1(gr, data, fild_title) gr.SetSize((190, 380)) gr.ShowModal() fs = dlg.retdata() filds = self.showrecord(fs[0]) #print filds self.shiftid = filds[0][2] self.groupid = filds[0][3] #print filds[0] self.employfield(filds[0]) gr.Destroy()
def __init__(self, parent, siz, data, fild_title): wx.Dialog.__init__(self, parent) self.parent = parent self.pnl = sr.MyPanel1(self, data, fild_title) self.SetSize(siz)