/// <summary> /// 启动,在计时器里定时调用 /// </summary> private void start() { m_running = true; string pnr = fc.PnrUnchecked(m_li.b2b.username).Trim(); if (pnr != "") { EagleFileIO.LogWrite("PNR=" + pnr); if (BaseFunc.PnrValidate(pnr)) { m_pool.Clear(); string cmd = m_pool.HandleCommand("rt:n/" + pnr + "/eg"); m_socket.SendCommandBack(cmd, EagleProtocal.TypeOfCommand.AutoPnBack); } else { bool flag = false; fc.SubmitEticketInfomation("INVALID PNR", "", ' ', "", DateTime.Now, "", ' ', "", DateTime.Now, 0, 1, "", "", 0, 0, 0, ref flag); } } else if (ls_pnr.Count > 0) { pnr = ls_pnr[0]; EagleFileIO.LogWrite("PNR=" + pnr); ls_pnr.RemoveAt(0); m_pool.Clear(); string cmd = m_pool.HandleCommand("rt:n/" + pnr + "/eg"); m_socket.SendCommandBack(cmd, EagleProtocal.TypeOfCommand.AutoPnBack); } else { EagleFileIO.LogWrite("There are no eticket infomation to upload!"); m_running = false; } }
private void SendSS() { txtPnr.Text = ""; ListView lv = lvPanel.lvSelected2; if (lv.Items.Count == 0) { throw new Exception("未选航段"); } List <string> lsFlight = new List <string>(); List <char> lsBunk = new List <char>(); List <DateTime> lsDate = new List <DateTime>(); List <string> lsCitypair = new List <string>(); for (int i = 0; i < lv.Items.Count; i++) { ListViewItem lvi = lv.Items[i]; lsDate.Add(DateTime.Parse(lvi.Text)); lsFlight.Add(lvi.SubItems[1].Text); lsBunk.Add(lvi.SubItems[2].Text[0]); lsCitypair.Add(lvi.SubItems[3].Text); } int ppcount = lvPassenger.Items.Count; if (lvPassenger.Items.Count == 0) { throw new Exception("未添加乘客"); } List <string> lsName = new List <string>(); List <string> lsCard = new List <string>(); List <string> lsPhone = new List <string>(); for (int i = 0; i < lvPassenger.Items.Count; i++) { ListViewItem lvi = lvPassenger.Items[i]; lsName.Add(lvi.Text); lsCard.Add(lvi.SubItems[1].Text); lsPhone.Add(lvi.SubItems[2].Text); } string phone = this.txtPhone.Text; phone = EagleString.egString.Full2Half(phone); {//save phone System.Collections.Hashtable ht = new System.Collections.Hashtable(); ht.Add("PNRORDERSUBMITPHONE", phone); EagleString.EagleFileIO.WiteHashTableToEagleDotTxt(ht); } string office = m_li.b2b.lr.UsingOffice(); string ss = EagleString.CommandCreate.Create_SS_String( lsFlight.ToArray(), lsBunk.ToArray(), lsDate.ToArray(), lsCitypair.ToArray(), ppcount, lsName.ToArray(), lsCard.ToArray(), phone, office, null ); m_pool.HandleCommand(ss); m_socket.SendCommand(ss, EagleProtocal.TypeOfCommand.Multi); }