예제 #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);
        }
예제 #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);
 }