public ActionResult DeleteConfirmed(int id) { OsmotrRecommendWork osmotrWork = db.OsmotrRecommendWorks.Find(id); db.OsmotrRecommendWorks.Remove(osmotrWork); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,IzmerenieId,Cost,DOMPartId,Smeta")] OsmotrRecommendWork 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)); }
public ActionResult Create([Bind(Include = "Id,Name,IzmerenieId,Cost,DOMPartId,Smeta")] OsmotrRecommendWork ORW) { if (ModelState.IsValid) { db.OsmotrRecommendWorks.Add(ORW); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DOMPartId = new SelectList(db.DOMParts, "Id", "Name", ORW.DOMPartId); ViewBag.IzmerenieId = new SelectList(db.Izmerenies, "Id", "Name", ORW.IzmerenieId); return(View(ORW)); }
// GET: OsmotrWorks/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OsmotrRecommendWork osmotrWork = db.OsmotrRecommendWorks.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)); } OsmotrRecommendWork osmotrWork = db.OsmotrRecommendWorks.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)); }