private void btnSubmit_Click(object sender, EventArgs e) { //queueFlag = 0; if (_tokenAndLeftTicket["Token"].ToString() == "") { MessageBox.Show("获取Token失败,该票已停售或已卖完.", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); //new MessageBoxEx("获取Token失败,该票已停售或已卖完!", MessageboxExIcon.ERROR) { NewPrivateInterval = 1000 }.Show(); return; } int itemCount = dgvPassenger.Rows.Count; if (itemCount <= 0) { lblState1.Text = "请选择联系人!"; } else { if (txtRandCode1.Text.Length != 4) { lblState1.Text = "请输入正确的验证码!"; return; } btnSubmit.Enabled = false; var passengers = new List <Nomal_Passengers>(); for (int i = 0; i < dgvPassenger.Rows.Count; i++) { var pas = ((Nomal_Passengers)(dgvPassenger.Rows[i].Cells["xingming"].Tag)); pas.SeatCode = DatasList.SeatType[dgvPassenger.Rows[i].Cells[1].Value].ToString(); pas.TicketCode = DatasList.TicketType[dgvPassenger.Rows[i].Cells[2].Value].ToString(); pas.IsCheck = true; passengers.Add(pas); } orderData = new OrderData_Otn(_trainData, passengers); orderData.RandCode = txtRandCode1.Text; orderData.REPEAT_SUBMIT_TOKEN = _tokenAndLeftTicket["Token"].ToString(); getPostData.OData = orderData; DetermineCall(() => { lblState1.Text = "开始确认订单..."; Application.DoEvents(); }); ConfirmOrder(); } }
public formAutoSubmitOrder(OrderData_Otn order, string user, string postData, QueryLeftNewDTO trainInfo, List <Nomal_Passengers> passengers, string trainDate, CookieContainer cookie, string title, string defaultseat = "", bool fl = false) { InitializeComponent(); orderData = order; _user = user; this.Text += " " + title; this._postData = postData; this._trainData = trainInfo; this._cookieContainer = cookie; this._passengers = passengers; this._trainDate = trainDate; this._defaultSeat = defaultseat; string path = System.IO.Directory.GetCurrentDirectory() + "\\Sound_GetTicket.wav"; if (System.IO.File.Exists(path)) { sp = new System.Media.SoundPlayer(path); sp.Play(); } }