예제 #1
0
        public ActionResult DeleteConfirmed(string id)
        {
            tblPlantMaster tblPlantMaster = db.tblPlantMasters.Find(id);

            db.tblPlantMasters.Remove(tblPlantMaster);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 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));
 }
예제 #3
0
        // 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));
        }
예제 #4
0
        // 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));
        }