public ActionResult Create([Bind(Include = "TransactionID,JourneyID,CardType,CardNumber,CVV,ExpiryDate,PaymentDate,PaymentType,CustomerID,ScheduleID")] tblPayment_HMS03_Team7 tblPayment_HMS03_Team7)
        {
            if (ModelState.IsValid)
            {
                //if (DateTime.Parse(tblPayment_HMS03_Team7.PaymentDate.ToString()).Subtract(DateTime.Now).TotalDays < 0)
                if (tblPayment_HMS03_Team7.ExpiryDate < DateTime.Now)
                {
                    MessageBox.Show("Expire Date should be in FUTURE");
                    return(RedirectToAction("Create"));
                }
                tblPayment_HMS03_Team7.JourneyID   = int.Parse(Session["JourneyID"].ToString());
                tblPayment_HMS03_Team7.CustomerID  = int.Parse(Session["cid"].ToString());//int.Parse(Session["custid"].ToString());
                tblPayment_HMS03_Team7.PaymentDate = DateTime.Now;
                tblPayment_HMS03_Team7.PaymentType = "Successful";
                //
                tblJourney_HMS03_Team7 tj = db.tblJourney_HMS03_Team7.Find(int.Parse(Session["JourneyID"].ToString()));
                tj.PaymentStatus = "Successful";
                //
                db.tblPayment_HMS03_Team7.Add(tblPayment_HMS03_Team7);
                db.SaveChanges();
                Session["TransactionID"] = tblPayment_HMS03_Team7.TransactionID;
                return(RedirectToAction("changeseat", "tblSchedule_HMS03_Team7"));
            }

            ViewBag.CustomerID = new SelectList(db.tblCustomer_HMS03_Team7, "CustomerID", "Title", tblPayment_HMS03_Team7.CustomerID);
            ViewBag.JourneyID  = new SelectList(db.tblJourney_HMS03_Team7, "JourneyID", "PaymentStatus", tblPayment_HMS03_Team7.JourneyID);
            ViewBag.ScheduleID = new SelectList(db.tblSchedule_HMS03_Team7, "ScheduleID", "Source", tblPayment_HMS03_Team7.ScheduleID);
            return(View(tblPayment_HMS03_Team7));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            tblPayment_HMS03_Team7 tblPayment_HMS03_Team7 = db.tblPayment_HMS03_Team7.Find(id);

            db.tblPayment_HMS03_Team7.Remove(tblPayment_HMS03_Team7);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "TransactionID,JourneyID,CardType,CardNumber,CVV,ExpiryDate,PaymentDate,PaymentType,CustomerID,ScheduleID")] tblPayment_HMS03_Team7 tblPayment_HMS03_Team7)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tblPayment_HMS03_Team7).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Viewpassenger"));
     }
     ViewBag.CustomerID = new SelectList(db.tblCustomer_HMS03_Team7, "CustomerID", "Title", tblPayment_HMS03_Team7.CustomerID);
     ViewBag.JourneyID  = new SelectList(db.tblJourney_HMS03_Team7, "JourneyID", "PaymentStatus", tblPayment_HMS03_Team7.JourneyID);
     ViewBag.ScheduleID = new SelectList(db.tblSchedule_HMS03_Team7, "ScheduleID", "Source", tblPayment_HMS03_Team7.ScheduleID);
     return(RedirectToAction("Index"));
 }
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblPayment_HMS03_Team7 tblPayment_HMS03_Team7 = db.tblPayment_HMS03_Team7.Find(id);

            if (tblPayment_HMS03_Team7 == null)
            {
                return(HttpNotFound());
            }
            return(View(tblPayment_HMS03_Team7));
        }
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblPayment_HMS03_Team7 tblPayment_HMS03_Team7 = db.tblPayment_HMS03_Team7.Find(id);

            if (tblPayment_HMS03_Team7 == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CustomerID = new SelectList(db.tblCustomer_HMS03_Team7, "CustomerID", "Title", tblPayment_HMS03_Team7.CustomerID);
            ViewBag.JourneyID  = new SelectList(db.tblJourney_HMS03_Team7, "JourneyID", "PaymentStatus", tblPayment_HMS03_Team7.JourneyID);
            ViewBag.ScheduleID = new SelectList(db.tblSchedule_HMS03_Team7, "ScheduleID", "Source", tblPayment_HMS03_Team7.ScheduleID);
            return(View(tblPayment_HMS03_Team7));
        }