Ejemplo n.º 1
0
        //获取坐席信息
        private void GetSeat()
        {
            submitAction.BeginGetSeat((str) =>
            {
                if (str == "获取信息失败" || str == string.Empty)
                {
                    MessageBox.Show("信息获取失败,请重试", "获取坐席信息", MessageBoxButtons.OK, MessageBoxIcon.Information); return;
                }
                if (str != "" && str.IndexOf("没有足够的票") > -1)
                {
                    DetermineCall(() =>
                    {
                        StopSubmit("订票失败,这事不赖我~~因为已经没有足够的票了");
                    });
                    return;
                }

                string result    = str;
                string waitCount = "";

                if (Regex.Match(result, "(?<=\"waitCount\":)[\\-]?\\d{1,}(?=,\")").ToString() == "0")
                {
                    DetermineCall(() =>
                    {
                        _orderNo = Regex.Match(result, "(?<=\"orderId\":\")[A-Z]\\d{9}(?=\",\")").ToString();
                        if (_orderNo != "" && flag == 0)
                        {
                            flag++;
                            timer2.Enabled = false;
                            lblState1.Text = "订票成功~~!订单号为:" + _orderNo;
                            string path    = System.IO.Directory.GetCurrentDirectory() + "\\Sound_Sucessed.wav";
                            if (System.IO.File.Exists(path))
                            {
                                sp = new System.Media.SoundPlayer(path);
                                sp.Play();
                            }
                            if (MessageBox.Show("订票成功,赶紧到网站上支付吧~~", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information) == DialogResult.OK)
                            {
                                if (chkOpenIE.Checked)
                                {
                                    OpenIE_API.OpenIE(_cookieContainer);
                                }
                                this.Close();
                            }
                        }
                    });
                }
                else
                {
                    DetermineCall(() =>
                    {
                        waitCount      = Regex.Match(result, "(?<=\"waitCount\":)[\\-]?\\d{1,}(?=,\")").ToString();
                        lblState1.Text = "据说前面还有 " + waitCount + " 个人,估计还需要等上 " + Regex.Match(result, "(?<=\"waitTime\":)[\\-]?\\d{1,}(?=,\")").ToString() + " 秒";
                        Application.DoEvents();
                    });
                }
            }, _cookieContainer);
        }
Ejemplo n.º 2
0
 private void picSupport_Click(object sender, EventArgs e)
 {
     OpenIE_API.OpenUrl("https://me.alipay.com/stupidscat");
 }
Ejemplo n.º 3
0
 private void tsbtnHome_Click(object sender, EventArgs e)
 {
     OpenIE_API.OpenUrl(Properties.Resources.AuthorHomePage);
 }
Ejemplo n.º 4
0
 private void tsbtnAdvice_Click(object sender, EventArgs e)
 {
     OpenIE_API.OpenUrl(Properties.Resources.Advice);
 }
Ejemplo n.º 5
0
 private void tsbtnDeveloper_Click(object sender, EventArgs e)
 {
     OpenIE_API.OpenUrl(Properties.Resources.Developer);
 }
Ejemplo n.º 6
0
 private void tsbtnBug_Click(object sender, EventArgs e)
 {
     OpenIE_API.OpenUrl(Properties.Resources.Bug);
 }
Ejemplo n.º 7
0
 private void tsbtnDiscus_Click(object sender, EventArgs e)
 {
     OpenIE_API.OpenUrl(Properties.Resources.Common);
 }
Ejemplo n.º 8
0
 private void lnkMyPage_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     OpenIE_API.OpenUrl(Properties.Resources.AuthorHomePage);
 }
Ejemplo n.º 9
0
 private void btnGoIE_Click(object sender, EventArgs e)
 {
     OpenIE_API.OpenIE(_cookieContainer);
 }
Ejemplo n.º 10
0
        //获取坐席信息
        private void GetSeat()
        {
            submitAction.QueryString = getPostData.GetQueryOrderWaitTimeQueryString(_tokenAndLeftTicket);
            submitAction.BeginGetSeat((str) =>
            {
                var returnString = translation.TranslationHtmlEx(str);
                if (returnString["messages"].Any())
                {
                    //GetRandCodeImg();
                    DeterMineCall(() =>
                    {
                        lblState1.Text = returnString["messages"][0].ToString();
                        Application.DoEvents();
                        txtRandCode1.Text = "";
                        btnSubmit.Enabled = true;
                        txtRandCode1.Focus();

                        StopSubmit();
                        GetToken();
                    });
                    return;
                }

                if (returnString["data"]["msg"] != null && returnString["data"]["msg"].ToString() != "")
                {
                    //GetRandCodeImg();
                    DeterMineCall(() =>
                    {
                        MessageBox.Show(returnString["data"]["msg"].ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        txtRandCode1.Text = "";
                        btnSubmit.Enabled = true;
                        txtRandCode1.Focus();

                        StopSubmit();
                        GetToken();
                    });
                    return;
                }

                string waitCount = "";
                if (returnString["data"]["orderId"] != null && returnString["data"]["orderId"].ToString() != "")
                {
                    DetermineCall(() =>
                    {
                        _orderNo = returnString["data"]["orderId"].ToString();
                        if (_orderNo != "" && flag == 0)
                        {
                            flag++;
                            timer2.Enabled = false;
                            lblState1.Text = "订票成功~~!订单号为:" + _orderNo;
                            string path    = System.IO.Directory.GetCurrentDirectory() + "\\Sound_Sucessed.wav";
                            if (System.IO.File.Exists(path))
                            {
                                sp = new System.Media.SoundPlayer(path);
                                sp.Play();
                            }
                            if (MessageBox.Show("订票成功,赶紧到网站上支付吧~~", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information) == DialogResult.OK)
                            {
                                if (chkOpenIE.Checked)
                                {
                                    OpenIE_API.OpenIE(_cookieContainer);
                                }
                                this.Close();
                            }
                        }
                    });
                }
                else
                {
                    DetermineCall(() =>
                    {
                        //waitCount = Regex.Match(result, "(?<=\"waitCount\":)[\\-]?\\d{1,}(?=,\")").ToString();
                        waitCount      = returnString["data"]["waitCount"].ToString();
                        lblState1.Text = "据说前面还有 " + waitCount + " 个人,估计还需要等上 " + returnString["data"]["waitTime"] as string + " 秒"; // Regex.Match(result, "(?<=\"waitTime\":)[\\-]?\\d{1,}(?=,\")").ToString() + " 秒";
                        Application.DoEvents();
                        timer2.Interval = 1000;                                                                                      //Convert.ToInt32(_submitSpan)
                        timer2.Start();
                    });
                }
            }, _cookieContainer);
        }