public ActionResult Edit(Person person) { if (ModelState.IsValid) { PersonService.UpdatePerson(person); return RedirectToAction(INDEX_VIEW); } else { return View(GetModel(person)); } }
public PersonViewModel(Person person) { Person = person; }
public void UpdatePerson(Person person) { person.CreatedDate = DateTime.Now; PersonRepository.UpdatePerson(person); }
public void DeletePerson(Person person) { PersonRepository.DeletePerson(person); }
public ActionResult Delete(Person person) { PersonService.DeletePerson(person); return Json(JSON_SUCCESS, JsonRequestBehavior.AllowGet); }
private PersonViewModel GetModel(Person person) { return new PersonViewModel(person); }