Ejemplo n.º 1
0
        private void btSubmit_Click(object sender, EventArgs e)
        {
            if (tbInsuranceNo.Text.Trim().Length != 7)
            {
                MessageBox.Show("左上角保单号有误,应为七位数字");
                return;
            }
            try
            {
                long.Parse(tbInsuranceNo.Text.Trim());
            }
            catch
            {
                MessageBox.Show("左上角保单号有误,应为七位数字");
                return;
            }
            if (cbName.Text.Trim() == "")
            {
                MessageBox.Show("姓名不能为空");
                return;
            }
            if (tbCardID.Text.Trim() == "")
            {
                MessageBox.Show("证件号码不能为空");
                return;
            }

            this.tbENumber.Text = eNumberHead + EagleAPI.GetRandom62(10000L);//这里不一样
            if (!GlobalVar.b_OffLine)
            {
                if (cbName.Text != GlobalVar.HYXTESTPRINT)
                {
                    HyxStructs hs = new HyxStructs();
                    hs.UserID      = GlobalVar.loginName;
                    hs.eNumber     = tbENumber.Text;
                    hs.IssueNumber = tbInsuranceNo.Text;
                    hs.NameIssued  = cbName.Text;
                    hs.CardType    = "";
                    hs.CardNumber  = tbCardID.Text;
                    hs.Remark      = "009";//4新华出行关爱009
                    hs.IssuePeriod = "10天";
                    hs.IssueBegin  = this.dtpBegin.Value.ToShortDateString() + " 00:00:00";
                    hs.IssueEnd    = this.dtpEnd.Value.ToShortDateString() + " 23:59:59";

                    hs.NameBeneficiary = this.tbBeneficiary.Text;
                    hs.Signature       = this.tbSignature.Text;
                    hs.SignDate        = this.dtpSignDate.Value.ToString();
                    hs.Pnr             = this.tbPnr.Text;
                    if (!hs.SubmitInfo())
                    {
                        MessageBox.Show("数据提交失败!请检查保单号及是否分配或网络是否正常!");
                        return;
                    }
                }
            }
            MessageBox.Show("上传成功");
            this.bt_Print.Enabled = true;
        }
Ejemplo n.º 2
0
        private void ptDoc_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            e.Graphics.PageUnit = GraphicsUnit.Millimeter;
            Font ptFontEn = new Font("system", 9, System.Drawing.FontStyle.Regular);
            //Font ptFontCn = new Font("tec", EagleAPI.fontsizecn, System.Drawing.FontStyle.Regular);
            Brush ptBrush = Brushes.Black;

            e.PageSettings.Margins.Left   = 0;
            e.PageSettings.Margins.Right  = 0;
            e.PageSettings.Margins.Top    = 0;
            e.PageSettings.Margins.Bottom = 0;
            PointF o = new PointF();

            o.X = float.Parse(numericUpDown1.Value.ToString());
            o.Y = float.Parse(numericUpDown2.Value.ToString());
            //打印项
            HyxStructs hs    = new HyxStructs();
            float      scale = 1F;

            if (!bLianxu)
            {
                List <string> ptString = new List <string>();
                List <PointF> ptPoint  = new List <PointF>();
                ptString.Add(this.tb保单号码.Text); ptPoint.Add(new PointF(49.3F * scale, 31.4F * scale));
                ptString.Add(this.cb被保险人姓名.Text); ptPoint.Add(new PointF(65.3F * scale, 42.9F * scale));
                ptString.Add(this.tb证件号.Text); ptPoint.Add(new PointF(116.3F * scale, 42.9F * scale));
                ptString.Add(this.tb航班号.Text + "  " + this.tb乘机日.Text); ptPoint.Add(new PointF(111.3F * scale, 57.9F * scale));
                //ptString.Add(this.tb乘机日.Text); ptPoint.Add(new PointF(111.3F * scale, 43.7F * scale));
                ptString.Add(this.tb受益人资料.Text); ptPoint.Add(new PointF(118.9F * scale, 82.0F * scale));
                ptString.Add(this.tb填开日期.Text); ptPoint.Add(new PointF(175.3F * scale, 92.3F * scale));
                ptString.Add(this.tb经办人.Text); ptPoint.Add(new PointF(175.3F * scale, 98.0F * scale));

                /*被保险人姓名:48.5,35.3
                 * 身份证号/护照号:117.9,35.3
                 * 航班号:45.7,43.7
                 * 乘机日:111.3,43.7
                 * 受益人姓名:45.7,59.9
                 * 打印日期:166.6,74.2
                 * 经办人:3.51,83.3*/
                PrintHyx.PrintHyxPublic.PrintItems(ptString.ToArray(), ptPoint.ToArray(), o, ptFontEn, ptBrush, e);
            }
            else
            {
                if (ls == null || ls.Count == 0)
                {
                    return;
                }
                //for (int i = 0; i < ls.Count; i++)
                bool bSubmited = false;
                {
                    hs.UserID           = GlobalVar.loginName;
                    hs.eNumber          = eNumberHead + EagleAPI.GetRandom62(); //this.tb保单号码.Text;
                    hs.IssueNumber      = ls[iPage].Split('~')[2];
                    hs.NameIssued       = ls[iPage].Split('~')[0];
                    hs.CardType         = "航班号" + tb航班号.Text + "乘机日" + tb乘机日.Text;
                    hs.CardNumber       = ls[iPage].Split('~')[1];
                    hs.Remark           = insuranceType;                                    //保险种类别名代码B07
                    hs.IssuePeriod      = "";
                    hs.IssueBegin       = (bhyx ? tb乘机日.Text : dtp保险起始时间.Value.ToString()); //必须为时间串
                    hs.IssueEnd         = (bhyx ? tb乘机日.Text : dtp保险终止时间.Value.ToString()); //必须为时间串
                    hs.SolutionDisputed = "";
                    hs.NameBeneficiary  = tb受益人资料.Text + tb受益人关系.Text;
                    hs.Signature        = tb经办人.Text;  // tbSignatureDate.Text;
                    hs.SignDate         = tb填开日期.Text; //dtp_Date.Value.ToShortDateString();
                    hs.InssuerName      = "";
                    hs.Pnr = tbPnr.Text;
                    if (!hs.SubmitInfo())
                    {
                        MessageBox.Show(ls[iPage].Replace("~", "-") + "提交失败!");
                        bSubmited = false;
                    }
                    else
                    {
                        bSubmited = true;
                    }
                }
                {
                    if (bSubmited)
                    {
                        List <string> ptString = new List <string>();
                        List <PointF> ptPoint  = new List <PointF>();
                        ptString.Add(hs.eNumber); ptPoint.Add(new PointF(49.3F * scale, 31.4F * scale));
                        ptString.Add(this.cb被保险人姓名.Text); ptPoint.Add(new PointF(65.3F * scale, 42.9F * scale));
                        //ptString.Add(this.tb证件号.Text); ptPoint.Add(new PointF(117.9F * scale, 35.5F * scale));
                        //ptString.Add(this.tb航班号.Text); ptPoint.Add(new PointF(45.7F * scale, 43.7F * scale));
                        ptString.Add(ls[iPage].Split('~')[0]); ptPoint.Add(new PointF(116.3F * scale, 42.9F * scale));
                        ptString.Add(ls[iPage].Split('~')[1]); ptPoint.Add(new PointF(111.3F * scale, 57.9F * scale));

                        //ptString.Add(this.tb乘机日.Text); ptPoint.Add(new PointF(111.3F * scale, 43.7F * scale));
                        ptString.Add(this.tb受益人资料.Text); ptPoint.Add(new PointF(118.9F * scale, 82.0F * scale));
                        ptString.Add(this.tb填开日期.Text); ptPoint.Add(new PointF(175.3F * scale, 92.3F * scale));
                        ptString.Add(this.tb经办人.Text); ptPoint.Add(new PointF(175.3F * scale, 98.0F * scale));

                        PrintHyx.PrintHyxPublic.PrintItems(ptString.ToArray(), ptPoint.ToArray(), o, ptFontEn, ptBrush, e);
                    }
                    iPage++;
                    if (iPage < ls.Count)
                    {
                        e.HasMorePages = true;
                    }
                    else
                    {
                        e.HasMorePages = false;
                    }
                }
            }
        }
