示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            MembershipPackages membershipPackages = db.membershipPackages.Find(id);

            db.membershipPackages.Remove(membershipPackages);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 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));
 }
示例#3
0
        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));
        }
示例#4
0
        // 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());
        }