Example #1
0
 public ActionResult Edit(Guid? id)
 {
   var Person = new PersonModel();
   if (id != null)
     Person = Mapper.Map<PersonDTO, PersonModel>(_personReportService.GetById((Guid)id));
   return View("Edit", Person);
 }
Example #2
0
 private void Save(PersonModel model)
 {
   //if (model.PersonId == Guid.Empty)
   //{
   //  var createCommand = new AddPersonCommand(model.FullName);
   //  model.PersonId = _personCommandService.AddPerson(createCommand);
   //}
   //else
   //{
   //  var updateCommand = new EditPersonCommand(model.PersonId, model.Name, model.Description, model.ImageURL);
   //  _personCommandService.EditPerson(updateCommand);
   //}
 }
Example #3
0
      public ActionResult Edit(PersonModel model)
      {
        if (!ModelState.IsValid)
        {
          return ModelState.JsonValidation();
        }

        try
        {
          Save(model);
          return ModelState.JsonValidation(new { Success = true, model.PersonId });
        }
        catch (Exception ex)
        {
          ModelState.AddModelError("Edit_person", ex.Message);
        }
        return ModelState.JsonValidation();
      }