def sign_in(self):
        try:
            id = int(input("Enter Customer ID\n> "))
        except:
            print("Invalid ID")
            return

        if db_admin.check_customer_exists(id) is True:
            customer: Customer = database.get_all_info_customer(id)
            if customer.get_status() == CustomerStatus.locked.value:
                print(
                    "Sorry Your Account has been locked due to 3 unsuccessful login attempts"
                )
                return
            password = input("Enter Password\n> ")
            res = database.login_customer(id, password)
            if res:
                database.reset_login_attempts(id)
                self.set_id_all_states(id)
                print("Login Successful")
            else:
                att = customer.get_login_attempts() - 1
                customer.set_login_attempts(att)
                database.update_customer(customer)
                print("Incorrect Password")
                input("\nPress ENTER to continue...")
        else:
            print("Customer doesn't exist")
def sign_in():
    try:
        id = int(input("Enter Customer ID\n"))
    except:
        print("Invalid ID")
        return

    if db_admin.check_customer_exists(id) is True:
        customer = database.get_all_info_customer(id)
        password = input("Enter Password\n")
        res = database.login_customer(id, password)
        if res is True:
            print("Login Successful")
            ch = 1
            while ch != 0:
                print("\n--- Menu ---")
                print("1. Available Books")
                print("2. Issue Book")
                print("3. Return Book")
                print("4. Issued Books")
                print("5. Change Password")
                print("0. Logout")

                try:
                    ch = int(input())
                except:
                    print("Invalid Choice")
                    ch = 1
                    continue

                if ch == 1:
                    database.avail_book()
                elif ch == 2:
                    database.issuebook(id)
                elif ch == 3:
                    database.returnbook(id)
                elif ch == 4:
                    database.issued_books(id)
                elif ch == 5:
                    login_menu.change_password(id)
                elif ch == 0:
                    print("Logged Out Successfully")
                else:
                    print("Invalid Choice")
    else:
        print("Customer doesn't exist")
def sign_in():
    try:
        id = int(input("Enter Customer ID\n"))
    except:
        print("Invalid ID")
        return

    if db_admin.check_customer_exists(id) is True:
        customer = database.get_all_info_customer(id)
        if customer.get_status() == "locked":
            print("Sorry Your Account has been locked due to 3 unsuccessful login attempts")
            return
        password = input("Enter Password\n")
        res = database.login_customer(id,password)
        if res is True:
            database.reset_login_attempts(id)
            print("Login Successful")
            ch = 1
            while ch != 0:
                print("\n--- Menu ---")
                print("1. Address Change")
                print("2. Open New Account")
                print("3. Money Deposit")
                print("4. Money Withdrawal")
                print("5. Transfer Money")
                print("6. Print Statement")
                print("7. Account Closure")
                print("8. Avail Loan")
                print("0. Logout")

                try:
                    ch = int(input())
                except:
                    print("Invalid Choice")
                    ch = 1
                    continue

                if ch == 1:
                    login_menu.change_address(id)
                elif ch == 2:
                    login_menu.open_new_account(id)
                elif ch == 3:
                    login_menu.deposit_money(id)
                elif ch == 4:
                    login_menu.withdraw_money(id)
                elif ch == 5:
                    login_menu.transfer_money(id)
                elif ch == 6:
                    login_menu.print_statement(id)
                elif ch == 7:
                    login_menu.close_account(id)
                elif ch == 8:
                    login_menu.avail_loan(id)
                elif ch == 0:
                    print("Logged Out Successfully")
                else:
                    print("Invalid Choice")

        else:
            att = customer.get_login_attempts()-1
            customer.set_login_attempts(att)
            database.update_customer(customer)
            print("Incorrect Password")


    else:
        print("Customer doesn't exist")