コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            AspNetDiscountType aspNetDiscountType = db.AspNetDiscountTypes.Find(id);

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

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

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