def getvalue(self, value):
        print(value)
        print(type(value))

        if value == 1:
            self.hide()
            view = sidebar.Dashboard(self)
        elif value == 2:
            self.hide()
            view = sidebar.Employee(self)
        elif value == 3:
            self.hide()
            view = sidebar.Table(self)
        elif value == 4:
            self.hide()
            view = sidebar.Reservations(self)
        elif value == 5:
            pass
        elif value == 6:
            self.hide()
            view = sidebar.Settings(self)
        elif value == 7:
            self.hide()
            view = sidebar.Orders(self)
        elif value == 8:
            self.hide()
            view = sidebar.Menu(self)
        elif value == 9:
            self.hide()
            view = sidebar.Bill(self)
예제 #2
0
    def loginBtnClicked(self):
        admin = Admin()

        checkLogin = admin.login(self.usernameInput.text(),
                                 self.passwordInput.text())

        if checkLogin:
            # self.loginErrorMsg.setText("Logged In")

            query = "update admin set logged_in='yes' where admin_name=%s"
            values = (self.usernameInput.text(), )

            data = self.db.execute(query, values)

            self.hide()
            loggedin = sidebar.Dashboard(self)
        else:
            self.loginErrorMsg.setText("Incorrect Combination")