public ActionResult Edit([Bind(Include = "Id,Name,Phone,Address,State,CountryId")] Model.Model.Person person) { if (ModelState.IsValid) { _PersonService.Update(person); return(RedirectToAction("Index")); } ViewBag.CountryId = new SelectList(_CountryService.GetAll(), "Id", "Name", person.CountryId); return(View(person)); }
// GET: /Person/Delete/5 public ActionResult Delete(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Model.Model.Person person = _PersonService.GetById(id.Value); if (person == null) { return(HttpNotFound()); } return(View(person)); }
// GET: /Person/Edit/5 public ActionResult Edit(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Model.Model.Person person = _PersonService.GetById(id.Value); if (person == null) { return(HttpNotFound()); } ViewBag.CountryId = new SelectList(_CountryService.GetAll(), "Id", "Name", person.CountryId); return(View(person)); }
public ActionResult DeleteConfirmed(long id) { Model.Model.Person person = _PersonService.GetById(id); _PersonService.Delete(person); return(RedirectToAction("Index")); }