コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            GuaranteeExtraItem guaranteeExtraItem = db.GuaranteeExtraItems.Find(id);

            db.GuaranteeExtraItems.Remove(guaranteeExtraItem);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "guaranteeExtraItemID,itemName")] GuaranteeExtraItem guaranteeExtraItem)
 {
     if (ModelState.IsValid)
     {
         db.Entry(guaranteeExtraItem).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(guaranteeExtraItem));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "guaranteeExtraItemID,itemName")] GuaranteeExtraItem guaranteeExtraItem)
        {
            if (ModelState.IsValid)
            {
                db.GuaranteeExtraItems.Add(guaranteeExtraItem);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(guaranteeExtraItem));
        }
コード例 #4
0
        // GET: GuaranteeExtraItem/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GuaranteeExtraItem guaranteeExtraItem = db.GuaranteeExtraItems.Find(id);

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