コード例 #1
0
        public void CancelInsurance(string insType)//即保险指令,如B04
        {
            //保单作废服务,userid,保单号,insType

            if (MessageBox.Show("确定作废保单" + tb保单序号.Text.Trim() + "吗?", "注意", MessageBoxButtons.OKCancel) != DialogResult.OK)
            {
                return;
            }
            if (insuranceType == "B09" || insuranceType == "B0D")
            {
                string                    caseno = tb保单序号.Text.Trim();
                EP.WebService             epws   = new EP.WebService();
                EP.WebServiceReturnEntity epret  = new EP.WebServiceReturnEntity();
                epret = epws.DiscardIt(GlobalVar2.bxUserAccount, GlobalVar2.bxPassWord, caseno);
                if (epret.Enabled)
                {
                    MessageBox.Show(caseno + " 作废成功");
                }
                else
                {
                    MessageBox.Show(caseno + " 作废失败:" + epret.ErrorMsg);
                }
            }
            else
            {
                if (WebService.CancelInsurance(GlobalVar.loginName, insType, tb保单序号.Text))
                {
                    MessageBox.Show("作废成功");
                }
                else
                {
                    MessageBox.Show("作废失败");
                }
            }
        }
コード例 #2
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();
            }
        }
コード例 #3
0
        private void tb保单序号_KeyUp(object sender, KeyEventArgs e)
        {
            string h = this.tb保单序号.Text.Substring(0, 4);

            if (e.KeyValue == 13)
            {
                string   s = this.tb保单序号.Text.Substring(4);//this.tb保单序号.Text.ToUpper().Replace(h, "");
                string[] a = s.Split('-');
                int      len = a[0].Trim().Length;
                long     start = 0, end = 0;
                if (a.Length == 1)
                {
                    start = end = long.Parse(a[0].Trim());
                }
                else if (a.Length == 2)
                {
                    start = long.Parse(a[0].Trim());
                    end   = long.Parse(a[0].Trim().Substring(0, a[0].Trim().Length - a[1].Trim().Length) + a[1].Trim());
                    if (end < start)
                    {
                        long temp = start;
                        start = end;
                        end   = temp;
                    }
                }
                else
                {
                    MessageBox.Show("请正确输入!如:12345678-89");
                }
                for (long ln = start; ln <= end; ln++)
                {
                    try
                    {
                        this.tb保单序号.Text = h + ln.ToString("d" + len.ToString());
                        Application.DoEvents();
                        string para = this.tb保单序号.Text.ToUpper();
                        //if (!para.StartsWith("WHHY")) para = "WHHY" + para;
                        EP.WebService ep  = new EP.WebService();
                        string        xml = ep.QueryCaseByCase(this.tb保单序号.Text);
                        XmlDocument   xd  = new XmlDocument();
                        xd.LoadXml(xml);
                        XmlNode xn = xd.SelectSingleNode("//NewDataSet/Table");
                        //            xn.SelectSingleNode("caseNo").InnerText;
                        tb保单号码.Text = xn.SelectSingleNode("caseSerial").InnerText;
                        //            xn.SelectSingleNode("caseOwner").InnerText;
                        //            xn.SelectSingleNode("caseSupplier").InnerText;
                        //            xn.SelectSingleNode("caseRecursive").InnerText;
                        cb被保险人姓名.Text = xn.SelectSingleNode("customerName").InnerText;
                        //            xn.SelectSingleNode("customerID").InnerText;
                        textBox1.Text = xn.SelectSingleNode("customerPhone").InnerText;
                        tb航班号.Text    = xn.SelectSingleNode("customerFlightNo").InnerText;
                        tb乘机日.Text    = DateTime.Parse(xn.SelectSingleNode("customerFlightDate").InnerText).ToShortDateString();
                        //            xn.SelectSingleNode("beneficiary").InnerText;
                        this.tb填开日期.Text = DateTime.Parse(xn.SelectSingleNode("datetime").InnerText).ToShortDateString();
                        this.tb证件号.Text  = xn.SelectSingleNode("customerID").InnerText;
                        bool b_printed = (xn.SelectSingleNode("isPrinted").InnerText == "true");
                        bool b_plus    = (xn.SelectSingleNode("plus").InnerText == "true");
                        bool b_enabled = (xn.SelectSingleNode("enabled").InnerText == "true");
                        if (b_printed)
                        {
                            this.ptDoc.Print();
                        }
                        else
                        {
                            MessageBox.Show("该号未使用!");
                        }
                    }
                    catch
                    {
                        MessageBox.Show("获取信息错误!");
                    }
                }
            }
            else if (e.KeyValue == 38)//UP
            {
                try
                {
                    string s   = tb保单序号.Text.Trim().Replace(h, "");
                    int    len = s.Length;
                    long   no  = long.Parse(s) + 1;
                    tb保单序号.Text = no.ToString("d" + len.ToString());
                }
                catch
                {
                }
            }
            else if (e.KeyValue == 40)//down
            {
                try
                {
                    string s   = tb保单序号.Text.Trim().Replace(h, "");
                    int    len = s.Length;
                    long   no  = long.Parse(s) - 1;
                    tb保单序号.Text = no.ToString("d" + len.ToString());
                }
                catch
                {
                }
            }
        }
コード例 #4
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;
        }