Exemplo n.º 1
0
        public ActionResult Create(UOM uom)
        {
            if (ModelState.IsValid)
            {
                db.UOMs.Add(uom);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.UOM_TypeID = new SelectList(db.UOM_Types, "UOM_TypeID", "UOM_Type_Name", uom.UOM_TypeID);
            return View(uom);
        }
Exemplo n.º 2
0
 public ActionResult Edit(UOM uom)
 {
     if (ModelState.IsValid)
     {
         db.Entry(uom).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.UOM_TypeID = new SelectList(db.UOM_Types, "UOM_TypeID", "UOM_Type_Name", uom.UOM_TypeID);
     return View(uom);
 }