def Add_Clicked(self,event):
if (self.Validate_Roll_No(self.text_ctrl_1.Value)) and (self.Validate_Adm_No(self.text_ctrl_2.Value)) and (self.Validate_Name(self.text_ctrl_3.Value)):
try:
student_id,t1_id,t2_id,t3_id=self.DB.Add_Student(self.text_ctrl_1.Value,self.text_ctrl_2.Value,self.text_ctrl_3.Value,self.Parent.YEAR,self.Parent.CLASS,self.Parent.DIV)
#term,div_id,subject_index,student_id="All"
student_id="All"
if self.Parent.TERM_INDEX==0:
term="1"
t_id=t1_id
elif self.Parent.TERM_INDEX==1:
term="2"
t_id=t2_id
elif self.Parent.TERM_INDEX==2:
term="3"
t_id=t3_id
if self.Parent.SUBJECT=="Select":
ROW=[False,student_id,self.text_ctrl_2.Value,self.text_ctrl_3.Value,t_id,self.text_ctrl_1.Value,0,0,0,0]
div_id=self.DB.Get_Div_Id(self.Parent.YEAR,self.Parent.CLASS,self.Parent.DIV)
self.DB.Score_and_Roll(term,div_id,self.Parent.SUBJECT_INDEX,student_id)
dlg = wx.MessageDialog(self, 'Added Successfully', '',wx.OK | wx.ICON_INFORMATION)
self.success=True
self.STUDENT_INFO=[self.text_ctrl_1.Value,self.text_ctrl_2.Value,self.text_ctrl_3.Value]
dlg.ShowModal()
dlg.Destroy()
except:
dlg = wx.MessageDialog(self, 'Sorry, Could not Add', '',wx.OK | wx.ICON_ERROR)
self.STUDENT_INFO=[]
dlg.ShowModal()
dlg.Destroy()
self.Close()
评论列表
文章目录