Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
        public async Task <IHttpActionResult> ChangePassword(RealEstateAccountChangePasswordDto arguments)
        {
            bool update = _service.ChangePassword(arguments);

            return(Ok(RealEstateResponse <bool> .Create(update)));
        }