コード例 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Enter username: "******"Enter passsword: ");
            string password = Console.ReadLine();
            User   usr      = null;

            if (UserData.TestUserfEmpty() == true)

            {
                UserData.CopyTestUser();
            }



            LoginValidation validator = new LoginValidation(userName, password, OnError);

            if (validator.ValidateUserInput(ref usr) == true)
            {
                Console.WriteLine("Username: "******"Faculty Number: " + usr.facNumber);
                Console.WriteLine("Role ID: " + usr.role);



                switch (LoginValidation.currentUserRole)
                {
                case UserRoles.ANONYMOUS:
                    Console.WriteLine("You are anomymous");
                    break;

                case UserRoles.ADMIN:
                    Console.WriteLine("You are admin");
                    MenuAdmin();
                    break;

                case UserRoles.INSPECTOR:
                    Console.WriteLine("You are inspector");
                    break;

                case UserRoles.PROFESSOR:
                    Console.WriteLine("You are professor");
                    break;

                case UserRoles.STUDENT:
                    Console.WriteLine("You are student");
                    break;
                }
            }
            //validator.badLogin(userName, password);
        }