コード例 #1
0
ファイル: Program.cs プロジェクト: Zeynal-tm/Account
        static void Main(string[] args)
        {
            List <User>   users   = new List <User>();
            string        exit    = string.Empty;
            bool          isExit  = false;
            Authorization log     = new Authorization(users);
            bool          isAdmin = log.EnterLogin();

            AddingUsers addingUsers = new AddingUsers(users);

            if (isAdmin)
            {
                exit = addingUsers.SelectOptionForAdmin();
            }

            while (true)
            {
                if (!string.IsNullOrEmpty(exit))
                {
                    var currentUser = log.RepeatLoggingIn();
                    if (currentUser == null)
                    {
                        addingUsers.SelectOptionForAdmin();
                    }
                    else
                    {
                        isExit = addingUsers.SelectOptionForUser(currentUser);
                    }
                }

                if (!isExit)
                {
                    break;
                }
            }
        }
コード例 #2
0
 public Authorization(List <User> users)
 {
     this.users = users;
     adding     = new AddingUsers(users);
 }