public static bool loginaccountholder() { if (isHolderLoggedIn == true) { return(isHolderLoggedIn); } else { Console.Clear(); Console.WriteLine(" Account Holder Login"); Console.Write("enter your email: "); string email = Console.ReadLine(); int userId = AccountHolderService.LogInAccountholder(email); if (userId != 0) { isHolderLoggedIn = true; } AccountHolderService.GetAccountDetails(email); return(isHolderLoggedIn); } }
public static void HandleAccountHolderMenu(string subOption) { if (subOption.Equals("0")) { return; } else if (subOption.Equals("1")) { Console.Clear(); Console.WriteLine(" ACCOUNT HOLDER REGISTRATION"); Console.Write("Enter your First Name: "); string firstName = Console.ReadLine(); Console.Write("Enter your Last Name: "); string lastName = Console.ReadLine(); Console.Write("Enter your Middle Name: "); string middleName = Console.ReadLine(); Console.Write("Enter your Date Of Birth (yyyy/mm/dd): "); DateTime dateOfBirth = Convert.ToDateTime(Console.ReadLine()); Console.Write("Enter your Email Address: "); string email = Console.ReadLine(); Console.Write("Enter your Phone Number: "); string phoneNumber = Console.ReadLine(); Console.Write("Enter your Address: "); string address = Console.ReadLine(); Console.Write("Enter your Password: "******"Confirm your Password: "******"1"); } else if (subOption.Equals("2")) { if (AccountHolderService.isAcountHolderLoggedIn) { ShowLoggedInAccountHolderMenu(); string miniOption = Console.ReadLine(); if (miniOption.Equals("0")) { accountHolderService.Logoutaccountholder(); HandleSubMenu("1"); } else { HandleLoggedInAccountHolderMenu(miniOption); } } else { Console.Clear(); Console.WriteLine(" Account Holder Login"); Console.Write("enter your email: "); string email = Console.ReadLine(); Console.Write("enter your password: "******"2"); } } } else { HandleSubMenu("1"); } }