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); }
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); }