Esempio n. 1
0
 /// <remarks/>
 public System.IAsyncResult BeginsavePolicy(string userName, string passWord, TransportAccidentForSaveRequsetDto transportAccidentForSaveRequsetDto, System.AsyncCallback callback, object asyncState)
 {
     return(this.BeginInvoke("savePolicy", new object[] {
         userName,
         passWord,
         transportAccidentForSaveRequsetDto
     }, callback, asyncState));
 }
Esempio n. 2
0
 /// <remarks/>
 public void savePolicyAsync(string userName, string passWord, TransportAccidentForSaveRequsetDto transportAccidentForSaveRequsetDto, object userState)
 {
     if ((this.savePolicyOperationCompleted == null))
     {
         this.savePolicyOperationCompleted = new System.Threading.SendOrPostCallback(this.OnsavePolicyOperationCompleted);
     }
     this.InvokeAsync("savePolicy", new object[] {
         userName,
         passWord,
         transportAccidentForSaveRequsetDto
     }, this.savePolicyOperationCompleted, userState);
 }
Esempio n. 3
0
 /// <remarks/>
 public void savePolicyAsync(string userName, string passWord, TransportAccidentForSaveRequsetDto transportAccidentForSaveRequsetDto)
 {
     this.savePolicyAsync(userName, passWord, transportAccidentForSaveRequsetDto, null);
 }
Esempio n. 4
0
        public TransportAccidentResponseDto savePolicy([System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] string userName, [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] string passWord, [System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] TransportAccidentForSaveRequsetDto transportAccidentForSaveRequsetDto)
        {
            object[] results = this.Invoke("savePolicy", new object[] {
                userName,
                passWord,
                transportAccidentForSaveRequsetDto
            });

            return((TransportAccidentResponseDto)(results[0]));
        }
Esempio n. 5
0
        /// <summary>
        /// 投保
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public IssuingResultEntity Issue(IssueEntity entity)
        {
            IssuingResultEntity result = new IssuingResultEntity();

            //提交订单
            TransportAccidentForSaveRequsetDto dto = new TransportAccidentForSaveRequsetDto();

            dto.birthDate  = entity.Birthday.ToShortDateString();
            dto.effDate    = entity.EffectiveDate.ToString("yyyy-MM-dd HH:mm:ss");
            dto.functionId = "1";
            dto.gender     = entity.Gender == Gender.Female ? "女" : "男";
            dto.idNo       = entity.ID;
            dto.idType     = entity.IDType.ToString();
            //解决该接口不接受起保日期和终止日期是同一天的投保问题
            dto.matuDate         = entity.EffectiveDate.Date == entity.ExpiryDate.Date ? entity.ExpiryDate.Date.AddDays(1).ToString("yyyy-MM-dd HH:mm:ss") : entity.ExpiryDate.ToString("yyyy-MM-dd HH:mm:ss");
            dto.name             = entity.Name;
            dto.units            = "1";
            dto.customerPhone    = "";// entity.PhoneNumber;
            dto.customerFlightNo = entity.FlightNo;

            string number = entity.CaseId;

            number        = number.Length > 6 ? number.Substring(number.Length - 6) : number.PadLeft(6, '0');
            dto.orderCode = "TB2727" + DateTime.Today.ToString("yyyyMMdd") + number;

            //try
            //{
            //    Common.LogIt(Common.Serialize<TransportAccidentForSaveRequsetDto>(dto));
            //}
            //catch (Exception ee) { Common.LogIt(ee.ToString()); }

            TransportAccidentResponseDto ret = null;

            try
            {
                ret = wsSave.savePolicy("zgrs", "zgrs", dto);

                if (ret == null)
                {
                    throw new Exception("北京国寿WebService返回为空!");
                }
            }
            catch
            {
                Common.LogIt(wsSave.Url);
                throw;
            }

            if (string.IsNullOrEmpty(ret.error))
            {
                if (string.IsNullOrEmpty(ret.policyNo))
                {
                    throw new Exception("北京国寿保单号为空!?");
                }
                else
                {
                    result.PolicyNo = ret.policyNo;
                }
            }
            else
            {
                string request = Common.XmlSerialize <TransportAccidentForSaveRequsetDto>(dto);
                Common.LogIt("投保参数" + request + System.Environment.NewLine + "北京国寿投保:" + ret.error);
                result.Trace.ErrorMsg = ret.error;
            }

            return(result);
        }