Exemplo n.º 1
0
        public ActionResult Create(KPI kpi)
        {
            if (ModelState.IsValid)
            {
                db.KPIs.Add(kpi);
                db.SaveChanges();
                return RedirectToAction("../Containers/Index");
            }

            ViewBag.ContainerID = new SelectList(db.Containers, "ContainerID", "ContainerCode", kpi.ContainerID);
            return View(kpi);
        }
Exemplo n.º 2
0
 public ActionResult Edit(KPI kpi)
 {
     if (ModelState.IsValid)
     {
         db.Entry(kpi).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("../Containers/Index");
     }
     ViewBag.ContainerID = new SelectList(db.Containers, "ContainerID", "ContainerCode", kpi.ContainerID);
     return View(kpi);
 }