예제 #1
0
 public ActionResult Edit([Bind(Include = "EFKey,AccountNumber,Name,LocationCode,ImportOffSet")] Supplier supplier)
 {
     if (ModelState.IsValid)
     {
         db.Entry(supplier).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(supplier));
 }
 public ActionResult Edit([Bind(Include = "PlantId,Sku,Name")] PlantName plantName)
 {
     if (ModelState.IsValid)
     {
         db.Entry(plantName).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(plantName));
 }
예제 #3
0
 public ActionResult Edit([Bind(Include = "GroupId,Description")] Group group)
 {
     if (ModelState.IsValid)
     {
         db.Entry(group).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(group));
 }
        public ActionResult Edit([Bind(Include = "PlantGroupId,PlantId,GroupId")] PlantGroup plantGroup)
        {
            var found = db.PlantGroups.FirstOrDefault(pg => pg.GroupId == plantGroup.GroupId && pg.PlantId == plantGroup.PlantId);

            if (ModelState.IsValid && found == null)
            {
                db.Entry(plantGroup).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index", "Groups"));
            }
            ViewBag.GroupId = new SelectList(db.Groups, "GroupId", "Description", plantGroup.GroupId);
            ViewBag.PlantId = new SelectList(db.PlantNames, "PlantId", "Sku", plantGroup.PlantId);
            return(View(plantGroup));
        }