public ActionResult Update(ChangeProfileModel model) { if (ModelState.IsValid) { if (new ClienteService().UpdateCustomer(model)) { return Json( new JsonRequestResult { ResultType = JsonRequestResultType.Success, Message = Resources.Resource.Msg_Geral_RegistroDadosAlterados, ReturnUrl = Url.Content(@"~/Dashboard") }, JsonRequestBehavior.AllowGet); } } return Json(new JsonRequestResult { ResultType = JsonRequestResultType.Validation, Message = Resources.Resource.Msg_Geral_DadosIncorretos }); }
public ActionResult LoadUpdate() { if (UserAuthenticated == null || !UserAuthenticated.IdCliente.HasValue) { return PartialView("RegistrationUpdate", new ChangeProfileModel()); } var cliente = new ClienteService().GetById(UserAuthenticated.IdCliente.Value); var model = new ChangeProfileModel { DataNascimento = cliente.DataNascimento, Email = cliente.Email, OldEmail = cliente.Email, Nome = cliente.NomeCompleto, NumeroTelefone = cliente.Telefone }; return PartialView("RegistrationUpdate", model); }