Esempio n. 1
0
        public string ChangeUserInformation(User updatedUser)
        {
            string status = "Ok";

            var user = userRepositories.GetUser(updatedUser.Id);

            if (user == null)
            {
                return("Error");
            }
            userRepositories.ChangeUser(updatedUser);
            return(status);
        }
        public string ChangeUserRole(string newRole, int idUser)
        {
            string status = "Ok";

            var user = userRepositories.GetUser(idUser);

            if (newRole == "")
            {
                return("Error");
            }
            user.Role = newRole;
            userRepositories.ChangeUser(user);
            return(status);
        }