Ejemplo n.º 3
0
        private void ptDoc_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            e.Graphics.PageUnit = GraphicsUnit.Millimeter;
            Font ptFontEn = new Font("system", GlobalVar.fontsize, System.Drawing.FontStyle.Regular);
            //Font ptFontCn = new Font("tec", EagleAPI.fontsizecn, System.Drawing.FontStyle.Regular);
            Brush ptBrush = Brushes.Black;

            e.PageSettings.Margins.Left   = 0;
            e.PageSettings.Margins.Right  = 0;
            e.PageSettings.Margins.Top    = 0;
            e.PageSettings.Margins.Bottom = 0;
            PointF o = new PointF();

            o.X = float.Parse(numericUpDown1.Value.ToString());
            o.Y = float.Parse(numericUpDown2.Value.ToString());
            //打印项
            if (!bLianxu)
            {
                List <string> ptString = new List <string>();
                List <PointF> ptPoint  = new List <PointF>();
                ptString.Add(this.tbPolicyIDNo.Text); ptPoint.Add(new PointF(185F, 31F));
                ptString.Add(cbName.Text); ptPoint.Add(new PointF(57.1F, 39F));
                ptString.Add(tbCardID.Text); ptPoint.Add(new PointF(155F, 39F));
                ptString.Add(tbFlightNo.Text); ptPoint.Add(new PointF(57.1F, 50F));
                ptString.Add(tbDate.Text); ptPoint.Add(new PointF(155F, 50F));
                ptString.Add(tbRelation.Text); ptPoint.Add(new PointF(131.8F, 72.4F));
                ptString.Add(tbBenefit.Text); ptPoint.Add(new PointF(47F, 72.4F));
                //ptString.Add(tbPhone.Text); ptPoint.Add(new PointF(44F, 90F));
                ptString.Add(dateTimePicker1.Value.ToShortDateString()); ptPoint.Add(new PointF(106.4F, 84.3F));
                ptString.Add(tbSignatureDate.Text); ptPoint.Add(new PointF(183.1F, 84.3F));
                PrintHyx.PrintHyxPublic.PrintItems(ptString.ToArray(), ptPoint.ToArray(), o, ptFontEn, ptBrush, e);
            }
            else
            {
                if (ls == null || ls.Count == 0)
                {
                    return;
                }
                //for (int i = 0; i < ls.Count; i++)
                bool bSubmited = false;
                {
                    HyxStructs hs = new HyxStructs();
                    hs.UserID           = GlobalVar.loginName;
                    hs.eNumber          = System.DateTime.Now.Year.ToString().Remove(1, 1) + EagleAPI.GetRandom62();// tbPolicyNo.Text;
                    hs.IssueNumber      = ls[iPage].Split('~')[2];
                    hs.NameIssued       = ls[iPage].Split('~')[0];
                    hs.CardType         = "航班号" + tbFlightNo.Text + "乘机日" + tbDate.Text;;
                    hs.CardNumber       = ls[iPage].Split('~')[1];
                    hs.Remark           = "B06";       //9"平安-周游列国"
                    hs.IssuePeriod      = "";
                    hs.IssueBegin       = tbDate.Text; // dtp_Start.Value.ToShortDateString() + " 00:00:00";
                    hs.IssueEnd         = tbDate.Text; // dtp_End.Value.ToShortDateString() + " 00:00:00";
                    hs.SolutionDisputed = "";
                    hs.NameBeneficiary  = tbBenefit.Text;
                    hs.Signature        = this.tbSignatureDate.Text;                      // this.tbSignatureDate.Text;
                    hs.SignDate         = this.dateTimePicker1.Value.ToShortDateString(); //dtp_Date.Value.ToShortDateString();
                    hs.InssuerName      = "";
                    hs.Pnr = this.tbPnr.Text;
                    if (!hs.SubmitInfo())
                    {
                        MessageBox.Show(ls[iPage].Replace("~", "-") + "提交失败!");
                        bSubmited = false;
                    }
                    else
                    {
                        bSubmited = true;
                    }
                }
                {
                    if (bSubmited)
                    {
                        List <string> ptString = new List <string>();
                        List <PointF> ptPoint  = new List <PointF>();
                        ptString.Add(this.tbPolicyIDNo.Text); ptPoint.Add(new PointF(185F, 31F));
                        ptString.Add(ls[iPage].Split('~')[0]); ptPoint.Add(new PointF(57.1F, 39F));
                        ptString.Add(ls[iPage].Split('~')[1]); ptPoint.Add(new PointF(155F, 39F));
                        ptString.Add(tbFlightNo.Text); ptPoint.Add(new PointF(57.1F, 50F));
                        ptString.Add(tbDate.Text); ptPoint.Add(new PointF(155F, 50F));
                        ptString.Add(tbRelation.Text); ptPoint.Add(new PointF(131.8F, 72.4F));
                        ptString.Add(tbBenefit.Text); ptPoint.Add(new PointF(47F, 72.4F));
                        //ptString.Add(tbPhone.Text); ptPoint.Add(new PointF(44F, 90F));
                        ptString.Add(dateTimePicker1.Value.ToShortDateString()); ptPoint.Add(new PointF(106.4F, 84.3F));
                        ptString.Add(tbSignatureDate.Text); ptPoint.Add(new PointF(183.1F, 84.3F));
                        PrintHyx.PrintHyxPublic.PrintItems(ptString.ToArray(), ptPoint.ToArray(), o, ptFontEn, ptBrush, e);
                    }
                    iPage++;
                    if (iPage < ls.Count)
                    {
                        e.HasMorePages = true;
                    }
                    else
                    {
                        e.HasMorePages = false;
                    }
                }
            }
        }
Ejemplo n.º 4
0
        private void bt_Print_Click(object sender, EventArgs e)
        {
            save_phone();
            if (tbNo.Text.Trim().Length != 16)
            {
                MessageBox.Show("保单号长度错误");
                return;
            }
            try
            {
                long.Parse(tbNo.Text.Trim());
                int.Parse(tbTerm.Text.Trim());
                if (int.Parse(tbTimeBeg.Text.Trim()) >= 24 || int.Parse(tbTimeBeg.Text.Trim()) < 0 || int.Parse(tbTimeEnd.Text.Trim()) >= 24 || int.Parse(tbTimeEnd.Text.Trim()) < 0)
                {
                    MessageBox.Show("时间不正确");
                    return;
                }
            }
            catch
            {
                MessageBox.Show("保单号或保险期限或时间只能为数字");
                return;
            }
            if (cbName.Text.Trim() == "")
            {
                MessageBox.Show("姓名不能为空");
                return;
            }
            if (tbCardID.Text.Trim() == "")
            {
                MessageBox.Show("证件号码不能为空");
                return;
            }

            this.tbPolicyNo.Text = this.eNumberHead + "0" + tbNo.Text.Trim().Substring(8, 8);
            if (!(bEagleDubang && b_dubang03))
            {
                if (!GlobalVar.b_OffLine)
                {
                    //if (!b_dubang03)
                    {
                        if (cbName.Text != GlobalVar.HYXTESTPRINT)
                        {
                            HyxStructs hs = new HyxStructs();
                            hs.UserID      = GlobalVar.loginName;
                            hs.eNumber     = tbPolicyNo.Text;
                            hs.IssueNumber = tbNo.Text;
                            hs.NameIssued  = cbName.Text;
                            hs.CardType    = "";
                            hs.CardNumber  = tbCardID.Text;
                            if (b_dubang03)
                            {
                                hs.Remark = "B05";            //出行乐
                            }
                            else
                            {
                                hs.Remark = "B04"; //8"都帮出行无忧";B04
                            }
                            hs.IssuePeriod      = tbTerm.Text.Trim() + "天";
                            hs.IssueBegin       = dtpBeg.Value.ToShortDateString() + " " + tbTimeBeg.Text.Trim() + ":00:00";
                            hs.IssueEnd         = dtpEnd.Value.ToShortDateString() + " " + tbTimeEnd.Text.Trim() + ":00:00";
                            hs.SolutionDisputed = "";
                            hs.NameBeneficiary  = this.tbBeneficiary.Text;
                            hs.Signature        = this.tbSignature.Text;
                            hs.SignDate         = dtpPrintTime.Value.ToShortDateString();
                            hs.Pnr = this.tbPnr.Text;
                            if (!hs.SubmitInfo())
                            {
                                MessageBox.Show("数据提交失败!请检查保单号是否已被使用,或网络是否正常!");
                                return;
                            }
                        }
                    }
                }
            }
            else
            {
                string btText = bt_Print.Text;
                bt_Print.Text = "验证……";
                Application.DoEvents();
                {
                    EP.WebService             epws  = new EP.WebService();
                    EP.WebServiceReturnEntity epret = new EP.WebServiceReturnEntity();
                    epret = epws.PurchaseDubang(GlobalVar2.bxUserAccount,
                                                GlobalVar2.bxPassWord,
                                                "都邦出行无忧(易格网)",                                                                             //lb公司名称.Text,
                                                DateTime.Parse(dtpBeg.Value.ToShortDateString() + " " + tbTimeBeg.Text.Trim() + ":00:00"), //DateTime.Parse(tb乘机日.Text)//七天为起保日期
                                                "7天",                                                                                      //tb航班号.Text, //七天没有航班号
                                                tbCardID.Text,                                                                             //tb证件号.Text,
                                                cbName.Text,                                                                               //cb被保险人姓名.Text,
                                                "02785777575",                                                                             //GlobalVar2.bxTelephone,//保单上无电话
                                                this.tbBeneficiary.Text,                                                                   //tb受益人关系.Text,
                                                "",                                                                                        //tb受益人资料.Text//保单上
                                                tbNo.Text
                                                );
                    if (!epret.Enabled)
                    {
                        MessageBox.Show(epret.ErrorMsg);
                        bt_Print.Text = btText;
                        return;
                    }
                    else
                    {                                               //打印
                        tbPolicyNo.Text = "微机码: " + epret.SerialNo; //微机码
                        //tb保单序号.Text = epret.CaseNo;//单证号码
                        this.tbSignature.Text = epret.AgentName;    //加盟商明称
                    }
                }
                bt_Print.Text = btText;
            }
            PrintDialog pd = new PrintDialog();

            EagleAPI.PrinterSetupCostom(ptDoc, 951, 404);
            pd.Document = ptDoc;
            //DialogResult dr = pd.ShowDialog();
            //if (dr == DialogResult.OK)
            {
                ptDoc.Print();
            }
        }
