Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            EmployeePortal _employeePortal = new EmployeePortal();

            _employeePortal.UserControl();
            Console.ReadLine();
        }
Exemplo n.º 2
0
        /// <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;
                }
                }
            }
        }
Exemplo n.º 3
0
        /// <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);
            }
        }
Exemplo n.º 4
0
        /// <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;
                }
                }
            }
        }