public ActionResult DeleteConfirmed(long id) { tblATPlant tblATPlant = db.tblATPlants.Find(id); db.tblATPlants.Remove(tblATPlant); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "plant_id,plant_name,node_id,img,details")] tblATPlant tblATPlant) { if (ModelState.IsValid) { db.Entry(tblATPlant).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.node_id = new SelectList(db.tblATNodes, "node_id", "node_name", tblATPlant.node_id); return(View(tblATPlant)); }
// GET: Plant/Details/5 public ActionResult Details(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblATPlant tblATPlant = db.tblATPlants.Find(id); if (tblATPlant == null) { return(HttpNotFound()); } return(View(tblATPlant)); }