示例#1
0
 def store_mark_on_database(self):
     sid = self.et_st_id.get()
     cid = controller.filter_cid_cbb(self.cbb.get())
     mark = self.et_mark_input.get()
     condition, index = controller.check_sid_cid_on_mark(sid, cid)
     if condition:
         if Cs.input_float_controller(mark, 0, 20, self.label_sid_ano):
             marks_list[index].set_mark(mark)
             self.label_sid_ano.config(text="Mark is overridden successful",
                                       foreground="red")
     else:
         if Cs.input_float_controller(mark, 0, 20, self.label_sid_ano):
             marks_list.append(Mark(cid, sid, mark))
             self.label_sid_ano.config(text="Mark is added successful",
                                       foreground="red")
示例#2
0
 def command_button_enter(self):
     # check variable for checking name, dob, id
     check1, check2 = False, False
     # name checking
     check1 = Cs.input_a_s_controller(self.et_cour_name.get(), self.label_s_name_ano, "Name")
     # id checking
     if Cs.input_identifier(self.et_cour_id.get(), self.label_sid_ano) and not \
             controller.check_c_id(self.et_cour_id.get()):
         check2 = True
     elif controller.check_c_id(self.et_cour_id.get()):
         self.label_sid_ano.config(text="This ID is already exist")
     # if all true => save on database
     if check1 and check2:
         db.course_list.append(db.Course(self.et_cour_name.get(), self.et_cour_id.get()))
         self.label_s_name_ano.config(text="Information is added successful")
示例#3
0
 def store_mark_on_database(self):
     sid = self.et_st_id.get()
     cid = controller.filter_cid_cbb(self.cbb.get())
     mark = self.et_mark_input.get()
     condition = db_sql.check_sid_cid_exist_on_mark(sid, cid)
     if condition:
         if Cs.input_float_controller(mark, 0, 20, self.label_sid_ano):
             # db_sql.add_mark_to_db()
             db_sql.add_mark_to_db_if_overlap(sid, cid, mark)
             self.label_sid_ano.config(text="Mark is overridden successful",
                                       foreground="red")
     else:
         if Cs.input_float_controller(mark, 0, 20, self.label_sid_ano):
             db_sql.add_mark_to_db(sid, cid, mark)
             self.label_sid_ano.config(text="Mark is added successful",
                                       foreground="red")
示例#4
0
文件: 4.py 项目: letuss004/pp2021
 def check_input(self):
     length = len(self.entries_inf)
     # check variable for checking name, dob, id
     check1, check2 = False, False
     # name -> id -> dob
     for i in range(0, length):
         #
         if i == 0:  # name
             check1 = Cs.input_a_s_controller(self.et_name.get(), self.lb_ano_name, "Name")
         if i == 1:  # id
             if Cs.input_identifier(self.et_id.get(), self.lb_ano_id) \
                     and ip.input_c_id(self.et_id.get(), self.lb_ano_id):
                 check2 = True
             # check2 = Cs.input_identifier(self.et_id.get(), self.lb_ano_id)
     # if all true => save in database
     if check1 and check2:
         Db.st_list.append(Db.Course(self.et_name.get(), self.et_id.get()))
示例#5
0
 def command_button_enter(self):
     # check variable for checking name, dob, id
     check1, check2, check3 = False, False, False
     # name checking
     check1 = Cs.input_a_s_controller(self.et_st_name.get(),
                                      self.label_s_name_ano, "Name")
     # id checking
     if Cs.input_identifier(self.et_st_id.get(), self.label_sid_ano) and not \
             db_sql.check_s_id(self.et_st_id.get()):
         check2 = True
     elif db_sql.check_s_id(self.et_st_id.get()):
         self.label_sid_ano.config(text="This ID is already exist")
     # dob checking
     check3 = Cs.input_dob(self.et_st_dob.get(), self.label_s_dob_ano)
     # if all true => save on database
     if check1 and check2 and check3:
         db_sql.add_student_to_db(self.et_st_id.get(),
                                  self.et_st_name.get(),
                                  self.et_st_dob.get())
         self.label_s_dob_ano.config(text="Information is added successful")