working_days.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:smartschool 作者: asifkodur 项目源码 文件源码
def OnSave(self, event):  # wxGlade: working_days.<event_handler>
        t1=str(self.text_ctrl_1.Value)
        t2=str(self.text_ctrl_2.Value)
        t3=str(self.text_ctrl_3.Value)

        err=False
        if not self.text_ctrl_1.Value.isdigit() and not self.text_ctrl_1.Value=='':err=True;self.text_ctrl_1.Value=''
        if not self.text_ctrl_2.Value.isdigit() and not self.text_ctrl_2.Value=='':err=True;self.text_ctrl_2.Value=''
        if not self.text_ctrl_3.Value.isdigit() and not self.text_ctrl_3.Value=='':err=True;self.text_ctrl_3.Value=''
        if err:

            dlg = wx.MessageDialog(self, 'Working days should be a digit', '',wx.OK | wx.ICON_ERROR)
            dlg.ShowModal()
            dlg.Destroy()
            return 0

        try:
            self.DB.Set_Working_Days(self.YEAR,'1',self.text_ctrl_1.Value)
            self.DB.Set_Working_Days(self.YEAR,'2',self.text_ctrl_2.Value)
            self.DB.Set_Working_Days(self.YEAR,'3',self.text_ctrl_3.Value)
            dlg = wx.MessageDialog(self, 'Successfully Saved', '',wx.OK | wx.ICON_INFORMATION)
            dlg.ShowModal()
            dlg.Destroy()

        except:
            dlg = wx.MessageDialog(self, 'Some error occured', '',wx.OK | wx.ICON_ERROR)
            dlg.ShowModal()
            dlg.Destroy()

        event.Skip()

# end of class working_days
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号