Esempio n. 1
0
        public ActionResult Edit(PersonViewModel model)
        {
            if (model == null)
            {
                return(View());
            }

            var request = PersonMapper.MapUpdateRequestFromViewModel(model);

            if (request.IsNotValid())
            {
                model.Message = ConstHelper.REQUEST_NOT_VALID;
                return(View(model));
            }

            var response = _personService.Update(request);

            if (response.Status)
            {
                return(Redirect($"{DETAIL_URL}?uid={response.Model.UId}"));
            }

            model.Message = response.Message;
            return(View(model));
        }