Esempio n. 1
0
    def submit(self):
        # Create a User Object
        # Fetch the Username and Password from Entries set to User object
        user = User()
        user.setUsername(self.fld_Username.get())
        user.setPassword(self.fld_Password.get())
        # Logincontroller()

        # Call the authentication method from logincontroller class pass the User object to validate-
        # user (Office staff or Seller) otherwise will not be given access to user
        results = LoginController().authentication(user)

        if results == 'Officestaff':
            # print the message login successfully
            # Destroy the current login window
            # Open the office staff dashboard
            mb.showinfo("System message", "Successfully login Office staff")
            self.root.destroy()

            # if the self.__results== office staff,it will open the office staff dashboard
            OfficeStaffDashboardView()

        elif results == 'Seller':
            # print the message successfully
            mb.showinfo("System message", "Successfully login Seller")
            self.root.destroy()
            Seller_Dashboard()

        # if the self.__results==seller,it will open the seller dashboard
        else:
            # print the incorrect user name or password
            # otherwise give the chance to try again
            mb.showwarning("System message", "Incorrect username or password")
Esempio n. 2
0
 def back(self):
     from View.OfficeStaffDashboardView import OfficeStaffDashboardView
     self.root.destroy()
     OfficeStaffDashboardView()