Ejemplo n.º 1
0
        public OrderQueue(Session session, OrderCacheItem queueInfo)
        {
            _queueInfo = queueInfo;
            InitializeComponent();
            imglist.Images.Add(UiUtility.Get24PxImageFrom16PxImg(Properties.Resources.user_16));
            Gif.SetLoadingImage(pbAnimate);

            Icon = Properties.Resources.icon_warning;
            InitSession(session);

            LoadInfo();

            _worker = new QueueOrderWorker(session)
            {
                TourFlag = _queueInfo.tourFlag
            };
            _worker.QueueMessageChanged    += _worker_QueueMessageChanged;
            _worker.QueryOrderQueueFailed  += _worker_QueryOrderQueueFailed;
            _worker.QueryOrderQueueSuccess += _worker_QueryOrderQueueSuccess;

            Load += (s, e) =>
            {
                btnClose.Enabled = false;
                _worker.RunQueryOrderQueue();
            };
            FormClosing += (s, e) =>
            {
                e.Cancel = _worker != null;
            };
            btnClose.DialogResult = DialogResult.Cancel;
            btnCancelQueue.Click += BtnCancelQueue_Click;
            FormPlacementManager.Instance.Control(this);
        }
Ejemplo n.º 2
0
        protected override Task OnOrderContextInitializeAsync()
        {
            Gif.SetLoadingImage(pbAnimate);
            ts.ApplyColorSchema(RowStyleType.Green);
            ts.Text = "正在初始化上下文...";

            return(base.OnOrderContextInitializeAsync());
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 订单排队成功
        /// </summary>
        /// <returns></returns>
        protected override async Task SubmitOrderSuccessAsync(bool async, string orderid)
        {
            Gif.SetLoadingImage(pbAnimate);
            //vc.EnableAutoVc = false;
            if (async)
            {
                ts.Text = "订单提交成功,正在排队中...";
            }

            await base.SubmitOrderSuccessAsync(async, orderid).ConfigureAwait(true);
        }
Ejemplo n.º 4
0
 protected virtual void InitTrainInfoDisplay()
 {
     Gif.SetLoadingImage(pbAnimate);
     lblTrainCode.Text = Train.Code;
     lblDate.Text      = Train.FromStation.DepartureTime.Value.ToString("MM-dd");
     lblFrom.Text      = Train.FromStation.StationName;
     lblTo.Text        = Train.ToStation.StationName;
     lblTimeInfo.Text  = lblTimeInfo.Text.FormatWith(
         Train.FromStation.DepartureTime.Value.ToString("HH:mm"),
         Train.ToStation.ArriveTime.Value.ToString("HH:mm"),
         Train.ElapsedTime.ToString("dd'天'hh'时'mm'分'"));
 }