Esempio n. 1
0
        public ActionResult Create(Factor factor)
        {
            if (ModelState.IsValid)
            {
                db.Factor.Add(factor);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.idRiesgo_fk = new SelectList(db.Riesgo, "idRiesgo", "nbrRiesgo", factor.idRiesgo_fk);
            return View(factor);
        }
Esempio n. 2
0
 public ActionResult Edit(Factor factor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(factor).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.idRiesgo_fk = new SelectList(db.Riesgo, "idRiesgo", "nbrRiesgo", factor.idRiesgo_fk);
     return View(factor);
 }