public PassengerPanel()
        {
            InitializeComponent();

            if (!Program.IsRunning)
            {
                return;
            }

            Load                      += PassengerPanel_Load;
            tsFilter.KeyUp            += tsFilter_KeyUp;
            tsDelete.Click            += tsDelete_Click;
            tsAdd.Click               += tsAdd_Click;
            tsEdit.Click              += tsEdit_Click;
            list.DoubleClick          += tsEdit_Click;
            tsImportToClipboard.Click += (s, e) => CopyToClipboard();
            tsImportToFile.Click      += (s, e) => ExportToFile();
            list.KeyUp                += list_KeyUp;
            tsImportDlg.Click         += (s, e) =>
            {
                GetControl <ImportPassenger>().ShowDialog();
                Session.LoadPassengers();
            };

            //图标
            imgList.Images.Add(UiUtility.Get24PxImageFrom16PxImg(Properties.Resources.user_16));
            imgList.Images.Add(UiUtility.Get24PxImageFrom16PxImg(Properties.Resources.male));
            imgList.Images.Add(UiUtility.Get24PxImageFrom16PxImg(Properties.Resources.female));

            //维护
            _inSystemMaintenance = ParamData.IsSystemMaintenance;
        }
Example #2
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);
        }
Example #3
0
 void ImportPassenger_Load(object sender, EventArgs ee)
 {
     btnFromCb.Click   += (s, e) => ImportFromClipboard();
     btnFromFile.Click += (s, e) => ImportFromFile();
     btnOk.Click       += (s, e) => BeginImport();
     imgList.Images.Add(UiUtility.Get24PxImageFrom16PxImg(Properties.Resources.user_16));
     imgList.Images.Add(UiUtility.Get24PxImageFrom16PxImg(Properties.Resources.ArrowNormal));
     imgList.Images.Add(UiUtility.Get24PxImageFrom16PxImg(Properties.Resources.tick_16));
     imgList.Images.Add(UiUtility.Get24PxImageFrom16PxImg(Properties.Resources.delete_16));
 }
Example #4
0
        public QmPanel()
        {
            InitializeComponent();

            this.Load += AdvancedToolPanel_Load;
            imgStatus.Images.Add("standby", UiUtility.Get24PxImageFrom16PxImg(Properties.Resources._148));
            imgStatus.Images.Add("query", UiUtility.Get24PxImageFrom16PxImg(Properties.Resources._146));
            imgStatus.Images.Add("wait", UiUtility.Get24PxImageFrom16PxImg(Properties.Resources.clock_16));

            IsControlVisibleChanged += QmPanel_IsControlVisibleChanged;
        }
        public BackupOrderContainer()
        {
            InitializeComponent();

            if (!Program.IsRunning)
            {
                return;
            }

            //图片资源
            //1 - 待付款
            imgList.Images.Add(ICON_NOT_PAY, UiUtility.Get24PxImageFrom16PxImg(Properties.Resources.asset));
            //2- 待兑现
            imgList.Images.Add(ICON_WAIT, UiUtility.Get24PxImageFrom16PxImg(Properties.Resources.clock_16));
            //兑现成功
            imgList.Images.Add(ICON_SUCCEED, UiUtility.Get24PxImageFrom16PxImg(Properties.Resources.cou_16_accept));
            //兑现失败
            imgList.Images.Add(ICON_FAILED, UiUtility.Get24PxImageFrom16PxImg(Properties.Resources.cou_16_delete));

            this.Load += BackupOrderContainer_Load;
        }
Example #6
0
        public OrderNotification(Session session, QueryParam query, QueryResultItem train, IEnumerable <PassengerInTicket> passengers, string error, string orderid)
        {
            _query      = query;
            _train      = train;
            _passengers = passengers;
            _error      = error;
            _orderid    = orderid;
            InitializeComponent();

            InitSession(session);
            Icon = Properties.Resources.icon_warning;
            imglist.Images.Add(UiUtility.Get24PxImageFrom16PxImg(Properties.Resources.user_16));

            lblTrainCode.Text = train.Code;
            lblDate.Text      = train.FromStation.DepartureTime.Value.ToString("M月d日");
            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'分'"));

            if (passengers != null)
            {
                lstPas.Items.AddRange(passengers.Select(s => new ListViewItem(new[]
                {
                    ParamData.GetTicketType(s.TicketType).DisplayName,
                    ParamData.SeatTypeFull[s.SeatType],
                    s.Name,
                    ParamData.PassengerIdType[s.IdType],
                    s.IdNo
                })
                {
                    ImageIndex = 0
                }).ToArray());
            }

            if (string.IsNullOrEmpty(error))
            {
                Gif.SetSuccessImage(pbAnimate);
                lblError.ForeColor = Color.RoyalBlue;
                lblError.Text      = "订票成功!订单号为:" + orderid.DefaultForEmpty("<未知>") + ",请尽快付款!如果订单没有立刻查询到,请刷新订单列表!";

                btnOK.Click += btnOK_Click;
                btnOK.Text   = "乖~~戳我去付款啦~~要截图留念请速度并打码哦 ლ(^o^ლ) ";

                Operation.Instance.PlayMusicForSuccess();
            }
            else
            {
                lblError.Text = error;
                btnOK.Text    = "同学不哭,站起来擦干眼泪继续刷 ლ(╹◡╹ლ)";
                Gif.SetFailedImage(pbAnimate);
                btnOK.Click += (s, e) => Close();

                if (error.IndexOf("未完成") != -1)
                {
                    session.OnRequestShowPanel(PanelIndex.Orders);
                    session.OnOrderChanged();
                }
            }

            if (ProgramConfiguration.Instance.OrderDlgCenterMainform)
            {
                UiUtility.PlaceFormAtCenter(this, show: false);
            }
            else
            {
                StartPosition = FormStartPosition.CenterScreen;
            }
            FormPlacementManager.Instance.Control(this);

            Load += async(s, e) =>
            {
                WindowState = FormWindowState.Normal;
                BringToFront();
                Activate();

                if (_error.IsNullOrEmpty())
                {
                    await CheckNotification().ConfigureAwait(true);
                    await SendWebNotification().ConfigureAwait(true);
                }
            };
        }