Exemplo n.º 1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            InspectionStates inspectionStates = await db.InspectionStates.FindAsync(id);

            db.InspectionStates.Remove(inspectionStates);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        public async Task <ActionResult> Edit([Bind(Include = "IdStatus,Description")] InspectionStates inspectionStates)
        {
            if (ModelState.IsValid)
            {
                db.Entry(inspectionStates).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(inspectionStates));
        }
Exemplo n.º 3
0
        public async Task <ActionResult> Create([Bind(Include = "IdStatus,Description")] InspectionStates inspectionStates)
        {
            if (ModelState.IsValid)
            {
                db.InspectionStates.Add(inspectionStates);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(inspectionStates));
        }
Exemplo n.º 4
0
        // GET: InspectionStates/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            InspectionStates inspectionStates = await db.InspectionStates.FindAsync(id);

            if (inspectionStates == null)
            {
                return(HttpNotFound());
            }
            return(View(inspectionStates));
        }