public ActionResult DeleteConfirmed(int TechId, int TechInfoWorkId) { TechInfoWork techInfoWork = db.TechInfoWorks.Find(TechInfoWorkId); db.TechInfoWorks.Remove(techInfoWork); db.SaveChanges(); return(RedirectToAction("Index", "TechInfoWorks", new { id = TechId })); }
// GET: TechInfoWorks/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TechInfoWork techInfoWork = db.TechInfoWorks.Find(id); if (techInfoWork == null) { return(HttpNotFound()); } return(View(techInfoWork)); }
public ActionResult Create([Bind(Include = "TechInfoWorkId,TypeOfService,ManufacturerName,PlatformName,Notes,FarmId,ScopeWorkId,TechId")] TechInfoWork techInfoWork) { if (ModelState.IsValid) { db.TechInfoWorks.Add(techInfoWork); db.SaveChanges(); return(RedirectToAction("Index", "TechInfoWorks", new { id = techInfoWork.TechId })); } ViewBag.FarmId = new SelectList(db.Farms, "FarmId", "FarmName", techInfoWork.FarmId); ViewBag.ScopeWorkId = new SelectList(db.ScopeWorks, "ScopeWorkId", "Work", techInfoWork.ScopeWorkId); ViewBag.TechId = techInfoWork.TechId; ViewBag.ManufacturerName = new SelectList(db.Manufacteres, "ManufacturerName", "ManufacturerName"); return(View(techInfoWork)); }
public ActionResult Edit([Bind(Include = "TechInfoWorkId,TypeOfService,ManufacturerName,PlatformName,Notes,FarmId,ScopeWorkId,TechId")] TechInfoWork techInfoWork) { if (ModelState.IsValid) { db.Entry(techInfoWork).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", "TechInfoWorks", new { id = techInfoWork.TechId })); } ViewBag.FarmId = new SelectList(db.Farms, "FarmId", "FarmName", techInfoWork.FarmId); ViewBag.ScopeWorkId = new SelectList(db.ScopeWorks, "ScopeWorkId", "Work", techInfoWork.ScopeWorkId); ViewBag.TechId = techInfoWork.TechId; ViewBag.ManufacturerName = new SelectList(db.Manufacteres, "ManufacturerName", "ManufacturerName", techInfoWork.ManufacturerName); var objPlatform = db.Platforms.Where(c => c.ManufacturerName == techInfoWork.ManufacturerName); ViewBag.PlatformName = new SelectList(objPlatform, "PlatformName", "PlatformName", techInfoWork.PlatformName); return(View(techInfoWork)); }
// GET: TechInfoWorks/Edit/5 public ActionResult Edit(int?id, int idtech) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TechInfoWork techInfoWork = db.TechInfoWorks.Find(id); if (techInfoWork == null) { return(HttpNotFound()); } ViewBag.FarmId = new SelectList(db.Farms, "FarmId", "FarmName", techInfoWork.FarmId); ViewBag.ScopeWorkId = new SelectList(db.ScopeWorks, "ScopeWorkId", "Work", techInfoWork.ScopeWorkId); ViewBag.TechId = idtech; ViewBag.ManufacturerName = new SelectList(db.Manufacteres, "ManufacturerName", "ManufacturerName", techInfoWork.ManufacturerName); var objPlatform = db.Platforms.Where(c => c.ManufacturerName == techInfoWork.ManufacturerName); ViewBag.PlatformName = new SelectList(objPlatform, "PlatformName", "PlatformName", techInfoWork.PlatformName); return(View(techInfoWork)); }