def update_student(self): if not self.rows: messagebox.showerror("Error", "Choose a student from the table first") return elif not SISdatabase.info_checker(self.id_no.get(), self.name.get().upper(), self.year.get(), self.course.get().upper(), self.gender.get().upper()): return else: if messagebox.askyesno( "Update Course", "Do you wish to update the student information?"): if SISdatabase.update_student_rec(self.rows[0], self.id_no.get(), self.name.get().upper(), self.year.get(), self.course.get().upper(), self.gender.get()): messagebox.showinfo( "Success", "Information on student has been updated!") self.clear_data() self.rows = [] displaytable.display_student_table(self.student_table)
def add_student(self): if messagebox.askyesno( "Add Student", "Do you want to add the student in the database"): if not SISdatabase.info_checker(self.id_no.get(), self.name.get().upper(), self.year.get(), self.course.get().upper(), self.gender.get().upper()): return else: if SISdatabase.add_student_rec(self.id_no.get(), self.name.get().upper(), self.year.get(), self.course.get().upper(), self.gender.get()): messagebox.showinfo("Success", "Student added to database") self.clear_data() displaytable.display_student_table(self.student_table) else: return