/// <summary> /// txtReceiptNo.Text,txtEticketNo.Text,txtName,txtCard:打印按钮,实际先发送3in1打印指令(过行程单),收到结果后才能打印 /// </summary> private void btnPrintOnline_Click(object sender, EventArgs e) { long lon; string receiptno = txtReceiptNo.Text.Trim(); string tktno = ""; EagleString.BaseFunc.TicketNumberValidate(txtEticketNo.Text, ref tktno); if (long.TryParse(receiptno, out lon) && receiptno.Length == 10) { DialogResult dd = MessageBox.Show("确定要打印行程单吗?", "易格科技", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); if (dd == DialogResult.Cancel) { return; } txtValidate.Text = receiptno.Substring(6); Application.DoEvents(); EagleString.EagleFileIO.LogWrite(string.Format("尝试打印行程单:({0})({1})", receiptno, tktno)); m_socket.SendReceiptPrint(tktno, receiptno); m_cmdpool.SetType(EagleString.ETERM_COMMAND_TYPE.RECEIPT_PRINT); } else { MessageBox.Show("行程单号输入不正确!"); } }
private void btQueneState_Click(object sender, EventArgs e) { tbQuene.Text = ""; b_qtCmd = true; string cmd = "qt"; m_pool.HandleCommand(cmd); m_pool.SetType(EagleString.ETERM_COMMAND_TYPE.QUEUE_CLEAR_AUTO); m_socket.SendCommand(cmd, EagleProtocal.TypeOfCommand.Multi); }
private void btGetPNR_Click(object sender, EventArgs e) { try { tbAirCode.Text = tbAirCode.Text.Trim().ToUpper(); tbFlightNumber.Text = tbFlightNumber.Text.Trim().ToUpper(); tbDate.Text = tbDate.Text.Trim().ToUpper(); if (!EagleString.BaseFunc.PnrValidate(tbAirCode.Text)) { throw new Exception("大编码错误"); } if (tbFlightNumber.Text == "") { throw new Exception("请输入航班号"); } string cmd = "RRT:V/" + tbAirCode.Text + "/" + tbFlightNumber.Text + "/" + tbDate.Text; cmdpool.SetType(EagleString.ETERM_COMMAND_TYPE.RRT_AIRCODE2PNR); socket.SendCommand(cmd + "~rrt ok~" + cmd, EagleProtocal.TypeOfCommand.Multi); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void GetReceiptNumber(object sender, EventArgs e) { for (int i = 0; i < dg.SelectedRows.Count; i++) { string tktno = (dg.SelectedRows[i].Cells[4].Value.ToString()); string cmd = string.Format("detr:tn/{0},f", tktno); m_cmdpool.SetType(EagleString.ETERM_COMMAND_TYPE.DETR_GetReceiptNoFinance); m_socket.SendCommand(cmd, EagleProtocal.TypeOfCommand.Multi); System.Threading.Thread.Sleep(2000); } MessageBox.Show("完毕!"); //m_socket.Send(); }
/// <summary> /// 开始发送TPR:指令 /// </summary> /// <param name="flag"></param> public void Send() { for (int i = 0; i < m_tprInfo.Count; i++) { if (!m_tprInfo[i].STAT) { EagleString.Imported.SendMessage (0xFFFF, (int)EagleString.Imported.egMsg.SWITCH_CONFIG, m_tprInfo[i].IPID, 0); //AddText(string.Format("正在尝试切换配置到{0}", m_tprInfo[i].OFFICE)); //System.Threading.Thread.Sleep(2000); //AddText(string.Format("准备发送指令TOL:,等待5秒")); System.Threading.Thread.Sleep(5000); m_cmdpool.SetType(EagleString.ETERM_COMMAND_TYPE.TPR_IMPORT); m_socket.SendCommand(m_tprInfo[i].COMMAND, EagleProtocal.TypeOfCommand.AutoPn); return; } } throw new Exception("导入TPR完毕"); }
private void btnEtdz_Click(object sender, EventArgs e) { m_pnr = txtPnr.Text.Trim(); if (EagleString.BaseFunc.PnrValidate(m_pnr)) { if (chkPat.Checked) m_pat = ""; else m_pat = cbPat.Text.Trim(); m_onekey.SET(m_pnr,m_pat);// = new EagleString.Structs.ETDZONEKEY(m_pnr, m_pat); string cmd = m_cmdpool.HandleCommand("rt" + m_onekey.pnr); m_cmdpool.SetType(EagleString.ETERM_COMMAND_TYPE.ETDZ_ONEKEY_RT); m_socket.SendCommand(cmd, EagleProtocal.TypeOfCommand.Multi); //this.DialogResult = DialogResult.OK; } else { MessageBox.Show("请正确输入PNR"); } }
private void CreatePnr() { m_cmdpool.SetType(EagleString.ETERM_COMMAND_TYPE.SS_4PassengerAddForm); EagleString.egString.sortNameAndCardList(names, cards); string cmd = EagleString.CommandCreate.Create_SS_String( m_flight, m_bunk, m_date, m_citypair, names.Count, names.ToArray(), cards.ToArray(), EagleString.EagleFileIO.ValueOf("PNRORDERSUBMITPHONE"), m_li.b2b.lr.UsingOffice(), new string[] { m_li.b2b.username } ); m_socket.SendCommand(cmd, EagleProtocal.TypeOfCommand.Multi); btnOK.Enabled = false;//防止重复点击,在收到结果后重置 }
private void btnSubmit_Click(object sender, EventArgs e) { Hashtable ht = new Hashtable(); ht.Add("PNRORDERSUBMITPHONE", txtPhone.Text); EagleString.EagleFileIO.WiteHashTableToEagleDotTxt(ht); if (txtPhone.Text.Length < 5) { MessageBox.Show("请正确输入电话,方便出问题时及时联系"); return; } if (EagleString.BaseFunc.PnrValidate(txtPnr.Text.Trim())) { m_pnr = txtPnr.Text.Trim(); string cmd = m_cmdpool.HandleCommand("rt" + m_pnr); m_cmdpool.SetType(EagleString.ETERM_COMMAND_TYPE.PNR_ORDER_SUBMIT); m_socket.SendCommand(cmd, EagleProtocal.TypeOfCommand.Multi); } else { MessageBox.Show("PNR错误"); return; } }