Ejemplo n.º 5
0
        private void ptDoc_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            throw new Exception("Unknown Error!");
            e.Graphics.PageUnit = GraphicsUnit.Millimeter;
            Font ptFontEn = new Font("system", 9, System.Drawing.FontStyle.Regular);
            //Font ptFontCn = new Font("tec", EagleAPI.fontsizecn, System.Drawing.FontStyle.Regular);
            Brush ptBrush = Brushes.Black;

            e.PageSettings.Margins.Left   = 0;
            e.PageSettings.Margins.Right  = 0;
            e.PageSettings.Margins.Top    = 0;
            e.PageSettings.Margins.Bottom = 0;
            PointF o = new PointF();

            o.X = float.Parse(numericUpDown1.Value.ToString());
            o.Y = float.Parse(numericUpDown2.Value.ToString());
            //打印项
            HyxStructs hs    = new HyxStructs();
            float      scale = 1F;

            if (!bLianxu)
            {
                List <string> ptString = new List <string>();
                List <PointF> ptPoint  = new List <PointF>();

                ptString.Add(this.tb保单号码.Text); ptPoint.Add(new PointF(161.5F * scale, 25.9F * scale));
                ptString.Add(this.tb保单密码.Text); ptPoint.Add(new PointF(161.5F * scale, 33.5F * scale));
                ptString.Add(this.cb被保险人姓名.Text); ptPoint.Add(new PointF(40F * scale, 39.8F * scale));
                ptString.Add(this.tb证件号.Text); ptPoint.Add(new PointF(137.4F * scale, 39.8F * scale));
                ptString.Add(this.tb航班号.Text); ptPoint.Add(new PointF(40F * scale, 47.5F * scale));
                ptString.Add(this.tb乘机日.Text); ptPoint.Add(new PointF(137.4F * scale, 47.5F * scale));
                ptString.Add(this.tb保险金额.Text); ptPoint.Add(new PointF(36.8F * scale, 55.8F * scale));
                ptString.Add(this.tb保险金额大写.Text); ptPoint.Add(new PointF(70.1F * scale, 55.8F * scale));
                ptString.Add(this.tb保险费.Text); ptPoint.Add(new PointF(117.8F * scale, 55.8F * scale));
                ptString.Add(this.tb保险费大写.Text); ptPoint.Add(new PointF(157.8F * scale, 55.8F * scale));


                ptString.Add(this.tb受益人关系.Text); ptPoint.Add(new PointF(144.7F * scale, 63.1F * scale));
                ptString.Add(this.tb受益人资料.Text); ptPoint.Add(new PointF(36.8F * scale, 69.4F * scale));//姓名
                ptString.Add(this.tb受益人地址.Text); ptPoint.Add(new PointF(36.8F * scale, 75.3F * scale));
                ptString.Add(this.tb受益人邮编.Text); ptPoint.Add(new PointF(117.8F * scale, 75.3F * scale));
                ptString.Add(this.tb报案电话.Text); ptPoint.Add(new PointF(36.8F * scale, 82.1F * scale));


                //ptString.Add(this.tb经办人.Text); ptPoint.Add(new PointF(64.2F * scale, 88.8F * scale));
                ptString.Add(this.tb填开日期.Text); ptPoint.Add(new PointF(138.4F * scale, (82.1F) * scale));

                PrintHyx.PrintHyxPublic.PrintItems(ptString.ToArray(), ptPoint.ToArray(), o, ptFontEn, ptBrush, e);
            }
            else
            {
                if (ls == null || ls.Count == 0)
                {
                    return;
                }
                //for (int i = 0; i < ls.Count; i++)
                bool bSubmited = false;
                {
                    hs.UserID           = GlobalVar.loginName;
                    hs.eNumber          = eNumberHead + DateTime.Now.Date.ToString("yyyyMMdd") + ls[iPage].Split('~')[2]; //this.tb保单号码.Text;
                    hs.IssueNumber      = ls[iPage].Split('~')[2];
                    hs.NameIssued       = ls[iPage].Split('~')[0];
                    hs.CardType         = "航班号" + tb航班号.Text + "乘机日" + tb乘机日.Text;
                    hs.CardNumber       = ls[iPage].Split('~')[1];
                    hs.Remark           = insuranceType;                                    //保险种类别名代码B0A-太平洋航意险
                    hs.IssuePeriod      = "";
                    hs.IssueBegin       = (bhyx ? tb乘机日.Text : dtp保险起始时间.Value.ToString()); //必须为时间串
                    hs.IssueEnd         = (bhyx ? tb乘机日.Text : dtp保险终止时间.Value.ToString()); //必须为时间串
                    hs.SolutionDisputed = "";
                    hs.NameBeneficiary  = tb受益人资料.Text;                                     // +tb受益人关系.Text;
                    hs.Signature        = tb报案电话.Text + tb填开单位.Text + tb经办人.Text;           // tbSignatureDate.Text;
                    hs.SignDate         = tb填开日期.Text;                                      //dtp_Date.Value.ToShortDateString();
                    hs.InssuerName      = "";
                    hs.Pnr = tbPnr.Text;
                    if (!hs.SubmitInfo())
                    {
                        MessageBox.Show(ls[iPage].Replace("~", "-") + "提交失败!");
                        bSubmited = false;
                    }
                    else
                    {
                        bSubmited = true;
                    }
                }
                {
                    if (bSubmited)
                    {
                        List <string> ptString = new List <string>();
                        List <PointF> ptPoint  = new List <PointF>();

                        ptString.Add(hs.eNumber); ptPoint.Add(new PointF(161.5F * scale, 25.9F * scale));
                        ptString.Add(this.tb保单密码.Text); ptPoint.Add(new PointF(161.5F * scale, 33.5F * scale));
                        ptString.Add(ls[iPage].Split('~')[0]); ptPoint.Add(new PointF(40F * scale, 39.8F * scale));//姓名
                        ptString.Add(this.tb证件号.Text); ptPoint.Add(new PointF(137.4F * scale, 39.8F * scale));
                        ptString.Add(this.tb航班号.Text); ptPoint.Add(new PointF(40F * scale, 47.5F * scale));
                        ptString.Add(this.tb乘机日.Text); ptPoint.Add(new PointF(137.4F * scale, 47.5F * scale));
                        ptString.Add(this.tb保险金额.Text); ptPoint.Add(new PointF(36.8F * scale, 55.8F * scale));
                        ptString.Add(this.tb保险金额大写.Text); ptPoint.Add(new PointF(70.1F * scale, 55.8F * scale));
                        ptString.Add(this.tb保险费.Text); ptPoint.Add(new PointF(117.8F * scale, 55.8F * scale));
                        ptString.Add(this.tb保险费大写.Text); ptPoint.Add(new PointF(157.8F * scale, 55.8F * scale));


                        ptString.Add(this.tb受益人关系.Text); ptPoint.Add(new PointF(144.7F * scale, 63.1F * scale));
                        ptString.Add(this.tb受益人资料.Text); ptPoint.Add(new PointF(36.8F * scale, 69.4F * scale));//姓名
                        ptString.Add(this.tb受益人地址.Text); ptPoint.Add(new PointF(36.8F * scale, 75.3F * scale));
                        ptString.Add(this.tb受益人邮编.Text); ptPoint.Add(new PointF(117.8F * scale, 75.3F * scale));
                        ptString.Add(this.tb报案电话.Text); ptPoint.Add(new PointF(36.8F * scale, 82.1F * scale));


                        //ptString.Add(this.tb经办人.Text); ptPoint.Add(new PointF(64.2F * scale, 88.8F * scale));
                        ptString.Add(this.tb填开日期.Text); ptPoint.Add(new PointF(138.4F * scale, (82.1F) * scale));


                        PrintHyx.PrintHyxPublic.PrintItems(ptString.ToArray(), ptPoint.ToArray(), o, ptFontEn, ptBrush, e);
                    }
                    iPage++;
                    if (iPage < ls.Count)
                    {
                        e.HasMorePages = true;
                    }
                    else
                    {
                        e.HasMorePages = false;
                    }
                }
            }
        }
