//Get: Description/Delete public ActionResult Delete(int id) { var service = new DescriptionService(); var description = service.GetDescription(id); return(View(description)); }
//Get: Description/Edit/{id} public ActionResult Edit(int id) { var service = new DescriptionService(); var detail = service.GetDescription(id); var model = new DescriptionEdit { DescriptionId = detail.DescriptionId, DescriptionName = detail.DescriptionName, }; return(View(model)); }
public ActionResult DeletePost(int id) { var service = new DescriptionService(); if (service.DeleteDescription(id)) { TempData["SaveResult"] = "Description Deleted"; return(RedirectToAction("Index")); } ModelState.AddModelError("", "Description could not be updated"); var model = service.GetDescription(id); return(View(model)); }