Exemple #1
0
 private void cbName_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cbName.SelectedItem != null)
     {
         tbCardID.Text = EagleAPI.GetIDCardNo(retstring)[cbName.SelectedIndex];
     }
 }
Exemple #2
0
 private void cb被保险人姓名_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (cb被保险人姓名.SelectedItem != null)
         {
             if (GlobalVar.serverAddr == GlobalVar.ServerAddr.HangYiWang)
             {
                 tb证件号.Text = EagleAPI.GetIDCardNo(retstring)[cb被保险人姓名.SelectedIndex];
             }
             else if (GlobalVar.serverAddr == GlobalVar.ServerAddr.Eagle)
             {
                 Options.ibe.IbeRt ir = new Options.ibe.IbeRt(rtXml);
                 if (rtXml == "")
                 {
                     MessageBox.Show("请提取PNR"); return;
                 }
                 tb证件号.Text = ir.getpeopleinfo(1)[cb被保险人姓名.SelectedIndex];
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("选择姓名时:" + ex.Message);
     }
 }
Exemple #3
0
        static private void setcontrol(object sender, EventArgs e)
        {
            retstring = retstring.Replace('+', ' ');
            retstring = retstring.Replace('-', ' ');
            if (!EagleAPI.GetNoPnr(retstring))
            {
                return;
            }
            context.cbName.Items.Clear();
            List <string> names = new List <string>();

            names = EagleAPI.GetNames(retstring);
            for (int i = 0; i < names.Count; i++)
            {
                context.cbName.Items.Add(names[i]);
            }
            context.cbName.Text   = context.cbName.Items[0].ToString();
            context.tbCardID.Text = EagleAPI.GetIDCardNo(retstring)[0];
            string date = EagleAPI.GetDateStart(retstring);
            int    imm  = int.Parse(EagleAPI.GetMonthInt(date.Substring(date.Length - 3)));
            int    idd  = int.Parse(date.Substring(date.Length - 5).Substring(0, 2));
            int    iyy  = System.DateTime.Now.Year;

            //System.DateTime dt = new DateTime(iyy, imm, idd, 23, 59, 59);
            System.DateTime dt = new DateTime(iyy, imm, idd, 23, 59, 59);
            while (dt < System.DateTime.Now)
            {
                dt = dt.AddYears(1);
            }
            context.dtpBegin.Value = dt;
        }
