public UserActivateResponseDto UpdateUserActive(UserActivateRequestDto userActivateRequestDto) { UserActivateResponseDto userActivateResponseDto; try { userActivateResponseDto = businessAuthentication.UpdateUserActive(userActivateRequestDto); userActivateResponseDto.ServiceResponseStatus = 1; } catch (SSException applicationException) { userActivateResponseDto = new UserActivateResponseDto { ServiceResponseStatus = 0, ErrorMessage = applicationException.Message, ErrorCode = applicationException.ExceptionCode }; } catch (Exception exception) { userActivateResponseDto = new UserActivateResponseDto { ServiceResponseStatus = 0, ErrorCode = ExceptionAttributes.ExceptionCodes.InternalServerError, ErrorMessage = exception.Message }; } return(userActivateResponseDto); }
public UserActivateResponseDto UpdateUserActive(UserActivateRequestDto userActivateRequestDto) { UserActivateResponseDto userActivateResponseDto = new UserActivateResponseDto(); var cModel = new UserActivateCM { UserId = userActivateRequestDto.UserId, IsActive = userActivateRequestDto.IsActive }; var response = authenticationRepository.UpdateUserActive(cModel); userActivateResponseDto.RegisteredUserId = response.RegisteredUserId; return(userActivateResponseDto); }
public UserActivateResponseDto UpdateUserPassword(UserPasswordRequestDto userPasswordRequestDto) { UserActivateResponseDto userActivateResponseDto = new UserActivateResponseDto(); var keyNew = Helper.GeneratePassword(25); var password = Helper.EncodePassword(userPasswordRequestDto.NewPassword, keyNew); var cModel = new UserPasswordCM { UserId = userPasswordRequestDto.UserId, UserPassword = password, PasswordSalt = keyNew }; var response = authenticationRepository.UpdateUserPassword(cModel); userActivateResponseDto.RegisteredUserId = response.RegisteredUserId; return(userActivateResponseDto); }
public UserActivateResponseDto UpdateUserPassword(UserPasswordRequestDto userPasswordRequestDto) { UserActivateResponseDto userActivateResponseDto = new UserActivateResponseDto(); try { AuthenticationRequestDto authenticationRequestDto = new AuthenticationRequestDto { UserName = userPasswordRequestDto.UserName, UserPassword = userPasswordRequestDto.Password }; var authenticationResponseDto = reportAuthentication.Authenticate(authenticationRequestDto); if (string.IsNullOrEmpty(authenticationResponseDto.LoginName)) { userActivateResponseDto.ServiceResponseStatus = 0; userActivateResponseDto.ErrorMessage = "Old Password is invalid"; } else { userActivateResponseDto = businessAuthentication.UpdateUserPassword(userPasswordRequestDto); userActivateResponseDto.ServiceResponseStatus = 1; } } catch (SSException applicationException) { userActivateResponseDto = new UserActivateResponseDto { ServiceResponseStatus = 0, ErrorMessage = applicationException.Message, ErrorCode = applicationException.ExceptionCode }; } catch (Exception exception) { userActivateResponseDto = new UserActivateResponseDto { ServiceResponseStatus = 0, ErrorCode = ExceptionAttributes.ExceptionCodes.InternalServerError, ErrorMessage = exception.Message }; } return(userActivateResponseDto); }