Пример #1
0
        def recup_add_data(
        ):  # function that will use tkinter input to feed SQL database trougth SQLManager after check
            name = name_frame_value.get()
            side = side_frame_value.get()
            color = color_frame_value.get()
            length = length_frame_value.get()
            filename = filename_frame_value.get()

            if (name != "" and side != "" and color != "" and length != ""
                    and filename != ""):  # if all fields are fullfield
                test_passed = True
            else:
                test_passed = False

            if test_passed:  # if all fields are fullfield
                # then no_previous record check :
                if (SQLManager.retrive_video_path(name, side, color) == []):
                    print("Pas de résultats équivalent, enregistrement ok ")
                    SQLManager.ajout_dyn(name, side, color, length, filename)
                    messagebox.showinfo("Validation", "Enregistrement ok")
                    ref_video()
                    add_video.destroy()

                else:
                    print(
                        "Un enregistrement existe déjà avec les mêmes références coleur, côté et action"
                    )
                    print(SQLManager.retrive_video_path(name, side, color))
            else:
                print("Remplir tous les champs SVP")
Пример #2
0
        def recup_mod_data(
        ):  # function that will use tkinter input to feed SQL database trougth SQLManager after check
            name = name_frame_value.get()
            side = side_frame_value.get()
            color = color_frame_value.get()
            length = length_frame_value.get()
            filename = filename_frame_value.get()

            if (name != "" and side != "" and color != "" and length != ""
                    and filename != ""):  # if all fields are fullfield
                test_passed = True
            else:
                test_passed = False

            if test_passed:  # if all fields are fullfield
                print("Pas de résultats équivalent, enregistrement ok ")
                SQLManager.delete_vid(indexSel)
                SQLManager.ajout_dyn(name, side, color, length, filename)
                messagebox.showinfo("Validation", "Enregistrement ok")
                mod_video.destroy()

            else:
                print("Remplir tous les champs SVP")