public ActionResult DeleteConfirmed(int id) { WORKERS wORKERS = db.WORKERS.Find(id); db.WORKERS.Remove(wORKERS); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "wok_code,wok_name,rol_code")] WORKERS wORKERS) { if (ModelState.IsValid) { db.Entry(wORKERS).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.rol_code = new SelectList(db.ROLES, "rol_code", "rol_name", wORKERS.rol_code); return(View(wORKERS)); }
public ActionResult Create([Bind(Include = "wok_code,wok_name,rol_code")] WORKERS wORKERS) { if (ModelState.IsValid) { db.WORKERS.Add(wORKERS); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.rol_code = new SelectList(db.ROLES, "rol_code", "rol_name", wORKERS.rol_code); return(View(wORKERS)); }
// GET: WORKERS/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } WORKERS wORKERS = db.WORKERS.Find(id); if (wORKERS == null) { return(HttpNotFound()); } return(View(wORKERS)); }
// GET: WORKERS/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } WORKERS wORKERS = db.WORKERS.Find(id); if (wORKERS == null) { return(HttpNotFound()); } ViewBag.rol_code = new SelectList(db.ROLES, "rol_code", "rol_name", wORKERS.rol_code); return(View(wORKERS)); }