public ActionResult BuyTicket() { ktmTable ktmTab = new ktmTable(); ViewBag.Rate = ktmTab.rate; ViewBag.DictLane = ktmTab.dictLane; return(View()); }
public ActionResult BuyTicket(TicketDetails td) { if (ModelState.IsValid) { //return View("PurchaseDetails", td); return(RedirectToAction("PurchaseDetails", new { OriginLoc = td.Destination.OriginLoc, DestiLoc = td.Destination.DestiLoc, WayLoc = td.Destination.WayLoc, Citizen = td.Destination.Citizen, Quantity = td.Destination.Quantity })); } else { // there is a validation error ktmTable ktmTab = new ktmTable(); ViewBag.Rate = ktmTab.rate; ViewBag.DictLane = ktmTab.dictLane; return(View()); } }