コード例 #1
0
 def btnDelete_Click(self):
     global countIndex
     try:
         cus = Customer()
         cus.deleteCus(self.varid.get())
         tkinter.messagebox.showinfo("Sucess!",
                                     "Customer Deleted Sucessfully")
         Customer.FillCustomerList()
         countIndex = 0
     except Exception as ex:
         tkinter.messagebox.showinfo("Failure!", ex)
コード例 #2
0
 def btnAdd_Click(self):
     global countIndex
     try:
         cus = Customer()
         cus.id = self.varid.get()
         cus.Name = self.varName.get()
         cus.address = self.varAddress.get()
         cus.addCustomer()
         tkinter.messagebox.showinfo("Sucess!",
                                     "Customer Added Sucessfully")
         Customer.FillCustomerList()
         countIndex = 0
     except Exception as ex:
         tkinter.messagebox.showinfo("Failure!", ex)
コード例 #3
0
            CustomerForm.countIndex -= 1
        self.showCustomerByIndex(CustomerForm.countIndex)

    def btnNext_Click(self):
        if (CustomerForm.countIndex < len(Customer.cusList) - 1):
            CustomerForm.countIndex += 1
        self.showCustomerByIndex(CustomerForm.countIndex)

    def btnLast_Click(self):
        CustomerForm.countIndex = len(Customer.cusList) - 1
        self.showCustomerByIndex(CustomerForm.countIndex)

    def btnLoadData_Click(self):
        Customer.loadDatafromFile_Pickle()
        tkinter.messagebox.showinfo("Sucess!", "Data Loaded Sucessfully")

    def btnSaveData_Click(self):
        Customer.saveDatainFile_Pickle()
        tkinter.messagebox.showinfo("Sucess!", "Data Saved Sucessfully")

    def btnSort_Click(self):
        Customer.sortCustomer()
        tkinter.messagebox.showinfo("Sucess!", "Customer Sorted Sucessfully")


root = Tk()
Customer.FillCustomerList()
cusForm = CustomerForm(master=root)
root.title("Customer Form")
root.mainloop()