Example #1
0
        public static User CreateUser(string login, string password, UserPermision permision)
        {
            User user = new User();

            foreach (var v in Users)
            {
                if (v.Login == login)
                {
                    MessageBox.Show("Account With This Login Exist");
                    return(null);
                }
            }

            user.Login         = login;
            user.Password      = password;
            user.UserPermision = permision;

            Users.Add(user);
            return(user);
        }
Example #2
0
        public static void UpdateUser(string targetLogin, string newLogin, string newPassword, UserPermision newUserPermison)
        {
            foreach (var v in Users)
            {
                if (v.Login == targetLogin)
                {
                    v.Login         = newLogin;
                    v.Password      = newPassword;
                    v.UserPermision = newUserPermison;
                    return;
                }
            }

            MessageBox.Show("User Not Found");
        }