public async Task <ActionResult> DeleteConfirmed(int id) { DEInspectPrecautions inspectPrecautions = await db.DEInspectPrecautions.FindAsync(id); db.DEInspectPrecautions.Remove(inspectPrecautions); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "PrecautionId,AreaId,Content")] DEInspectPrecautions inspectPrecautions) { if (ModelState.IsValid) { db.Entry(inspectPrecautions).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.AreaId = new SelectList(db.DEInspectArea, "AreaId", "AreaName", inspectPrecautions.AreaId); return(View(inspectPrecautions)); }
public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DEInspectPrecautions inspectPrecautions = await db.DEInspectPrecautions.FindAsync(id); if (inspectPrecautions == null) { return(HttpNotFound()); } return(View(inspectPrecautions)); }
public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DEInspectPrecautions inspectPrecautions = await db.DEInspectPrecautions.FindAsync(id); if (inspectPrecautions == null) { return(HttpNotFound()); } ViewBag.AreaId = new SelectList(db.DEInspectArea, "AreaId", "AreaName", inspectPrecautions.AreaId); return(View(inspectPrecautions)); }