コード例 #1
0
        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));
        }
コード例 #2
0
        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
            });
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
        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"));
        }
コード例 #6
0
ファイル: ProviderLibFIle.cs プロジェクト: pranidisai/zurides
 public int Confirmcabbooking(CabBookingModel Mode)
 {
     return(_Ser.Confirmcabbooking(Mode));
 }