Пример #1
0
        public void AddResult(EagleString.AvResult avres, bool profit)
        {
            m_show_profit = profit;
            bool clear  = (m_pool.TYPE == EagleString.ETERM_COMMAND_TYPE.AV);
            bool sendpn = true;

            if (clear)
            {
                ls_av.Clear();
                lv.Items.Clear();
            }
            if (ls_av.Count == 0)
            {
                ls_av.Add(new EagleString.AvResult(avres.AvString, avres.Price, avres.Distance));
            }
            else
            {
                if (avres.FlightDate_DT == ls_av[0].FlightDate_DT && avres.AvString != ls_av[ls_av.Count - 1].AvString)
                {
                    ls_av.Add(new EagleString.AvResult(avres.AvString, avres.Price, avres.Distance));
                }
                else
                {
                    sendpn = false;
                    SetLV();
                }
            }
            if (sendpn)
            {
                string cmd = m_pool.HandleCommand("pn");
                m_socket.SendCommand(cmd, EagleProtocal.TypeOfCommand.Multi);
            }
        }
Пример #2
0
        private void btnGetCardNo_Click(object sender, EventArgs e)
        {
            if (lsTktNo.Count > selectIndex && !string.IsNullOrEmpty(lsTktNo[selectIndex]))
            {
                this.picLoadID.Visible = true;
                if (Options.GlobalVar.QueryType == XMLConfig.QueryType.Eterm)
                {
                    LoadingWebServiceStart();
                    new Thread(QueryZizaibaoForNI).Start(lsTktNo[selectIndex]);
                    return;

                    LoadingStart();
                    //string cmd = m_cmdpool.HandleCommand("detr:tn/" + lsTktNo[selectIndex] + ",f");
                    //m_socket.SendCommand(cmd, EagleProtocal.TypeOfCommand.Multi);
                    //简化指令 by king 2009.12.07
                    string cmd = "detr:tn/" + lsTktNo[selectIndex] + ",f";
                    m_cmdpool.SetCommandType(cmd);
                    m_socket.SendCommand(cmd, EagleProtocal.TypeOfCommand.Multi);
                }
                else if (Options.GlobalVar.QueryType == XMLConfig.QueryType.WebService)
                {
                    LoadingWebServiceStart();
                    new Thread(QueryWebserviceForNI).Start(lsTktNo[selectIndex]);
                }
                else
                {
                    LoadingWebServiceStart();
                    new Thread(QueryZizaibaoForNI).Start(lsTktNo[selectIndex]);
                }
            }
        }
Пример #3
0
        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);
            }
        }
Пример #4
0
 public void setcontrol(string retstring)
 {
     retstring    = retstring.Replace('+', ' ');
     retstring    = retstring.Replace('-', ' ');
     tbQuene.Text = retstring;
     b_qtCmd      = false;
     if (b_qtCmd)//若是QT命令
     {
         string temp = GetTerminalByQT(tbQuene.Text);
         WriteTerminal(temp);
         CurrentTerminal = temp;
         if (tvQuene.InvokeRequired)
         {
             delegQueue1 deleg = ReadTerminal;
             tvQuene.Invoke(deleg);
         }
         else
         {
             ReadTerminal();
         }
     }
     else//否则清Q指令
     {
         string temp = tbQuene.Text;
         if (temp.IndexOf("CITY") >= 0)
         {
             return;                           //测试时意外情况(0点)
         }
         if (temp.IndexOf("SESSION PATH") >= 0)
         {
             return;                                   //测试时发现意外情况(0点)
         }
         if (temp.IndexOf("Q EMPTY") > -1)
         {
             m_pool.HandleCommand("i");
             return;
         }
         else
         {
             //存入数据库
             WriteQuene(CurrentTerminal, cbQueneType.Text, temp);
             //然后发送QD/QN
             m_socket.SendCommand("QN", EagleProtocal.TypeOfCommand.Multi);
         }
     }
 }
Пример #5
0
 private void txtPnr_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyValue == 13)
     {
         m_pnr = txtPnr.Text.Trim();
         if (!EagleString.BaseFunc.PnrValidate(m_pnr))
         {
             MessageBox.Show("输入的PNR不正确!");
             return;
         }
         else
         {
             string cmd = "rt:n/" + m_pnr + "/eg";
             cmd = m_cmdpool.HandleCommand(cmd);
             m_socket.SendCommand(cmd, EagleProtocal.TypeOfCommand.AutoPn);
         }
     }
 }
Пример #6
0
        private void btnAv_Click(object sender, EventArgs e)
        {
            SaveConfig();
            m_pool.Clear();
            string av =
                EagleString.CommandCreate.Create_AV_String(m_av_from, m_av_to, m_av_date, 0, m_av_direct, m_av_carrier);
            string cmd = m_pool.HandleCommand(av);

            m_socket.SendCommand(cmd, EagleProtocal.TypeOfCommand.Multi);
        }
Пример #7
0
 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();
 }
Пример #8
0
        private void btnTRFX_Click(object sender, EventArgs e)
        {
            string ret = "";
            char   ch  = (char)0x1A;
            string sch = ch.ToString();

            ch = (char)0x0D;
            string returnch = ch.ToString();

            ret += "TRFX:";
            ret += sch;
            ret += textBox1.Text.PadRight(2, ' ');
            ret += sch;
            ret += textBox2.Text.PadRight(2, ' ');
            ret += sch;
            ret += textBox3.Text.PadRight(1, ' ');
            ret += sch;
            ret += textBox4.Text.PadRight(1, ' ');
            ret += returnch;
            string cmd = m_cmdpool.HandleCommand(ret);

            m_socket.SendCommand(cmd, EagleProtocal.TypeOfCommand.Multi);
        }
Пример #9
0
 /// <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完毕");
 }
Пример #10
0
        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");
            }
        }
Пример #11
0
        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;//防止重复点击,在收到结果后重置
        }
Пример #12
0
        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;
            }
        }