public ActionResult DeleteConfirmed(int id) { BrigadeMembers brigadeMembers = db.BrigadeMembers.Find(id); db.BrigadeMembers.Remove(brigadeMembers); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "BrigadeMembersId,BrigadeId,WorkerId")] BrigadeMembers brigadeMembers) { if (ModelState.IsValid) { db.Entry(brigadeMembers).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.BrigadeId = new SelectList(db.Brigades, "BrigadeId", "BrigadeName", brigadeMembers.BrigadeId); ViewBag.WorkerId = new SelectList(db.Workers, "WorkerId", "WorkerName", brigadeMembers.WorkerId); return(View(brigadeMembers)); }
// GET: BrigadeMembers/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BrigadeMembers brigadeMembers = db.BrigadeMembers.Find(id); if (brigadeMembers == null) { return(HttpNotFound()); } return(View(brigadeMembers)); }
// GET: BrigadeMembers/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BrigadeMembers brigadeMembers = db.BrigadeMembers.Find(id); if (brigadeMembers == null) { return(HttpNotFound()); } ViewBag.BrigadeId = new SelectList(db.Brigades, "BrigadeId", "BrigadeName", brigadeMembers.BrigadeId); ViewBag.WorkerId = new SelectList(db.Workers, "WorkerId", "WorkerName", brigadeMembers.WorkerId); return(View(brigadeMembers)); }