예제 #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            DEInspectPrecautions inspectPrecautions = await db.DEInspectPrecautions.FindAsync(id);

            db.DEInspectPrecautions.Remove(inspectPrecautions);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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));
        }
예제 #4
0
        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));
        }