public bool ChangePassword(string userId, string oldPassword, string newPassword) { try { if (!string.IsNullOrWhiteSpace(userId) && !string.IsNullOrWhiteSpace(oldPassword) && !string.IsNullOrWhiteSpace(newPassword)) { UserBC UserBC = new UserBC(); return(UserBC.ChangePassword(userId, oldPassword, newPassword)); } else { throw new Exception("User/oldPassword/newPassword is required and it cannot be null.."); } } catch (Exception ex) { throw ex; } finally { } }
public override UpdateUserRes Execute(UpdateUserReq pServiceRequest) { UpdateUserRes wRes = new UpdateUserRes(); UserBC wUserBC = new UserBC(pServiceRequest.ContextInformation.AppId, pServiceRequest.SecurityProviderName); if (string.IsNullOrEmpty(pServiceRequest.BusinessData.UserName)) { pServiceRequest.BusinessData.UserName = pServiceRequest.BusinessData.UsersBE.UserName; } //ChangePassword != null indica la intencion de cambio de clave if (pServiceRequest.BusinessData.ChangePassword != null) { wUserBC.ChangePassword(pServiceRequest.BusinessData.UsersBE.UserName, pServiceRequest.BusinessData.ChangePassword.Old, pServiceRequest.BusinessData.ChangePassword.New); } //Si PasswordOnly = true pasa por alto la actuaizacion del usuario if (pServiceRequest.BusinessData.PasswordOnly == false) { wUserBC.Update(pServiceRequest.BusinessData.UsersBE, pServiceRequest.BusinessData.UserName); } return(wRes); }