public JsonResult Verify(CabBookingModel Model, UserVM VM, long cabid, int Qtyseat, long Tax, long GST, long NetPay, long Basicfair) { string result = "Fail"; if (VM.CabBooking.TypeOfJourney != null && VM.CabBooking.Boardingpoint != null && VM.CabBooking.DropPoint != null) { result = "Success"; } return(Json(result, JsonRequestBehavior.AllowGet)); }
public void StartCabScheduler(CabBookingModel scheduledJob) { var cabTimer = new Timer(); var tickTime = (scheduledJob.BookingTimeScheduled - DateTime.Now).TotalMilliseconds; cabTimer.Elapsed += (sender, e) => OnTimedEvent(sender, e, scheduledJob); cabTimer.Interval = tickTime; cabTimer.Enabled = true; allTimers.Add(new TrackTimerModel { CabBookingModel = scheduledJob, ScheduledTimer = cabTimer }); }
public void CancelCabScheduler(CabBookingModel scheduledJob) { if (!allTimers.Any()) { return; } var cancelTimer = allTimers.FirstOrDefault(e => e.CabBookingModel.CabId == scheduledJob.CabId); if (cancelTimer == null) { return; } cancelTimer.ScheduledTimer.Stop(); Console.WriteLine("*******************************************"); Console.WriteLine("\n{0} - {1} !!! - Cancelled Cab, Scheduled for {2}\n", scheduledJob.CabId, scheduledJob.CabName, scheduledJob.BookingTimeScheduled); }
private void OnTimedEvent(object sender, ElapsedEventArgs e, CabBookingModel scheduledJob) { var source = (Timer)sender; if (source == null) { return; } Console.WriteLine("\n{0} - {1} !!! - Arriving Scheduled Cab At {2}\n", scheduledJob.CabId, scheduledJob.CabName, scheduledJob.BookingTimeScheduled); Console.WriteLine("{0} - {1} - has Cab Arrived", scheduledJob.CabId, scheduledJob.CabName); source.Stop(); source.Dispose(); if (allTimers.Any()) { var removeTimer = allTimers.FirstOrDefault(f => f.CabBookingModel.CabId == scheduledJob.CabId); allTimers.Remove(removeTimer); } }
public ActionResult ConfirmBooking(CabBookingModel Model, UserVM VM, long cabid, int Qtyseat, long Tax, long GST, long NetPay, long Basicfair, string Jdate, string boarding, string droppoint) { VM.CabBooking.vehicleid = cabid; VM.CabBooking.SelectedSeats = Qtyseat; VM.CabBooking.NetPay = Convert.ToDouble(NetPay); VM.CabBooking.Tax = Tax; VM.CabBooking.GST = GST; VM.CabBooking.Jdate = Jdate; Session["bookingconformation"] = VM.CabBooking; VM.CabBooking = new CabBookingModel(); VM.CabBooking = (CabBookingModel)Session["bookingconformation"]; var source = _pro.GetBoardingpointsbyCity(VM.CabBooking.Source); VM.SourceBoardingPoints = source.ToDictionary(a => a.BoardingPoint, a => a.BoardingPoint); var destination = _pro.GetBoardingpointsbyCity(VM.CabBooking.Destination); VM.DestinationBoardingPoints = destination.ToDictionary(a => a.BoardingPoint, a => a.BoardingPoint); return(RedirectToAction("Index", "Book")); }
public int Confirmcabbooking(CabBookingModel Mode) { return(_Ser.Confirmcabbooking(Mode)); }