ChangeDataResponse IUserService.UpdateData(ChangeDataRequest request) { var response = new ChangeDataResponse { ResponseStatus = ResponseStatus.Success }; var usersProvider = new UsersProvider(); try { if (request.ActionType == ActionType.Update) { response.isSuccessful = usersProvider.ChangeUserData(request); if (response.isSuccessful) { var refreshUserRequest = new UserRequest { ActionType = ActionType.Select, UserName = request.UserData.UserName, Password = request.UserData.Password }; var newUserResponse = Login(refreshUserRequest); response.NewUser = newUserResponse.User; } } else { response.ResponseStatus = ResponseStatus.Failure; response.ResponseDescription = "Not update action"; } } catch (Exception ex) { response.ResponseStatus = ResponseStatus.Failure; response.ResponseDescription = ex.Message; } return(response); }