Ejemplo n.º 6
0
        private void bt_Print_Click(object sender, EventArgs e)
        {
            bLianxu = false;
            save_phone();
            if (tbNo.Text.Trim().Length != 7)
            {
                MessageBox.Show("保单号长度错误,7位");
                return;
            }
            try
            {
                long.Parse(tbNo.Text.Trim());
            }
            catch
            {
                MessageBox.Show("保单号只能为数字");
                return;
            }
            if (cbName.Text.Trim() == "")
            {
                MessageBox.Show("姓名不能为空");
                return;
            }
            if (tbCardID.Text.Trim() == "")
            {
                MessageBox.Show("证件号码不能为空");
                return;
            }
            try
            {
                DateTime.Parse(tbDate.Text.Trim());
            }
            catch
            {
                MessageBox.Show("乘机日期格式错误,如2007-4-2");
                return;
            }
            this.tbPolicyNo.Text = System.DateTime.Now.Year.ToString().Remove(1, 1) + EagleAPI.GetRandom62();
            if (!GlobalVar.b_OffLine)
            {
                if (cbName.Text.Trim() != GlobalVar.HYXTESTPRINT)
                {
                    HyxStructs hs = new HyxStructs();
                    hs.UserID           = GlobalVar.loginName;
                    hs.eNumber          = tbPolicyNo.Text;
                    hs.IssueNumber      = tbNo.Text;
                    hs.NameIssued       = cbName.Text;
                    hs.CardType         = "航班号" + tbFlightNo.Text + "乘机日" + tbDate.Text;;
                    hs.CardNumber       = tbCardID.Text;
                    hs.Remark           = "B06";       //9"平安-周游列国"B06
                    hs.IssuePeriod      = "";
                    hs.IssueBegin       = tbDate.Text; // dtp_Start.Value.ToShortDateString() + " 00:00:00";
                    hs.IssueEnd         = tbDate.Text; // dtp_End.Value.ToShortDateString() + " 00:00:00";
                    hs.SolutionDisputed = "";
                    hs.NameBeneficiary  = tbBenefit.Text;
                    hs.Signature        = this.tbSignatureDate.Text;                      // this.tbSignatureDate.Text;
                    hs.SignDate         = this.dateTimePicker1.Value.ToShortDateString(); //dtp_Date.Value.ToShortDateString();
                    hs.InssuerName      = "";
                    hs.Pnr = this.tbPnr.Text;
                    if (!hs.SubmitInfo())
                    {
                        //MessageBox.Show("数据提交失败!请检查保单号是否已被使用,或网络是否正常!");
                        return;
                    }
                }
            }
            PrintDialog pd = new PrintDialog();

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

            //if (dr == DialogResult.OK)
            {
                ptDoc.Print();
            }
        }
Ejemplo n.º 7
0
        private void bt_Print_Click(object sender, EventArgs e)
        {
            save_phone_addr();
            if (tb_NO.Text.Trim().Length != 10)
            {
                MessageBox.Show("保单号长度错误,需10位");
                return;
            }
            try
            {
                long.Parse(tb_NO.Text.Trim());
            }
            catch
            {
                MessageBox.Show("保单号只能为数字");
                return;
            }
            if (cb_Name.Text.Trim() == "")
            {
                MessageBox.Show("姓名不能为空");
                return;
            }
            if (tb_CardNo.Text.Trim() == "")
            {
                MessageBox.Show("证件号码不能为空");
                return;
            }
            this.tb_RandomNo.Text = System.DateTime.Now.Year.ToString().Remove(1, 1) + EagleAPI.GetRandom62();
            if (!GlobalVar.b_OffLine)
            {
                if (cb_Name.Text != GlobalVar.HYXTESTPRINT)
                {
                    HyxStructs hs = new HyxStructs();
                    hs.UserID           = GlobalVar.loginName;
                    hs.eNumber          = tb_RandomNo.Text;
                    hs.IssueNumber      = tb_NO.Text;
                    hs.NameIssued       = cb_Name.Text;
                    hs.CardType         = "航班号" + tbFlightNo.Text + "乘机日" + tbFlightDate.Text;
                    hs.CardNumber       = tb_CardNo.Text;
                    hs.Remark           = "B01";//5"华安交通意外伤害保险";B01
                    hs.IssuePeriod      = "";
                    hs.IssueBegin       = dtp_Start.Value.ToShortDateString() + " 00:00:00";
                    hs.IssueEnd         = dtp_End.Value.ToShortDateString() + " 00:00:00";
                    hs.SolutionDisputed = "";
                    hs.NameBeneficiary  = tb_Benefit.Text;
                    hs.Signature        = this.tb_Signature.Text;
                    hs.SignDate         = dtp_Date.Value.ToShortDateString();
                    hs.InssuerName      = "";
                    hs.Pnr = this.tb_PNR.Text;
                    if (!hs.SubmitInfo())
                    {
                        MessageBox.Show("数据提交失败!请检查保单号是否已被使用,或网络是否正常!");
                        return;
                    }
                }
            }

            PrintDialog pd = new PrintDialog();

            pd.Document = ptDoc;
            DialogResult dr = pd.ShowDialog();

            if (dr == DialogResult.OK)
            {
                ptDoc.Print();
            }
        }
Ejemplo n.º 8
0
        private void ptDoc_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            e.Graphics.PageUnit = GraphicsUnit.Millimeter;
            Font ptFontEn = new Font("system", 9, System.Drawing.FontStyle.Regular);
            //Font ptFontCn = new Font("tec", EagleAPI.fontsizecn, System.Drawing.FontStyle.Regular);
            Brush ptBrush = Brushes.Black;

            e.PageSettings.Margins.Left   = 0;
            e.PageSettings.Margins.Right  = 0;
            e.PageSettings.Margins.Top    = 0;
            e.PageSettings.Margins.Bottom = 0;
            PointF o = new PointF();

            o.X = float.Parse(numericUpDown1.Value.ToString());
            o.Y = float.Parse(numericUpDown2.Value.ToString());
            //打印项
            HyxStructs hs    = new HyxStructs();
            float      scale = 2360F / 2466F;

            if (!bLianxu)
            {
                List <string> ptString = new List <string>();
                List <PointF> ptPoint  = new List <PointF>();
                ptString.Add(this.cb险种条款.Text); ptPoint.Add(new PointF(59.7F * scale, 20.6F * scale));
                ptString.Add(this.tb保单号码.Text); ptPoint.Add(new PointF(164.9F * scale, 20.6F * scale));
                ptString.Add(this.cb被保险人姓名.Text); ptPoint.Add(new PointF(59.7F * scale, 27.5F * scale));
                ptString.Add(this.cb证件类型.Text + this.tb证件号.Text); ptPoint.Add(new PointF(148.2F * scale, 27.5F * scale));
                ptString.Add(this.tb航班号.Text); ptPoint.Add(new PointF(59.7F * scale, 34.7F * scale));
                ptString.Add(this.tb乘机日.Text); ptPoint.Add(new PointF(131.2F * scale, 34.7F * scale));
                ptString.Add(this.tb保险金额.Text); ptPoint.Add(new PointF(40.7F * scale, 50.4F * scale));
                ptString.Add(this.tb保险费.Text); ptPoint.Add(new PointF(131.2F * scale, 41.5F * scale));
                ptString.Add(this.dtp保险起始时间.Value.ToShortDateString() + " " + tb保险起始时间.Text); ptPoint.Add(new PointF(49.5F * scale, 72.9F * scale));
                ptString.Add(this.dtp保险终止时间.Value.ToShortDateString() + " " + tb保险终止时间.Text); ptPoint.Add(new PointF(120.0F * scale, 72.9F * scale));
                ptString.Add(this.tb受益人关系.Text); ptPoint.Add(new PointF(105.3F * scale, 80.5F * scale));
                ptString.Add(this.tb受益人资料.Text); ptPoint.Add(new PointF(83.3F * scale, 85.7F * scale));
                ptString.Add(this.tb填开单位.Text); ptPoint.Add(new PointF(46.9F * scale, 93.9F * scale));
                ptString.Add(this.tb填开日期.Text); ptPoint.Add(new PointF(126.2F * scale, 93.9F * scale));
                ptString.Add(this.tb经办人.Text); ptPoint.Add(new PointF(187.2F * scale, 93.9F * scale));


                PrintHyx.PrintHyxPublic.PrintItems(ptString.ToArray(), ptPoint.ToArray(), o, ptFontEn, ptBrush, e);
            }
            else
            {
                if (ls == null || ls.Count == 0)
                {
                    return;
                }
                //for (int i = 0; i < ls.Count; i++)
                bool bSubmited = false;
                {
                    hs.UserID           = GlobalVar.loginName;
                    hs.eNumber          = eNumberHead + EagleAPI.GetRandom62(); //this.tb保单号码.Text;
                    hs.IssueNumber      = ls[iPage].Split('~')[2];
                    hs.NameIssued       = ls[iPage].Split('~')[0];
                    hs.CardType         = "航班号" + tb航班号.Text + "乘机日" + tb乘机日.Text;
                    hs.CardNumber       = ls[iPage].Split('~')[1];
                    hs.Remark           = insuranceType;                                    //保险种类别名代码B07
                    hs.IssuePeriod      = "";
                    hs.IssueBegin       = (bhyx ? tb乘机日.Text : dtp保险起始时间.Value.ToString()); //必须为时间串
                    hs.IssueEnd         = (bhyx ? tb乘机日.Text : dtp保险终止时间.Value.ToString()); //必须为时间串
                    hs.SolutionDisputed = "";
                    hs.NameBeneficiary  = tb受益人资料.Text + tb受益人关系.Text;
                    hs.Signature        = tb经办人.Text;  // tbSignatureDate.Text;
                    hs.SignDate         = tb填开日期.Text; //dtp_Date.Value.ToShortDateString();
                    hs.InssuerName      = "";
                    hs.Pnr = tbPnr.Text;
                    if (!hs.SubmitInfo())
                    {
                        MessageBox.Show(ls[iPage].Replace("~", "-") + "提交失败!");
                        bSubmited = false;
                    }
                    else
                    {
                        bSubmited = true;
                    }
                }
                {
                    if (bSubmited)
                    {
                        List <string> ptString = new List <string>();
                        List <PointF> ptPoint  = new List <PointF>();
                        //ptString.Add(this.tb保单序号.Text); ptPoint.Add(new PointF(185F, 31F));
                        //ptString.Add(ls[iPage].Split('~')[0]); ptPoint.Add(new PointF(57.1F, 39F));
                        //ptString.Add(ls[iPage].Split('~')[1]); ptPoint.Add(new PointF(155F, 39F));
                        //ptString.Add(tb航班号.Text); ptPoint.Add(new PointF(57.1F, 50F));
                        //ptString.Add(tb乘机日.Text); ptPoint.Add(new PointF(155F, 50F));
                        //ptString.Add(tb航班号.Text); ptPoint.Add(new PointF(131.8F, 72.4F));
                        //ptString.Add(tb航班号.Text); ptPoint.Add(new PointF(47F, 72.4F));
                        ////ptString.Add(tbPhone.Text); ptPoint.Add(new PointF(44F, 90F));
                        //ptString.Add(tb航班号.Value.ToShortDateString()); ptPoint.Add(new PointF(106.4F, 84.3F));
                        //ptString.Add(tb航班号.Text); ptPoint.Add(new PointF(183.1F, 84.3F));
                        ptString.Add(this.cb险种条款.Text); ptPoint.Add(new PointF(59.7F * scale, 20.6F * scale));
                        ptString.Add(hs.eNumber); ptPoint.Add(new PointF(164.9F * scale, 20.6F * scale));
                        ptString.Add(ls[iPage].Split('~')[0]); ptPoint.Add(new PointF(59.7F * scale, 27.5F * scale));
                        ptString.Add(this.cb证件类型.Text + ls[iPage].Split('~')[1]); ptPoint.Add(new PointF(148.2F * scale, 27.5F * scale));
                        ptString.Add(this.tb航班号.Text); ptPoint.Add(new PointF(59.7F * scale, 34.7F * scale));
                        ptString.Add(this.tb乘机日.Text); ptPoint.Add(new PointF(131.2F * scale, 34.7F * scale));
                        ptString.Add(this.tb保险金额.Text); ptPoint.Add(new PointF(40.7F * scale, 50.4F * scale));
                        ptString.Add(this.tb保险费.Text); ptPoint.Add(new PointF(131.2F * scale, 41.5F * scale));
                        ptString.Add(this.dtp保险起始时间.Value.ToShortDateString() + " " + tb保险起始时间.Text); ptPoint.Add(new PointF(49.5F * scale, 72.9F * scale));
                        ptString.Add(this.dtp保险终止时间.Value.ToShortDateString() + " " + tb保险终止时间.Text); ptPoint.Add(new PointF(120.0F * scale, 72.9F * scale));
                        ptString.Add(this.tb受益人关系.Text); ptPoint.Add(new PointF(105.3F * scale, 80.5F * scale));
                        ptString.Add(this.tb受益人资料.Text); ptPoint.Add(new PointF(83.3F * scale, 85.7F * scale));
                        ptString.Add(this.tb填开单位.Text); ptPoint.Add(new PointF(46.9F * scale, 93.9F * scale));
                        ptString.Add(this.tb填开日期.Text); ptPoint.Add(new PointF(126.2F * scale, 93.9F * scale));
                        ptString.Add(this.tb经办人.Text); ptPoint.Add(new PointF(187.2F * scale, 93.9F * scale));

                        PrintHyx.PrintHyxPublic.PrintItems(ptString.ToArray(), ptPoint.ToArray(), o, ptFontEn, ptBrush, e);
                    }
                    iPage++;
                    if (iPage < ls.Count)
                    {
                        e.HasMorePages = true;
                    }
                    else
                    {
                        e.HasMorePages = false;
                    }
                }
            }
        }
