public static void Main(string[] args) { EmployeePortal _employeePortal = new EmployeePortal(); _employeePortal.UserControl(); Console.ReadLine(); }
/// <summary> /// To get the choice of user /// </summary> public void UserControl() { int option = 0; while (option != 3) { Console.WriteLine(StringLiterals.UserChoice); option = int.Parse(Console.ReadLine()); switch (option) { case 1: { EmployeePortal.LoginOption(); break; } case 2: { EmployeePortal.RegistrationOption(); break; } case 3: { break; } } } }
/// <summary> /// Login Credintals /// </summary> private static void LoginOption() { LoginModel loginModel = new LoginModel(); Console.WriteLine(StringLiterals.Login + StringLiterals.EmailId); loginModel.EmailId = Console.ReadLine(); Console.WriteLine(StringLiterals.Password); loginModel.Password = Console.ReadLine(); string access = _authenticationModule.Login(loginModel); if (access == StringLiterals.LoginSuccessful) { Console.WriteLine(access); EmployeePortal.DisplayControl(); } else { Console.WriteLine(access); } }
/// <summary> /// Display the data /// </summary> private static void DisplayControl() { int displayOption = 0; while (displayOption != 4) { Console.WriteLine(StringLiterals.DisplayControl); displayOption = int.Parse(Console.ReadLine()); switch (displayOption) { case 1: { EmployeePortal.SqlDataRead(UserChoiceEnum.Student); break; } case 2: { EmployeePortal.SqlDataRead(UserChoiceEnum.Other); break; } case 3: { EmployeePortal.SqlDataRead(UserChoiceEnum.All); break; } case 4: { Console.WriteLine(StringLiterals.LogOutSuccessful); break; } } } }