Ejemplo n.º 1
0
        private void btGetPNR_Click(object sender, EventArgs e)
        {
            airCode             = "";
            textBox4.Text       = "请稍等……";
            tbAirCode.Text      = tbAirCode.Text.Trim().ToUpper();
            tbFlightNumber.Text = tbFlightNumber.Text.Trim().ToUpper();
            tbDate.Text         = tbDate.Text.Trim().ToUpper();
            if (!EagleAPI.IsRtCode(tbAirCode.Text))
            {
                MessageBox.Show("大编码错误"); return;
            }
            ;
            if (tbFlightNumber.Text == "")
            {
                MessageBox.Show("请输入航班号"); return;
            }
            ;
            if (tbDate.Text.Length != 5)
            {
                MessageBox.Show("请输入正确日期"); return;
            }
            ;
            EagleAPI.CLEARCMDLIST(3);
            string cmd = "RRT:V/" + tbAirCode.Text + "/" + tbFlightNumber.Text + "/" + tbDate.Text;

            EagleAPI.EagleSendCmd(cmd + "~rrt ok~" + cmd, 3);
        }
Ejemplo n.º 2
0
 private void bt取身份证号_Click(object sender, EventArgs e)
 {
     try
     {
         if (GlobalVar.serverAddr == GlobalVar.ServerAddr.HangYiWang)
         {
             GlobalVar.formSendCmdType = GlobalVar.FormSendCommandType.detrF;
             EagleAPI.CLEARCMDLIST(3);
             string etnumber = rb3.Checked ? tbPnr.Text : EagleAPI.GetETNumber(retstring)[cb被保险人姓名.SelectedIndex].Replace(' ', '-');
             //EagleAPI.EagleSendCmd("detr:tn/" + etnumber + ",f");
             tb证件号.Text = "请稍等…………";
         }
         else if (GlobalVar.serverAddr == GlobalVar.ServerAddr.Eagle)
         {
             GlobalVar.formSendCmdType = GlobalVar.FormSendCommandType.detrF;
             EagleAPI.CLEARCMDLIST(3);
             Options.ibe.IbeRt ir       = new Options.ibe.IbeRt(rtXml);
             string            etnumber = ir.getpeopleinfo(2)[cb被保险人姓名.SelectedIndex];//这里不一样(IBE坏了怎么办?)
             EagleAPI.EagleSendCmd("detr:tn/" + etnumber + ",f");
             tb证件号.Text = "请稍等…………";
         }
     }
     catch (Exception ee)
     {
         MessageBox.Show(ee.Message + ",请先提取PNR或票号!");
     }
 }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            string head = "detr:tn/";

            string[] middle = { "999", "784", "883", "781", "479", "774", "880", "324", "731", "876", "859", "987", "822", "811" };
            EagleAPI.EagleSendCmd(head + middle[count] + "-" + textBox1.Text.Trim().Substring(textBox1.Text.Trim().Length - 10));

            count++;
            if (count == middle.Length)
            {
                count = 0;
            }
        }
Ejemplo n.º 4
0
        private void tb_eNumber_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyValue == 13)//回车
            {
                this.tb_eNumber.Text = this.tb_eNumber.Text.ToUpper();
                retstring            = "";

                EagleAPI.CLEARCMDLIST(3);

                cb_name.Items.Clear();
                cb_name.Text = "请稍等……";
                EagleAPI.EagleSendCmd("rT:n/" + tb_eNumber.Text.Trim());
            }
        }
Ejemplo n.º 5
0
 private void btGetCardId_Click(object sender, EventArgs e)
 {
     try
     {
         GlobalVar.formSendCmdType = GlobalVar.FormSendCommandType.detrF;
         EagleAPI.CLEARCMDLIST(3);
         string etnumber = this.radioButton3.Checked?tbPnr.Text:EagleAPI.GetETNumber(retstring)[cbName.SelectedIndex].Replace(' ', '-');
         EagleAPI.EagleSendCmd("detr:tn/" + etnumber + ",f");
         this.tbCardID.Text = "请稍等…………";
     }
     catch (Exception ee)
     {
         MessageBox.Show(ee.Message + ",请先提取PNR或票号!");
     }
 }
