public ActionResult DeleteConfirmed(int id) { OsmotrWork osmotrWork = db.OsmotrWorks.Find(id); db.OsmotrWorks.Remove(osmotrWork); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,IzmerenieId,Cost,DOMPartId")] OsmotrWork osmotrWork) { if (ModelState.IsValid) { db.Entry(osmotrWork).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DOMPartId = new SelectList(db.DOMParts, "Id", "Name", osmotrWork.DOMPartId); ViewBag.IzmerenieId = new SelectList(db.Izmerenies, "Id", "Name", osmotrWork.IzmerenieId); return(View(osmotrWork)); }
// GET: OsmotrWorks/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OsmotrWork osmotrWork = db.OsmotrWorks.Find(id); if (osmotrWork == null) { return(HttpNotFound()); } return(View(osmotrWork)); }
// GET: OsmotrWorks/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OsmotrWork osmotrWork = db.OsmotrWorks.Find(id); if (osmotrWork == null) { return(HttpNotFound()); } ViewBag.DOMPartId = new SelectList(db.DOMParts, "Id", "Name", osmotrWork.DOMPartId); ViewBag.IzmerenieId = new SelectList(db.Izmerenies, "Id", "Name", osmotrWork.IzmerenieId); return(View(osmotrWork)); }