def Unassign(self): TagNumber = self.TagNumberEntry.get() CamperName = self.CamperNameEntry.get() self.TagNumberEntry.delete(0, len(TagNumber)) self.CamperNameEntry.delete(0, len(CamperName)) DBObj = DBNode("402DB", "123456", "Test") DBObj.UnAssignTag(TagNumber, CamperName)
def Register(self): TagNumber = self.TagNumberEntry.get() Active_start = self.ActiveDateEntry.get() Active_end = self.EndDateEntry.get() Active_Flag = self.ActiveFlagEntry.get() self.TagNumberEntry.delete(0, len(TagNumber)) self.ActiveDateEntry.delete(0, len(Active_start)) self.EndDateEntry.delete(0, len(Active_end)) self.ActiveFlagEntry.delete(0, len(Active_Flag)) DBObj = DBNode("root", "Ih821hwt", "Test") DBObj.InsertToTag(TagNumber, Active_start, Active_end, Active_Flag) content = tk.StringVar() WELCOME_MSG = TagNumber + ''' Tag has been registered. Thank You!''' WELCOME_DURATION = 3000 top = tk.Toplevel() top.title('Tag Registration') Message(top, text=WELCOME_MSG, padx=20, pady=20).pack() top.after(WELCOME_DURATION, top.destroy)
def create(self, name, mode, encoding): node = DBNode(name, mode, encoding) if self.first == None: self.first = node else: aux = self.first while True: if aux.name == node.name and aux.mode == mode: return 1 if aux.next == None: break aux = aux.next aux.next = node return 0
def __init__(self, master): self.master = master self.frame = tk.Frame(self.master) self.frame.pack() style = ttk.Style() style.map("C.TButton", foreground=[('pressed', 'red'), ('active', 'blue')], background=[('pressed', '!disabled', 'black'), ('active', 'red')]) #Menu features CheckInButton = ttk.Button(self.frame, text='Camper Check In', style="C.TButton", width=25, command=self.CheckIn) CheckInButton.pack() CheckOutButton = ttk.Button(self.frame, text='Camper Check Out', style="C.TButton", width=25, command=self.CheckOut) CheckOutButton.pack() self.DBObj = DBNode("402DB", "123456", "Test")
class checkInOut: def __init__(self, master): self.master = master self.frame = tk.Frame(self.master) self.frame.pack() style = ttk.Style() style.map("C.TButton", foreground=[('pressed', 'red'), ('active', 'blue')], background=[('pressed', '!disabled', 'black'), ('active', 'red')]) #Menu features CheckInButton = ttk.Button(self.frame, text='Camper Check In', style="C.TButton", width=25, command=self.CheckIn) CheckInButton.pack() CheckOutButton = ttk.Button(self.frame, text='Camper Check Out', style="C.TButton", width=25, command=self.CheckOut) CheckOutButton.pack() self.DBObj = DBNode("402DB", "123456", "Test") def CheckIn(self): def performSearch(): name = searchBox.get() self.DBObj.CheckIn(name) self.newWindow = tk.Toplevel(self.master) #Menu features CamperName = tk.Label(self.newWindow, text="Camper Name", width=25) CamperName.pack() searchBox = tk.Entry(self.newWindow) searchBox.pack() searchBox.focus_set() eb = ttk.Button(self.newWindow, text='Check In', style="C.TButton", width=25, command=performSearch) eb.pack() def CheckOut(self): def performSearch(): name = searchBox.get() self.DBObj.CheckOut(name) self.newWindow = tk.Toplevel(self.master) #Menu features CamperName = tk.Label(self.newWindow, text="Camper Name", width=25) CamperName.pack() searchBox = tk.Entry(self.newWindow) searchBox.pack() searchBox.focus_set() eb = ttk.Button(self.newWindow, text='Check Out', style="C.TButton", width=25, command=performSearch) eb.pack()