Ejemplo n.º 9
0
        private void bt_Print_Click(object sender, EventArgs e)
        {
            save_phone();
            if (tbNo.Text.Trim().Length != 16)
            {
                MessageBox.Show("保单号长度错误");
                return;
            }
            try
            {
                long.Parse(tbNo.Text.Trim());
            }
            catch
            {
                MessageBox.Show("保单号只能为数字");
                return;
            }
            if (cbName.Text.Trim() == "")
            {
                MessageBox.Show("姓名不能为空");
                return;
            }
            if (tbCardID.Text.Trim() == "")
            {
                MessageBox.Show("证件号码不能为空");
                return;
            }

            this.tbPolicyNo.Text = this.eNumberHead + "0" + tbNo.Text.Trim().Substring(8, 8);
            if (!GlobalVar.b_OffLine)
            {
                if (cbName.Text.Trim() != GlobalVar.HYXTESTPRINT)
                {
                    HyxStructs hs = new HyxStructs();
                    hs.UserID           = GlobalVar.loginName;
                    hs.eNumber          = tbPolicyNo.Text;
                    hs.IssueNumber      = tbNo.Text;
                    hs.NameIssued       = cbName.Text;
                    hs.CardType         = "航班号" + tbFlightNo.Text + "乘机日" + tbDate.Text;;
                    hs.CardNumber       = tbCardID.Text;
                    hs.Remark           = "B03";                                   //7"都险航翼网";B03
                    hs.IssuePeriod      = "";
                    hs.IssueBegin       = System.DateTime.Now.ToShortDateString(); // dtp_Start.Value.ToShortDateString() + " 00:00:00";
                    hs.IssueEnd         = System.DateTime.Now.ToShortDateString(); // dtp_End.Value.ToShortDateString() + " 00:00:00";
                    hs.SolutionDisputed = "";
                    hs.NameBeneficiary  = this.tbBeneficiary.Text;
                    hs.Signature        = tbSignature.Text;      // this.tbSignatureDate.Text;
                    hs.SignDate         = this.tbPrintTime.Text; //dtp_Date.Value.ToShortDateString();
                    hs.InssuerName      = "";
                    hs.Pnr = this.tbPnr.Text;
                    if (!hs.SubmitInfo())
                    {
                        MessageBox.Show("数据提交失败!请检查保单号是否已被使用,或网络是否正常!");
                        return;
                    }
                }
            }
            PrintDialog pd = new PrintDialog();

            pd.Document = ptDoc;
            DialogResult dr = pd.ShowDialog();

            if (dr == DialogResult.OK)
            {
                ptDoc.Print();
            }
        }
