Beispiel #1
0
        /// <summary>
        /// “选择历史手机号”按钮点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnHistory_Click(object sender, EventArgs e)
        {
            var frm = new FrmList(this.historyMobiles);

            if (frm.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            this.txtPhone.Text = frm.SelecteItem as string;
        }
Beispiel #2
0
        /// <summary>
        /// “选择充值手机号”按钮点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSelectMobile_Click(object sender, EventArgs e)
        {
            if (GlobalContext.HistoryRechargeMobile.Count < 1)
            {
                bool isThreadRunning = true;
                ThreadPool.QueueUserWorkItem(p =>
                {
                    try
                    {
                        var mobiles = GlobalContext.PH.GetHistoryOrderMobiles(GlobalContext.CurrentCookieString);
                        lock (GlobalContext.HistoryRechargeMobile)
                        {
                            GlobalContext.HistoryRechargeMobile.Clear();
                            GlobalContext.HistoryRechargeMobile.AddRange(mobiles);
                        }
                    }
                    catch (Exception ex)
                    {
                    }

                    isThreadRunning = false;
                });
                while (isThreadRunning)
                {
                    Application.DoEvents();
                }
            }

            if (GlobalContext.HistoryRechargeMobile.Count < 1)
            {
                MsgBox.ShowInfo("没有历史充值号码!");
                return;
            }

            var frm = new FrmList(GlobalContext.HistoryRechargeMobile);

            if (frm.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            this.txtInput.Text = frm.SelecteItem as string;
        }