public ActionResult DeleteConfirmed(string id) { tblPlantMaster tblPlantMaster = db.tblPlantMasters.Find(id); db.tblPlantMasters.Remove(tblPlantMaster); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,SensorID,PointID,MachineID,TrainID,AreaID,PlantID,UserID")] tblPlantMaster tblPlantMaster) { if (ModelState.IsValid) { db.Entry(tblPlantMaster).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AreaID = new SelectList(db.tblAreas, "AreaID", "AreaName", tblPlantMaster.AreaID); ViewBag.PlantID = new SelectList(db.tblPlants, "PlantID", "PlantName", tblPlantMaster.PlantID); ViewBag.TrainID = new SelectList(db.tblTrains, "TrainID", "TrainName", tblPlantMaster.TrainID); ViewBag.UserID = new SelectList(db.tblUserRegisters, "UserID", "FirstName", tblPlantMaster.UserID); return(View(tblPlantMaster)); }
// GET: tblPlantMasters/Details/5 public ActionResult Details(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblPlantMaster tblPlantMaster = db.tblPlantMasters.Find(id); if (tblPlantMaster == null) { return(HttpNotFound()); } return(View(tblPlantMaster)); }
// GET: tblPlantMasters/Edit/5 public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblPlantMaster tblPlantMaster = db.tblPlantMasters.Find(id); if (tblPlantMaster == null) { return(HttpNotFound()); } ViewBag.AreaID = new SelectList(db.tblAreas, "AreaID", "AreaName", tblPlantMaster.AreaID); ViewBag.PlantID = new SelectList(db.tblPlants, "PlantID", "PlantName", tblPlantMaster.PlantID); ViewBag.TrainID = new SelectList(db.tblTrains, "TrainID", "TrainName", tblPlantMaster.TrainID); ViewBag.UserID = new SelectList(db.tblUserRegisters, "UserID", "FirstName", tblPlantMaster.UserID); return(View(tblPlantMaster)); }