Ejemplo n.º 10
0
        private void ptDoc_PrintPage_新华(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            getTitleOffset();
            e.Graphics.PageUnit = GraphicsUnit.Millimeter;
            Font ptFontEn = new Font("system", 9, System.Drawing.FontStyle.Regular);
            //Font ptFontCn = new Font("tec", EagleAPI.fontsizecn, System.Drawing.FontStyle.Regular);
            Brush ptBrush = Brushes.Black;

            e.PageSettings.Margins.Left   = 0;
            e.PageSettings.Margins.Right  = 0;
            e.PageSettings.Margins.Top    = 0;
            e.PageSettings.Margins.Bottom = 0;
            PointF o = new PointF();

            o.X = float.Parse(numericUpDown1.Value.ToString());
            o.Y = float.Parse(numericUpDown2.Value.ToString());
            //打印项
            HyxStructs hs    = new HyxStructs();
            float      scale = 1F;

            if (!bLianxu)
            {
                List <string> ptString = new List <string>();
                List <PointF> ptPoint  = new List <PointF>();
                //新华人寿保险股份有限公司意外伤害保险承保告知单
                //本卡含意外伤害保险一份,保险查询请登陆http://www.eg66.com

                ptString.Add(this.tb保单号码.Text); ptPoint.Add(new PointF(60.3F * scale, 29.2F * scale));

                ptString.Add(this.tb证件号.Text); ptPoint.Add(new PointF(148.2F * scale, 37.7F * scale));
                ptString.Add(this.tb航班号.Text); ptPoint.Add(new PointF(60.3F * scale, 46.8F * scale));
                ptString.Add(this.tb乘机日.Text); ptPoint.Add(new PointF(148.2F * scale, 46.8F * scale));


                ptString.Add(this.tb受益人关系.Text); ptPoint.Add(new PointF(92.6F * scale, 67.5F * scale));
                ptString.Add(this.tb受益人资料.Text); ptPoint.Add(new PointF(92.6F * scale, 74.6F * scale));
                ptString.Add(this.textBox1.Text); ptPoint.Add(new PointF(128.3F * scale, 67.5F * scale));//电话号码
                ptString.Add(this.tb经办人.Text); ptPoint.Add(new PointF(64.2F * scale, 88.8F * scale));
                ptString.Add(this.tb填开日期.Text); ptPoint.Add(new PointF(167.6F * scale, (88.8F) * scale));
                if (GlobalVar2.bTempus)
                {
                    ptString.Add("本卡含意外伤害保险一份,保险查询请登陆HTTP://WWW.EG66.COM");
                    ptPoint.Add(new PointF(32.0F * scale, 83.9F * scale));
                }
                else
                {
                    ptString.Add("本卡含意外伤害保险一份,保险查询请登陆HTTP://WWW.EG66.COM");
                    ptPoint.Add(new PointF(32.0F * scale, 83.9F * scale));
                }
                //ptString.Add(this.tb填开日期.Text); ptPoint.Add(new PointF(133.7F * scale, (74.5F) * scale));
                //ptString.Add(this.tb经办人.Text); ptPoint.Add(new PointF(51.1F * scale, (79.9F + 5F) * scale));

                ptString.Add(this.tb保单序号.Text); ptPoint.Add(new PointF(137.8F * scale, 28.4F * scale));
                PrintHyx.PrintHyxPublic.PrintItems(ptString.ToArray(), ptPoint.ToArray(), o, ptFontEn, ptBrush, e);

                ptString.Clear(); ptPoint.Clear();
                ptString.Add(this.cb被保险人姓名.Text); ptPoint.Add(new PointF(60.3F * scale, 37.7F * scale));
                ptString.Add(this.tb保险金额.Text); ptPoint.Add(new PointF(60.3F * scale, 55.5F * scale));
                ptString.Add(this.tb保险费.Text); ptPoint.Add(new PointF(148.2F * scale, 55.5F * scale));
                PrintHyx.PrintHyxPublic.PrintItems(ptString.ToArray(), ptPoint.ToArray(), o, new Font("System", 10.5F), ptBrush, e);
                if (cbPrintTitle.Checked)
                {
                    StringFormat sf = new StringFormat();
                    sf.Alignment     = StringAlignment.Center;
                    sf.LineAlignment = StringAlignment.Near;
                    e.Graphics.DrawString(this.lb公司名称.Text, new Font("System", 15), Brushes.Black,
                                          new RectangleF(15.5F + titleOffset.X, 4.5F + titleOffset.Y, 209.9F + titleOffset.X, 9.2F + titleOffset.Y), sf);
                }
            }
            else
            {
                if (ls == null || ls.Count == 0)
                {
                    return;
                }
                //for (int i = 0; i < ls.Count; i++)
                bool bSubmited = false;
                {
                    hs.UserID           = GlobalVar.loginName;
                    hs.eNumber          = eNumberHead + DateTime.Now.Date.ToString("yyyyMMdd") + ls[iPage].Split('~')[2]; //this.tb保单号码.Text;
                    hs.IssueNumber      = ls[iPage].Split('~')[2];
                    hs.NameIssued       = ls[iPage].Split('~')[0];
                    hs.CardType         = "航班号" + tb航班号.Text + "乘机日" + tb乘机日.Text;
                    hs.CardNumber       = ls[iPage].Split('~')[1];
                    hs.Remark           = insuranceType;                                    //保险种类别名代码B09-易格会员卡
                    hs.IssuePeriod      = "";
                    hs.IssueBegin       = (bhyx ? tb乘机日.Text : dtp保险起始时间.Value.ToString()); //必须为时间串
                    hs.IssueEnd         = (bhyx ? tb乘机日.Text : dtp保险终止时间.Value.ToString()); //必须为时间串
                    hs.SolutionDisputed = "";
                    hs.NameBeneficiary  = tb受益人资料.Text;                                     // +tb受益人关系.Text;
                    hs.Signature        = tb填开单位.Text + tb经办人.Text;                         // tbSignatureDate.Text;
                    hs.SignDate         = tb填开日期.Text;                                      //dtp_Date.Value.ToShortDateString();
                    hs.InssuerName      = "";
                    hs.Pnr = tbPnr.Text;
                    if (!hs.SubmitInfo())
                    {
                        MessageBox.Show(ls[iPage].Replace("~", "-") + "提交失败!");
                        bSubmited = false;
                    }
                    else
                    {
                        bSubmited = true;
                    }
                }
                {
                    if (bSubmited)
                    {
                        List <string> ptString = new List <string>();
                        List <PointF> ptPoint  = new List <PointF>();

                        ptString.Add(hs.eNumber); ptPoint.Add(new PointF(60.3F * scale, 29.2F * scale));

                        ptString.Add(this.tb证件号.Text); ptPoint.Add(new PointF(148.2F * scale, 37.7F * scale));
                        ptString.Add(this.tb航班号.Text); ptPoint.Add(new PointF(60.3F * scale, 46.8F * scale));
                        ptString.Add(this.tb乘机日.Text); ptPoint.Add(new PointF(148.2F * scale, 46.8F * scale));


                        ptString.Add(this.tb受益人关系.Text); ptPoint.Add(new PointF(92.6F * scale, 67.5F * scale));
                        ptString.Add(this.tb受益人资料.Text); ptPoint.Add(new PointF(92.6F * scale, 74.6F * scale));
                        ptString.Add(this.textBox1.Text); ptPoint.Add(new PointF(128.3F * scale, 67.5F * scale));
                        ptString.Add(this.tb经办人.Text); ptPoint.Add(new PointF(64.2F * scale, 88.8F * scale));
                        ptString.Add(this.tb填开日期.Text); ptPoint.Add(new PointF(167.6F * scale, (88.8F) * scale));
                        if (GlobalVar2.bTempus)
                        {
                            ptString.Add("本卡含意外伤害保险一份,保险查询请登陆HTTP://WWW.EG66.COM");
                            ptPoint.Add(new PointF(32.0F * scale, 83.9F * scale));
                        }
                        else
                        {
                            ptString.Add("本卡含意外伤害保险一份,保险查询请登陆HTTP://WWW.EG66.COM");
                            ptPoint.Add(new PointF(32.0F * scale, 83.9F * scale));
                        }
                        ptString.Add("HBSX" + this.tb保单序号.Text); ptPoint.Add(new PointF(137.8F * scale, 28.4F * scale));
                        PrintHyx.PrintHyxPublic.PrintItems(ptString.ToArray(), ptPoint.ToArray(), o, ptFontEn, ptBrush, e);

                        ptString.Clear(); ptPoint.Clear();
                        ptString.Add(ls[iPage].Split('~')[0]); ptPoint.Add(new PointF(60.3F * scale, 37.7F * scale));
                        ptString.Add(this.tb保险金额.Text); ptPoint.Add(new PointF(60.3F * scale, 55.5F * scale));
                        ptString.Add(this.tb保险费.Text); ptPoint.Add(new PointF(148.2F * scale, 55.5F * scale));
                        PrintHyx.PrintHyxPublic.PrintItems(ptString.ToArray(), ptPoint.ToArray(), o, new Font("System", 10.5F), ptBrush, e);
                        if (cbPrintTitle.Checked)
                        {
                            StringFormat sf = new StringFormat();
                            sf.Alignment     = StringAlignment.Center;
                            sf.LineAlignment = StringAlignment.Near;
                            e.Graphics.DrawString(this.lb公司名称.Text, new Font("System", 15), Brushes.Black,
                                                  new RectangleF(15.5F + titleOffset.X, 4.5F + titleOffset.Y, 209.9F + titleOffset.X, 9.2F + titleOffset.Y), sf);
                        }
                    }
                    iPage++;
                    if (iPage < ls.Count)
                    {
                        e.HasMorePages = true;
                    }
                    else
                    {
                        e.HasMorePages = false;
                    }
                }
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 姓名:65.1,26.7 / 证件:159.2,26.7 / 电话:65.1,36.2 / 微机码:159.2,36.2 / 会员费65.1,45.5 / 其它(航班+日期):159.2,45.5
        /// 金额:65.1,64.2 / 在效:159.2,64.2 / 经办+日期:65.1,73.5 / 承保号:159.2,73.5
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ptDoc_PrintPage_PICC(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            e.Graphics.PageUnit = GraphicsUnit.Millimeter;
            Font ptFontEn = new Font("system", 11, System.Drawing.FontStyle.Regular);
            //Font ptFontCn = new Font("tec", EagleAPI.fontsizecn, System.Drawing.FontStyle.Regular);
            Brush ptBrush = Brushes.Black;

            e.PageSettings.Margins.Left   = 0;
            e.PageSettings.Margins.Right  = 0;
            e.PageSettings.Margins.Top    = 0;
            e.PageSettings.Margins.Bottom = 0;
            PointF o = new PointF();

            o.X = float.Parse(numericUpDown1.Value.ToString());
            o.Y = float.Parse(numericUpDown2.Value.ToString());
            //打印项
            HyxStructs hs    = new HyxStructs();
            float      scale = 1F;

            if (!bLianxu)//单张打印
            {
                List <string> ptString = new List <string>();
                List <PointF> ptPoint  = new List <PointF>();
                ptString.Add("PICC中保财险 旅行意外网上承保告知单"); ptPoint.Add(new PointF(159.2F * scale, 6.7F * scale));
                ptString.Add(this.cb被保险人姓名.Text); ptPoint.Add(new PointF(65.1F * scale, 26.7F * scale));
                ptString.Add(this.tb证件号.Text); ptPoint.Add(new PointF(159.2F * scale, 26.7F * scale));
                ptString.Add(this.textBox1.Text); ptPoint.Add(new PointF(65.1F * scale, 36.2F * scale)); //电话号码
                ptString.Add(this.tb保单号码.Text); ptPoint.Add(new PointF(159.2F * scale, 36.2F * scale));  //微机码
                ptString.Add(this.cbPrice.Text); ptPoint.Add(new PointF(65.1F * scale, 45.5F * scale));  //会员费


                ptString.Add(this.tb航班号.Text + "  " + this.tb乘机日.Text); ptPoint.Add(new PointF(159.2F * scale, 45.5F * scale));
                ptString.Add(this.tb保险金额.Text); ptPoint.Add(new PointF(65.1F * scale, 64.2F * scale)); //
                ptString.Add("7日内有效,限当次航班"); ptPoint.Add(new PointF(129.2F * scale, 64.2F * scale));   //
                ptString.Add(this.tb经办人.Text + "  " + this.tb填开日期.Text); ptPoint.Add(new PointF(65.1F * scale, 73.3F * scale));

                //ptString.Add(this.tb保单序号.Text); ptPoint.Add(new PointF(159.2F * scale, 73.3F * scale));
                PrintHyx.PrintHyxPublic.PrintItems(ptString.ToArray(), ptPoint.ToArray(), o, ptFontEn, ptBrush, e);
            }
            else//连续打印
            {
                MessageBox.Show("不支持连续打印");//下面的HS是提交的后台管理系统,并非易格保险系统
                return;

                if (ls == null || ls.Count == 0)
                {
                    return;
                }
                //for (int i = 0; i < ls.Count; i++)
                bool bSubmited = false;
                {
                    hs.UserID           = GlobalVar.loginName;
                    hs.eNumber          = eNumberHead + DateTime.Now.Date.ToString("yyyyMMdd") + ls[iPage].Split('~')[2]; //this.tb保单号码.Text;
                    hs.IssueNumber      = ls[iPage].Split('~')[2];
                    hs.NameIssued       = ls[iPage].Split('~')[0];
                    hs.CardType         = "航班号" + tb航班号.Text + "乘机日" + tb乘机日.Text;
                    hs.CardNumber       = ls[iPage].Split('~')[1];
                    hs.Remark           = insuranceType;                                    //保险种类别名代码B09-易格会员卡
                    hs.IssuePeriod      = "";
                    hs.IssueBegin       = (bhyx ? tb乘机日.Text : dtp保险起始时间.Value.ToString()); //必须为时间串
                    hs.IssueEnd         = (bhyx ? tb乘机日.Text : dtp保险终止时间.Value.ToString()); //必须为时间串
                    hs.SolutionDisputed = "";
                    hs.NameBeneficiary  = tb受益人资料.Text;                                     // +tb受益人关系.Text;
                    hs.Signature        = tb填开单位.Text + tb经办人.Text;                         // tbSignatureDate.Text;
                    hs.SignDate         = tb填开日期.Text;                                      //dtp_Date.Value.ToShortDateString();
                    hs.InssuerName      = "";
                    hs.Pnr = tbPnr.Text;
                    if (!hs.SubmitInfo())
                    {
                        MessageBox.Show(ls[iPage].Replace("~", "-") + "提交失败!");
                        bSubmited = false;
                    }
                    else
                    {
                        bSubmited = true;
                    }
                }
                {
                    if (bSubmited)
                    {
                        List <string> ptString = new List <string>();
                        List <PointF> ptPoint  = new List <PointF>();

                        ptString.Add(hs.eNumber); ptPoint.Add(new PointF(60.3F * scale, 29.2F * scale));

                        ptString.Add(this.tb证件号.Text); ptPoint.Add(new PointF(148.2F * scale, 37.7F * scale));
                        ptString.Add(this.tb航班号.Text); ptPoint.Add(new PointF(60.3F * scale, 46.8F * scale));
                        ptString.Add(this.tb乘机日.Text); ptPoint.Add(new PointF(148.2F * scale, 46.8F * scale));


                        ptString.Add(this.tb受益人关系.Text); ptPoint.Add(new PointF(92.6F * scale, 67.5F * scale));
                        ptString.Add(this.tb受益人资料.Text); ptPoint.Add(new PointF(92.6F * scale, 74.6F * scale));
                        ptString.Add(this.textBox1.Text); ptPoint.Add(new PointF(128.3F * scale, 67.5F * scale));
                        ptString.Add(this.tb经办人.Text); ptPoint.Add(new PointF(64.2F * scale, 88.8F * scale));
                        ptString.Add(this.tb填开日期.Text); ptPoint.Add(new PointF(167.6F * scale, (88.8F) * scale));

                        ptString.Add("HBSX" + this.tb保单序号.Text); ptPoint.Add(new PointF(137.8F * scale, 28.4F * scale));
                        PrintHyx.PrintHyxPublic.PrintItems(ptString.ToArray(), ptPoint.ToArray(), o, ptFontEn, ptBrush, e);

                        ptString.Clear(); ptPoint.Clear();
                        ptString.Add(ls[iPage].Split('~')[0]); ptPoint.Add(new PointF(60.3F * scale, 37.7F * scale));
                        ptString.Add(this.tb保险金额.Text); ptPoint.Add(new PointF(60.3F * scale, 55.5F * scale));
                        ptString.Add(this.tb保险费.Text); ptPoint.Add(new PointF(148.2F * scale, 55.5F * scale));
                        PrintHyx.PrintHyxPublic.PrintItems(ptString.ToArray(), ptPoint.ToArray(), o, new Font("System", 10.5F), ptBrush, e);
                    }
                    iPage++;
                    if (iPage < ls.Count)
                    {
                        e.HasMorePages = true;
                    }
                    else
                    {
                        e.HasMorePages = false;
                    }
                }
            }
        }
Ejemplo n.º 12
0
        private void bt_Print_Click(object sender, EventArgs e)
        {
            if (dtp保险起始时间.Value < DateTime.Today)
            {
                MessageBox.Show("保险起始日期不能早于今日!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            try
            {
                if (DateTime.Parse(tb乘机日.Text.Trim()) < DateTime.Today)
                {
                    MessageBox.Show("乘机日期不能早于当前日期!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
            }
            catch
            {
                MessageBox.Show("乘机日期填写格式有误,请核对!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (bLastString == cb被保险人姓名.Text && cb被保险人姓名.Text != "")
            {
                if (MessageBox.Show(bLastString + "->已经打印,是否再打印一张?", "警告", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }
            }
            //bt_Print.Enabled = false;
            Application.DoEvents();
            try
            {
                bLianxu = false;
                try
                {
                    save_cfg();
                }
                catch (Exception ee)
                {
                    MessageBox.Show(ee.Message + "save_cfg()");
                }
                if (insuranceNumberLength == 0)
                {
                    MessageBox.Show("未设置对应险种的保单序号长度insuranceNumberLength");
                    return;
                }
                if (tb保单序号.Text.Trim().Length != insuranceNumberLength)
                {
                    if (insuranceType == "B09" || insuranceType == "B0D")
                    {
                        ;
                    }
                    else
                    {
                        MessageBox.Show("保单序号长度错误," + insuranceNumberLength.ToString() + "位");
                        return;
                    }
                }
                try
                {
                    long.Parse(tb保单序号.Text.Trim());
                }
                catch
                {
                    if ((insuranceType == "B09") || (insuranceType == "B0D"))
                    {
                        ;
                    }
                    else
                    {
                        MessageBox.Show("保单序号只能为数字");

                        return;
                    }
                }
                if (cb被保险人姓名.Text.Trim() == "")
                {
                    MessageBox.Show("姓名不能为空");
                    return;
                }
                if (tb证件号.Text.Trim() == "")
                {
                    MessageBox.Show("证件号码不能为空");
                    return;
                }
                try
                {
                    DateTime dtTemp = DateTime.Parse(tb乘机日.Text.Trim());
                    if (dtTemp.Year != DateTime.Now.Year)
                    {
                        if (MessageBox.Show("乘机日期:" + tb乘机日.Text + "   请确认!", "注意", MessageBoxButtons.OKCancel) != DialogResult.OK)
                        {
                            return;
                        }
                    }
                }
                catch
                {
                    if (bhyx)
                    {
                        MessageBox.Show("乘机日期格式错误,如2007-4-2");
                        return;
                    }
                }
                tb保单号码.Text = eNumberHead + EagleAPI.GetRandom62();
                if (insuranceType == "B08")
                {
                    tb保单号码.Text = eNumberHead + DateTime.Now.Date.ToString("yyyyMMdd") + tb保单序号.Text;
                }
                if (paperHeight == 0 || paperWidth == 0)
                {
                    MessageBox.Show("未设置打印纸的宽与高paperHeight,paperWidth");
                    return;
                }
                if (!GlobalVar.b_OffLine)
                {
                    if (cb被保险人姓名.Text.Trim() != GlobalVar.HYXTESTPRINT)
                    {
                        HyxStructs hs = new HyxStructs();
                        hs.UserID           = GlobalVar.loginName;
                        hs.eNumber          = tb保单号码.Text;
                        hs.IssueNumber      = tb保单序号.Text;
                        hs.NameIssued       = cb被保险人姓名.Text;
                        hs.CardType         = "航班号" + tb航班号.Text + "乘机日" + tb乘机日.Text;;
                        hs.CardNumber       = tb证件号.Text;
                        hs.Remark           = insuranceType;                                    //保险种类别名代码B06
                        hs.IssuePeriod      = "";
                        hs.IssueBegin       = (bhyx ? tb乘机日.Text : dtp保险起始时间.Value.ToString()); //必须为时间串
                        hs.IssueEnd         = (bhyx ? tb乘机日.Text : dtp保险终止时间.Value.ToString()); //必须为时间串
                        hs.SolutionDisputed = "";
                        hs.NameBeneficiary  = tb受益人资料.Text + tb受益人关系.Text;
                        hs.Signature        = tb经办人.Text;  // tbSignatureDate.Text;
                        hs.SignDate         = tb填开日期.Text; //dtp_Date.Value.ToShortDateString();
                        hs.InssuerName      = "";
                        hs.Pnr = tbPnr.Text;

                        bSubmitting   = true;
                        bt_Print.Text = "提交中………………请稍等";
                        Application.DoEvents();
                        //while (this.insuranceType=="B07" && GlobalVar.serverAddr== GlobalVar.ServerAddr.HangYiWang)
                        //{
                        //    try
                        //    {
                        //        string ddd = "adksfj";
                        //        DateTime eee = DateTime.Parse(ddd);
                        //    }
                        //    catch (Exception ex)
                        //    {
                        //        MessageBox.Show(ex.Message);
                        //    }
                        //}
                        if (insuranceType == "B09" || insuranceType == "B0D")
                        {
                            EagleWebService.wsKernal ws = new EagleWebService.wsKernal(GlobalVar.WebServer);
                            NewPara np = new NewPara();
                            np.AddPara("cm", "SubmitEagleIns");
                            np.AddPara("UserAccount", "testaccount");
                            np.AddPara("UserPassword", "testpassword");
                            np.AddPara("CardIdNumber", "身份证号");
                            np.AddPara("FlightNumber", "航班号");
                            np.AddPara("FlightDate", "乘机日");
                            np.AddPara("BenefitRelation", "受益人关系");
                            np.AddPara("BenefitZiliao", "受益人资料");
                            np.AddPara("Telephone", "电话号码");
                            np.AddPara("Name", "被保险人名");
                            np.AddPara("PrintHead", "台头" + insuranceType);


                            string                    strReq = np.GetXML();
                            string                    strRet = ws.getEgSoap(strReq);
                            EP.WebService             epws   = new EP.WebService();
                            EP.WebServiceReturnEntity epret  = new EP.WebServiceReturnEntity();
                            if (insuranceType == "B09")
                            {
                                epret = epws.Purchase(GlobalVar2.bxUserAccount, GlobalVar2.bxPassWord,
                                                      lb公司名称.Text,
                                                      DateTime.Parse(tb乘机日.Text), tb航班号.Text, tb证件号.Text, cb被保险人姓名.Text, GlobalVar2.bxTelephone,
                                                      tb受益人关系.Text, tb受益人资料.Text);
                            }
                            else
                            {
                                epret = epws.PurchasePICC(GlobalVar2.bxUserAccount, GlobalVar2.bxPassWord,
                                                          lb公司名称.Text,
                                                          DateTime.Parse(tb乘机日.Text), tb航班号.Text, tb证件号.Text, cb被保险人姓名.Text, GlobalVar2.bxTelephone,
                                                          tb受益人关系.Text, tb受益人资料.Text);
                            }
                            bt_Print.Text = "打印(&P)";
                            if (!epret.Enabled)
                            {
                                MessageBox.Show(epret.ErrorMsg);
                                return;
                            }
                            else
                            {                                  //打印
                                tb保单号码.Text = epret.SerialNo;  //微机码
                                tb保单序号.Text = epret.CaseNo;    //单证号码
                                tb经办人.Text  = epret.AgentName; //加盟商明称
                            }
                        }
                        else
                        {
                            if (!hs.SubmitInfo())
                            {
                                bSubmitting   = false;
                                bt_Print.Text = "打印(&P)";
                                //MessageBox.Show("数据提交失败!请检查保单号是否已被使用,或网络是否正常!");
                                return;
                            }
                        }
                        bt_Print.Text = "打印(&P)";
                        bSubmitting   = false;
                    }
                }
                PrintDialog pd = new PrintDialog();
                EagleAPI.PrinterSetupCostom(ptDoc, paperWidth, paperHeight);
                pd.Document = ptDoc;
                //DialogResult dr = pd.ShowDialog();

                //if (dr == DialogResult.OK)
                {
                    ptDoc.Print();
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
            }
            bLastString      = cb被保险人姓名.Text;
            bt_Print.Enabled = true;
        }
Ejemplo n.º 13
0
        private void bt_Print_Click(object sender, EventArgs e)
        {
            #region 判断是否符合打印条件
            if (!EagleAPI.PrinterSetup(ptDoc))
            {
                return;
            }
            //if (tb_PNR.Text.Trim().Length != 5)
            //{
            //    MessageBox.Show("订座记录号错误");
            //    return;
            //}
            //任我游为10位数
            if (tb_NO.Text.Trim().Length != 10)
            {
                MessageBox.Show("保单号长度错误");
                return;
            }
            try
            {
                long.Parse(tb_NO.Text.Trim());
            }
            catch
            {
                MessageBox.Show("保单号只能为数字");
                return;
            }
            if (cb_Name.Text.Trim() == "")
            {
                MessageBox.Show("姓名不能为空");
                return;
            }
            if (tb_CardNo.Text.Trim() == "")
            {
                MessageBox.Show("证件号码不能为空");
                return;
            }
            //if (tb_Signature.Text.Trim() == "")
            //{
            //    MessageBox.Show("经办人不能为空");
            //    return;
            //}
            //if (tb_Insuror.Text.Trim() == "")
            //{
            //    MessageBox.Show("保险人不能为空");
            //    return;
            //}
            #endregion

            //6+凑足八位
            this.tb_RandomNo.Text = "PEED2006420105" + System.DateTime.Now.Month.ToString("x") + EagleAPI.GetRandom62();

#if newHYX
            if (!GlobalVar.b_OffLine)
            {
                if (cb_Name.Text != GlobalVar.HYXTESTPRINT)
                {
                    HyxStructs hs = new HyxStructs();
                    hs.UserID           = GlobalVar.loginName;
                    hs.eNumber          = tb_RandomNo.Text;
                    hs.IssueNumber      = tb_NO.Text;
                    hs.NameIssued       = cb_Name.Text;
                    hs.CardType         = "";
                    hs.CardNumber       = tb_CardNo.Text;
                    hs.Remark           = "001";//"中国人保财险-任我游";001
                    hs.IssuePeriod      = "7天";
                    hs.IssueBegin       = dtp_Start.Value.ToShortDateString() + " 00:00:00";
                    hs.IssueEnd         = dtp_End.Value.ToShortDateString() + " 23:59:59";
                    hs.SolutionDisputed = cb_Method.Text;
                    hs.NameBeneficiary  = tb_Benefit.Text;
                    hs.Signature        = this.tb_Signature.Text;
                    hs.SignDate         = dtp_Date.Value.ToShortDateString();
                    hs.Pnr = this.tb_PNR.Text;
                    if (!hs.SubmitInfo())
                    {
                        MessageBox.Show("数据提交失败!请检查保单号是否已被使用,或网络是否正常!");
                        return;
                    }
                }
            }
#else
            #region   数据
            if (conn.State != ConnectionState.Connecting)
            {
                conn.Close();
                try
                {
                    conn.Open();
                }
                catch
                {
                    MessageBox.Show("数据库连接失败!!");
                    Application.Exit();
                }
            }

            string cmdstring = "insert t_hyx (UserID,InsuranceName,PNR,[NO],Policy,IssuedName,IDCard,FlightNo,";
            cmdstring += "FlyDate,EffictiveTime,EffictiveStart,EffictiveEnd,Beneficiary,BeneficiaryInfo,IssuedDate,";
            cmdstring += "IssuedBy) VALUES ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}')";
            cmdstring  = string.Format(cmdstring, GlobalVar.loginName, "中国人保财险-任我游", tb_PNR.Text, tb_RandomNo.Text, tb_NO.Text,
                                       cb_Name.Text, this.tb_CardNo.Text, "", "", "7天",
                                       dtp_Start.Value.ToShortDateString() + " 00:00:00",
                                       dtp_End.Value.ToShortDateString() + " 24:00:00",
                                       "", "", dtp_Date.Value.ToString(), tb_Signature.Text);
            try
            {
                SqlCommand cmd = new SqlCommand(cmdstring, conn);
                if (cmd.ExecuteNonQuery() != 1)
                {
                    MessageBox.Show("数据上传失败!");
                    return;
                }
            }
            catch
            {
                MessageBox.Show("请正确输入!");
                return;
            }
            #endregion
#endif
            #region 打印
            PrintDialog pd = new PrintDialog();
            pd.Document = ptDoc;
            DialogResult dr = pd.ShowDialog();
            if (dr == DialogResult.OK)
            {
                ptDoc.Print();
            }
            #endregion
        }