Example #1
0
        public static void Main(string[] args)
        {
            UserData.ResetTestUserData();
            string username = null, password = null;

            Console.WriteLine("0-Exit");
            Console.WriteLine("1-Login");
            //Console.WriteLine("2-Register");

            Console.Write("Choose command: ");
            var command = int.Parse(Console.ReadLine());

            if (command == 0)
            {
                Console.WriteLine("Bye");
            }

            var done = false;

            while (command != 0 && !done)
            {
                switch (command)
                {
                case 0:
                    break;

                case 1:
                    Console.Write("Username:"******"Password:"******"Choose command: ");
                        command = int.Parse(Console.ReadLine());
                    }

                    break;

                //case 2:
                //  break;

                default:
                    Console.Write("Wrong command!!! Try again: ");
                    command = int.Parse(Console.ReadLine());
                    break;
                }
            }
        }
        static void Main(string[] args)
        {
            UserData.ResetTestUserData();
            RightsGranted.InitRoleRights();

            Console.Write("Username: "******"Password: ");
            string password = Console.ReadLine();


            LoginValidation validator = new LoginValidation(username, password, Console.WriteLine);
            User            user      = null;

            if (validator.ValidateUserInput(ref user))
            {
                SelectMenuOption(user);
            }
        }