public ActionResult DeleteConfirmed(int id) { var catalogManager = new CatalogManager(); Catalog catalog = catalogManager.GetCatalogById(id); catalogManager.DeleteAndSave(catalog); return(RedirectToAction("Index")); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var catalogManager = new CatalogManager(); Catalog catalog = catalogManager.GetCatalogById(id); if (catalog == null) { return(HttpNotFound()); } return(View(catalog)); }