// GET: /Manage/ChangePassword public async Task<ActionResult> AddPerson() { ViewBag.Title = "Add Person"; ViewBag.SaveText = "Add Person"; var model = new PersonViewModel(Enumerations.ModifyActionRequired.Add); return View("AddModifyPerson", model); }
public async Task<ActionResult> AddModifyPerson(PersonViewModel model) { if (!ModelState.IsValid) { return View(model); } ManagePersonService.SavePerson(GetUserId(), model.ToDto()); return RedirectToAction("Index"); }
public async Task<ActionResult> ModifyPerson(string id) { ViewBag.Title = "Edit Person"; ViewBag.SaveText = "Update Person"; var userId = GetUserId(); if (!ManagePersonService.CheckIfPersonBelongsToUser(userId, id)) return View("ErrorPage", new ErrorViewModel("Unkown Person", "This Person Is Unknown")); var person = ManagePersonService.GetPerson(id); var model = new PersonViewModel(person); return View("AddModifyPerson", model); }