public ActionResult DeleteConfirmed(int id) { FeeDiscount feeDiscount = db.FeeDiscounts.Find(id); db.FeeDiscounts.Remove(feeDiscount); db.SaveChanges(); return(RedirectToAction("FeeDiscountIndex")); }
public ActionResult Create([Bind(Include = "Id,Name,Amount")] FeeDiscount feeDiscount) { if (ModelState.IsValid) { db.FeeDiscounts.Add(feeDiscount); db.SaveChanges(); return(RedirectToAction("FeeDiscountIndex")); } return(View(feeDiscount)); }
public ActionResult Edit([Bind(Include = "Id,Name,Amount")] FeeDiscount feeDiscount) { if (ModelState.IsValid) { db.Entry(feeDiscount).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("FeeDiscountIndex")); } return(View(feeDiscount)); }
// GET: FeeDiscounts/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } FeeDiscount feeDiscount = db.FeeDiscounts.Find(id); if (feeDiscount == null) { return(HttpNotFound()); } return(View(feeDiscount)); }
public ActionResult GetDiscounts() { var discountlist = db.FeeDiscounts.ToList(); List <FeeDiscount> duratintype = new List <FeeDiscount>(); foreach (var item in discountlist) { FeeDiscount dt = new FeeDiscount(); dt.Id = item.Id; dt.Name = item.Name; dt.Amount = item.Amount; duratintype.Add(dt); } return(Json(duratintype, JsonRequestBehavior.AllowGet)); }