Exemple #1
0
        public ActionResult Create([Bind(Include = "EFKey,AccountNumber,Name,LocationCode,ImportOffSet")] Supplier supplier)
        {
            if (ModelState.IsValid)
            {
                db.Suppliers.Add(supplier);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(supplier));
        }
        public ActionResult Create([Bind(Include = "Id,Sku,Name")] PlantName plantName)
        {
            if (ModelState.IsValid)
            {
                db.PlantNames.Add(plantName);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(plantName));
        }
Exemple #3
0
        public ActionResult Create([Bind(Include = "GroupId,Description")] Group group)
        {
            if (ModelState.IsValid)
            {
                db.Groups.Add(group);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(group));
        }
        public ActionResult Create([Bind(Include = "PlantGroupId,PlantId,GroupId")] PlantGroup plantGroup)
        {
            if (ModelState.IsValid)
            {
                db.PlantGroups.Add(plantGroup);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.GroupId = new SelectList(db.Groups, "GroupId", "Description", plantGroup.GroupId);
            ViewBag.PlantId = new SelectList(db.PlantNames, "PlantId", "Sku", plantGroup.PlantId);
            return(View(plantGroup));
        }