public ActionResult DeleteConfirmed(int id) { Ethenic ethenic = Service.GetById(id); Service.Delete(ethenic); return(RedirectToAction("Index")); }
public ActionResult Edit(Ethenic ethenic) { if (ModelState.IsValid) { Service.Update(ethenic); return(RedirectToAction("Index")); } return(View(ethenic)); }
// GET: Ethenics/Edit/5 public ActionResult Edit(int id) { Ethenic ethenic = Service.GetById(id); if (ethenic == null) { return(HttpNotFound()); } return(View(ethenic)); }
// GET: Ethenics/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Ethenic ethenic = Service.GetById(id.GetValueOrDefault()); if (ethenic == null) { return(HttpNotFound()); } return(View(ethenic)); }