public async Task <bool> ChangePassword(RealEstateAccountChangePasswordDto realEstateAccount) { var result = await Service.Post <bool, NullServiceObject>(GenerateUrl("ChangePassword"), realEstateAccount); await HandleResponseShowError(result); return(result?.Response?.Data ?? false); }
public bool ChangePassword(RealEstateAccountChangePasswordDto model) { try { var item = _realEstateEntities.Accounts.Find(model.AccountId); if (model.NewPassword != model.ConfirmNewPassword) { return(false); } if (model.CurrentPassword != Security.MD5Decrypt(item.Password)) { return(false); } item.Password = Security.MD5Encrypt(model.NewPassword); _realEstateEntities.SaveChanges(); return(true); } catch (System.Exception) { return(false); } }
public async Task <IHttpActionResult> ChangePassword(RealEstateAccountChangePasswordDto arguments) { bool update = _service.ChangePassword(arguments); return(Ok(RealEstateResponse <bool> .Create(update))); }