def MODIFY(self): if DB.Validation_Date( self.StartTime.get()) == 1 and DB.Validation_Date( self.EndTime.get()): ST = DB.Correction_Date(self.StartTime.get()) ET = DB.Correction_Date(self.EndTime.get()) query = " UPDATE Event_ SET StartTime = '" + str( ST) + "' , EndTime = '" + str(ET) + "' , SeverityID = '" + str( self.col_severity.current()) + "' ,TypeID = '" + str( self.col_typ.current()) + "' ,TimeZoneID = '" + str( self.col_tim.current() ) + "' ,AirportID = '" + str(self.col_air.current( )) + "' where EventID = " + str(self.ID) + ";" self.DB.Run_Query(query) self.CALL_Principal() else: tk.messagebox.showinfo(" Echec ", " La Date saisie est erronée ")
def Insertion_DB(self): if DB.Validation_Date( self.StartTime.get()) == 1 and DB.Validation_Date( self.EndTime.get()): ST = DB.Correction_Date(self.StartTime.get()) ET = DB.Correction_Date(self.EndTime.get()) new_id = self.DB.GET_new_index_event() query = "INSERT INTO Event_(EventID , StartTime , EndTime , SeverityID , TypeID ,TimeZoneID ,AirportID ) VALUES (" + str( new_id) + ", '" + str(ST) + "', '" + str(ET) + "', '" + str( self.col_severity.current()) + "', '" + str( self.col_typ.current()) + "','" + str( self.col_tim.current()) + "','" + str( self.col_air.current()) + "');" self.DB.Run_Query(query) self.window.destroy() new_window = tk.Tk() Modif(new_window, new_id) else: tk.messagebox.showinfo(" Echec", " La Date saisie est erronée ")