public ActionResult DeleteConfirmed(int id) { Factore factore = db.Factores.Find(id); db.Factores.Remove(factore); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,anosTrabajados,diasVacaciones,primaVacacional,porcentaje,diasAno,factorVacaciones,aguinaldo,diasAnoAguinaldo,factor,factorIntegracion,fechaRegistro,usuarioId")] Factore factore) { if (ModelState.IsValid) { Usuario usuario = Session["UsuarioData"] as Usuario; factore.usuarioId = usuario.Id; db.Entry(factore).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.usuarioId = new SelectList(db.Usuarios, "Id", "nombreUsuario", factore.usuarioId); return(View(factore)); }
// GET: Factores/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Factore factore = db.Factores.Find(id); if (factore == null) { return(HttpNotFound()); } return(View(factore)); }
// GET: Factores/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Factore factore = db.Factores.Find(id); if (factore == null) { return(HttpNotFound()); } ViewBag.usuarioId = new SelectList(db.Usuarios, "Id", "nombreUsuario", factore.usuarioId); return(View(factore)); }