Exemple #4
0
        private void btPrintLianXu_Click(object sender, EventArgs e)
        {
            if (tbFlightNo.Text.Trim() == "" || tbDate.Text.Trim() == "")
            {
                MessageBox.Show("请先输入航班及日期"); return;
            }
            bLianxu = true;
            string[] names                = new string[cbName.Items.Count];
            string[] cardids              = new string[cbName.Items.Count];
            string[] policynos            = new string[cbName.Items.Count];
            Options.PrintBaoXianLianXu pb = null;
            if (cbName.Items.Count < 1)
            {
                pb = new Options.PrintBaoXianLianXu();
            }
            else
            {
                for (int i = 0; i < names.Length; i++)
                {
                    names[i]   = cbName.Items[i].ToString();
                    cardids[i] = EagleAPI.GetIDCardNo(retstring)[i];
                    long no = (long.Parse(tbNo.Text.Trim()) + (long)i);
                    policynos[i] = no.ToString("D7");
                }
                pb = new Options.PrintBaoXianLianXu(names, cardids, policynos);
            }
            if (pb.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            if (pb.ls == null || pb.ls.Count < 1)
            {
                return;
            }
            ls = new List <string>(pb.ls);
            pb.Dispose();
            PrintDialog pd = new PrintDialog();

            EagleAPI.PrinterSetupCostom(ptDoc, 951, 399);
            pd.Document = ptDoc;
            //DialogResult dr = pd.ShowDialog();

            //if (dr == DialogResult.OK)
            {
                ptDoc.Print();
            }
        }
Exemple #5
0
        static private void setcontrol(object sender, EventArgs e)
        {
            retstring = retstring.Replace('+', ' ');
            retstring = retstring.Replace('-', ' ');
            if (!EagleAPI.GetNoPnr(retstring))
            {
                return;
            }
            context.cbName.Items.Clear();
            List <string> names = new List <string>();

            names = EagleAPI.GetNames(retstring);
            for (int i = 0; i < names.Count; i++)
            {
                context.cbName.Items.Add(names[i]);
            }
            context.cbName.Text   = context.cbName.Items[0].ToString();
            context.tbCardID.Text = EagleAPI.GetIDCardNo(retstring)[0];
            string date = EagleAPI.GetDateStart(retstring);

            try
            {
                int             imm = int.Parse(EagleAPI.GetMonthInt(date.Substring(date.Length - 3)));
                int             idd = int.Parse(date.Substring(date.Length - 5).Substring(0, 2));
                int             iyy = System.DateTime.Now.Year;
                System.DateTime dt  = new DateTime(iyy, imm, idd, 23, 59, 59);
                while (dt < System.DateTime.Now)
                {
                    dt = dt.AddYears(1);
                }
                //context.dtp_Start.Value = dt;

                context.tbFlightNo.Text = EagleAPI.GetFlightNo(retstring) + EagleAPI.GetFlightNo2(retstring);
                context.tbDate.Text     = dt.ToShortDateString();
            }
            catch
            {
                MessageBox.Show("注意:由于PNR信息异常,取时间出错,请手工输入!");
            }
        }
Exemple #6
0
        static private void setcontrol(object sender, EventArgs e)
        {
            if (GlobalVar.formSendCmdType == GlobalVar.FormSendCommandType.detrF)
            {
                try
                {
                    context.tbCardID.Text = EagleAPI.GetCardIdByDetr_F(retstringDetrF);
                    return;
                }
                catch (Exception ee)
                {
                    MessageBox.Show(ee.Message);
                    return;
                }
            }
            context.cbName.Items.Clear();
            try
            {
                if (context.radioButton1.Checked || context.radioButton2.Checked)
                {
                    retstring = retstring.Replace('+', ' ');
                    retstring = retstring.Replace('-', ' ');
                    if (!EagleAPI.GetNoPnr(retstring))
                    {
                        return;
                    }

                    List <string> names = new List <string>();
                    names = EagleAPI.GetNames(retstring);
                    for (int i = 0; i < names.Count; i++)
                    {
                        context.cbName.Items.Add(names[i]);
                    }
                    context.cbName.Text   = context.cbName.Items[0].ToString();
                    context.tbCardID.Text = EagleAPI.GetIDCardNo(retstring)[0];
                    string          date = EagleAPI.GetDateStart(retstring);
                    int             imm  = int.Parse(EagleAPI.GetMonthInt(date.Substring(date.Length - 3)));
                    int             idd  = int.Parse(date.Substring(date.Length - 5).Substring(0, 2));
                    int             iyy  = System.DateTime.Now.Year;
                    System.DateTime dt   = new DateTime(iyy, imm, idd, 23, 59, 59);
                    while (dt < System.DateTime.Now)
                    {
                        dt = dt.AddYears(1);
                    }
                    //context.dtp_Start.Value = dt;

                    context.tbFlightNo.Text = EagleAPI.GetFlightNo(retstring) + EagleAPI.GetFlightNo2(retstring);
                    context.tbDate.Text     = dt.ToShortDateString();
                }
                if (context.radioButton3.Checked)
                {
                    ePlus.eTicket.etInfomation ei = new ePlus.eTicket.etInfomation();
                    ei.SetVar(retstring);
                    context.cbName.Items.Add(ei.PASSENGER);
                    context.cbName.Text     = ei.PASSENGER;
                    context.tbCardID.Text   = "";
                    context.tbFlightNo.Text = EagleAPI.substring(ei.FROM, 4, 2) + EagleAPI.substring(ei.FROM, 10, 4);
                    string          date = EagleAPI.substring(ei.FROM, 18, 5);
                    int             imm  = int.Parse(EagleAPI.GetMonthInt(date.Substring(date.Length - 3)));
                    int             idd  = int.Parse(date.Substring(date.Length - 5).Substring(0, 2));
                    int             iyy  = System.DateTime.Now.Year;
                    System.DateTime dt   = new DateTime(iyy, imm, idd, 23, 59, 59);
                    while (dt < System.DateTime.Now)
                    {
                        dt = dt.AddYears(1);
                    }
                    context.tbDate.Text = dt.ToShortDateString();
                }
            }
            catch
            {
            }
        }
Exemple #7
0
        public bool set(string p, string s)
        {
            try
            {
                isEticket = (s.IndexOf("**ELECTRONIC TICKET PNR**") >= 0);
                pnr       = p;
                string[] tArray = EagleAPI.GetETNumber(s);
                if (tArray.Length < 1)
                {
                    throw new Exception("未取到票号!");
                }
                etnumbers = "";
                foreach (string t in tArray)
                {
                    etnumbers += t + ";";
                }
                while (etnumbers.IndexOf(";;") >= 0)
                {
                    etnumbers = etnumbers.Replace(";;", ";");
                }
                etnumbers = mystring.trim(etnumbers, ';');
                List <string> names   = EagleAPI.GetNames(s);
                string[]      cardids = EagleAPI.GetIDCardNo(s);
                passengers = "";
                for (int i = 0; i < names.Count; i++)
                {
                    passengers += ";" + names[i] + "-" + cardids[i];
                }
                passengers = mystring.trim(passengers, ';');

                //float count = (float)etnumbers.Split(':').Length;
                float count = 1F;
                try
                {
                    totalfc = string.Format("{0}", float.Parse(EagleAPI.GetTatol(s).Substring(3)) * count);
                }
                catch
                { totalfc = "0"; }
                try
                {
                    tf = string.Format("{0}", float.Parse(EagleAPI.GetTaxFuel(s).Substring(3)) * count);
                }
                catch { tf = "0"; }
                try
                {
                    tb = string.Format("{0}", float.Parse(EagleAPI.GetTaxBuild(s).Substring(EagleAPI.GetTaxBuild(s)[3] > '9' ? 0 : 3)) * count);
                }
                catch
                { tb = "0"; }


                fn1   = EagleAPI.GetCarrier(s) + EagleAPI.GetFlight(s);
                fn2   = EagleAPI.GetCarrier2(s) + EagleAPI.GetFlight2(s);
                bunk1 = EagleAPI.GetClass(s);
                bunk2 = EagleAPI.GetClass2(s);
                date1 = EagleAPI.GetDateStart(s);
                date2 = EagleAPI.GetDateStart2(s);
                cp1   = EagleAPI.GetStartCity(s) + EagleAPI.GetEndCity(s);
                cp2   = EagleAPI.GetEndCity(s) + EagleAPI.GetEndCity2(s);
                if (cp2.Length < 6 || cp2 == cp1)
                {
                    cp2 = "";
                }
            }
            catch (Exception ex)
            {
                EagleAPI.LogWrite(ex.Message);
                return(false);
            }
            return(true);
        }
Exemple #8
0
        private void btPrintLianXu_Click(object sender, EventArgs e)
        {
            if (tb航班号.Text.Trim() == "" || tb乘机日.Text.Trim() == "")
            {
                MessageBox.Show("请先输入航班及日期"); return;
            }
            bLianxu = true;
            string[] names                = new string[cb被保险人姓名.Items.Count];
            string[] cardids              = new string[cb被保险人姓名.Items.Count];
            string[] policynos            = new string[cb被保险人姓名.Items.Count];
            Options.PrintBaoXianLianXu pb = null;
            if (cb被保险人姓名.Items.Count < 1)
            {
                pb = new Options.PrintBaoXianLianXu();
            }
            else
            {
                for (int i = 0; i < names.Length; i++)
                {
                    try
                    {
                        names[i]   = cb被保险人姓名.Items[i].ToString();
                        cardids[i] = EagleAPI.GetIDCardNo(retstring)[i];
                        long no = (long.Parse(tb保单序号.Text.Trim()) + (long)i);
                        policynos[i] = no.ToString("D" + insuranceNumberLength.ToString());
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message + "\r\n\r\n提示:只有在能自动提取出身份证的情况下可正常连续打印");
                        return;
                    }
                }
                pb = new Options.PrintBaoXianLianXu(names, cardids, policynos);
            }
            pb.insLength = insuranceNumberLength;
            if (pb.insLength == 0)
            {
                MessageBox.Show("未设置保单长度insuranceNumberLength");
                return;
            }

            if (pb.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            if (pb.ls == null || pb.ls.Count < 1)
            {
                return;
            }
            ls = new List <string>(pb.ls);
            pb.Dispose();
            PrintDialog pd = new PrintDialog();

            EagleAPI.PrinterSetupCostom(ptDoc, paperWidth, paperHeight);
            pd.Document = ptDoc;
            //DialogResult dr = pd.ShowDialog();

            //if (dr == DialogResult.OK)
            {
                ptDoc.Print();
            }
        }