示例#1
0
        public ActionResult DeleteConfirmed(long id)
        {
            tblATPlant tblATPlant = db.tblATPlants.Find(id);

            db.tblATPlants.Remove(tblATPlant);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 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));
 }
示例#3
0
        // 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));
        }