public ActionResult DeleteConfirmed(int id) { AspNetDiscountType aspNetDiscountType = db.AspNetDiscountTypes.Find(id); db.AspNetDiscountTypes.Remove(aspNetDiscountType); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
public ActionResult Create([Bind(Include = "Id,TypeName")] AspNetDiscountType aspNetDiscountType) { if (ModelState.IsValid) { db.AspNetDiscountTypes.Add(aspNetDiscountType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aspNetDiscountType)); }
// 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)); }