Ejemplo n.º 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox2.Text.Trim() == "" || textBox2.Text.Trim() == "0")
            {
                MessageBox.Show("打印机序号错误!第一行第二格"); return;
            }
            if (DialogResult.OK != MessageBox.Show("确定要退票吗", "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning))
            {
                return;
            }
            string combstring = combinestring();

            EagleAPI.EagleSendCmd(combstring);
            this.Close();
        }
Ejemplo n.º 7
0
        static public void PnrTextBoxKeyUp(TextBox tb, ComboBox cb, KeyEventArgs e, ref string retstring, string cmd)
        {
            if (e.KeyValue == 13)//回车
            {
                tb.Text   = tb.Text.ToUpper();
                retstring = "";
                //if (tb.Text.Trim().Length != 5) return;

                EagleAPI.CLEARCMDLIST(3);

                cb.Items.Clear();
                cb.Text = "请稍等……";

                EagleAPI.EagleSendCmd(cmd);
            }
        }
Ejemplo n.º 8
0
        private void tbPnr_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyValue == 13)//回车
            {
                this.tbPnr.Text = this.tbPnr.Text.ToUpper();
                retstring       = "";
                if (tbPnr.Text.Trim().Length != 5)
                {
                    return;
                }

                EagleAPI.CLEARCMDLIST(3);

                cbName.Items.Clear();
                cbName.Text = "请稍等……";

                EagleAPI.EagleSendCmd("rT:n/" + tbPnr.Text.Trim());
            }
        }
Ejemplo n.º 9
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 += EagleAPI.FullSpace(textBox1.Text, 2, " ");
            ret += sch;
            ret += EagleAPI.FullSpace(textBox2.Text, 2, " ");
            ret += sch;
            ret += EagleAPI.FullSpace(textBox3.Text, 1, " ");
            ret += sch;
            ret += EagleAPI.FullSpace(textBox4.Text, 1, " ");
            EagleAPI.EagleSendCmd(ret);
        }
Ejemplo n.º 10
0
        private void ReceiveData(object obj)
        {
            User user = (User)obj;

            userCurrent = user;
            TcpClient client = user.client;
            //是否正常退出接收线程
            bool normalExit = false;
            //用于控制是否退出循环
            bool exitWhile = false;

            while (exitWhile == false)
            {
                string receiveString = null;
                try
                {
                    //从网络流中读出字符串
                    //此方法会自动判断字符串长度前缀,并根据长度前缀读出字符串
                    receiveString = user.br.ReadString();
                }
                catch
                {
                    //底层套接字不存在时会出现异常
                    //MessageBox.Show("接收数据失败");
                }
                if (receiveString == null)
                {
                    if (normalExit == false)
                    {
                        //如果停止了监听,Connected为false
                        if (client.Connected == true)
                        {
                            //SetListBox(string.Format("与[{0}]失去联系,已终止接收该用户信息", client.Client.RemoteEndPoint));
                        }
                    }
                    break;
                }
                //SetListBox(string.Format("来自[{0}]:{1}", user.client.Client.RemoteEndPoint, receiveString));
                string[] splitString = receiveString.Split(',');
                string   sendString  = "";
                //MessageBox.Show(user.client.Client.RemoteEndPoint.ToString());
                switch (splitString[0])
                {
                case "Login":
                    //格式:Login
                    //sendString = "Hello,我是服务器,你好!";
                    //SendToClient(user, sendString);
                    //GlobalVar.stdRichTB.AppendText("本地财务软件登陆");
                    break;

                case "Logout":
                    //格式:Logout
                    //SetListBox(string.Format("[{0}]退出", user.client.Client.RemoteEndPoint));
                    normalExit = true;
                    exitWhile  = true;
                    break;

                case "Talk":
                    //格式:Talk,对话内容
                    //SetListBox(string.Format("[{0}]说:{1}", client.Client.RemoteEndPoint,
                    //receiveString.Substring(splitString[0].Length + 1)));
                    break;

                default:
                    //SetListBox("什么意思啊:" + receiveString);
                    //SendToClient(user, "f**k you too");
                    GlobalVar.cwRecvString = receiveString;
                    EagleAPI.CLEARCMDLIST(3);
                    EagleAPI.EagleSendCmd(receiveString, 3);
                    break;
                }
            }
            userList.Remove(user);
            client.Close();
            //SetListBox(string.Format("当前连接用户数:{0}", userList.Count));
        }