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); }
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); }