Exemple #1
0
        static void Main(string[] args)
        {
            while (true)
            {
                if (LoginValidation.CountFailedLog())
                {
                    Logger.LogActivity("You can not login");
                    Console.WriteLine("You can not login");
                    return;
                }

                Console.WriteLine("Enter username: "******"Enter password: "******"Role of user: "******"User is anonymous");
                        break;

                    case UserRoles.ADMIN:
                        Console.WriteLine("User is admin");
                        bool showMenu = true;
                        while (showMenu)
                        {
                            showMenu = administrator();
                        }
                        break;

                    case UserRoles.INSPECTOR:
                        Console.WriteLine("User is stident");
                        break;

                    case UserRoles.PROFESSOR:
                        Console.WriteLine("User is professor");
                        break;

                    case UserRoles.STUDENT:
                        Console.WriteLine("User is inspektor");
                        break;

                    default:
                        Console.WriteLine("Error");
                        break;
                    }
                }
                else
                {
                    Logger.LogActivity("Fail " + DateTime.Now);
                    bool isUserFailedToLogin = LoginValidation.CountFailedLog();
                    if (isUserFailedToLogin)
                    {
                        Console.WriteLine("Now you can`t login.");
                        return;
                    }
                }
            }
        }