Esempio n. 1
0
        public void AddUserToChat(int addUserId, int idChat)
        {
            var us   = userRepositories.GetUser(addUserId);
            var chat = ChatRepositiries.GetChat(idChat);

            chat.Users = chat.Users + "," + us.Id;
            ChatRepositiries.ChangeChats(chat);
        }
Esempio n. 2
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);
        }