public ActionResult DeleteConfirmed(int id) { MembershipPackages membershipPackages = db.membershipPackages.Find(id); db.membershipPackages.Remove(membershipPackages); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "packageId,name,description,price")] MembershipPackages membershipPackages) { if (ModelState.IsValid) { db.Entry(membershipPackages).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(membershipPackages)); }
public ActionResult Create([Bind(Include = "packageId,name,description,price")] MembershipPackages membershipPackages) { if (ModelState.IsValid) { db.membershipPackages.Add(membershipPackages); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(membershipPackages)); }
// GET: MembershipPackages/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MembershipPackages membershipPackages = db.membershipPackages.Find(id); if (membershipPackages == null) { return(HttpNotFound()); } return(View(membershipPackages)); }
public ActionResult Payment(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Enrollment enrolment = db.Enrollments.Find(id); int month = enrolment.numberofmonths; MembershipPackages membershipPackage = db.membershipPackages.Find(enrolment.packageId); int price = membershipPackage.price; int totalamount = month * price; ViewBag.enrolementId = id; ViewBag.amount = totalamount; ViewBag.customerId = enrolment.customerId; return(View()); }