private EagleWebService.TraceEntity cancelIA() { EagleWebService.wsInsurrance ws = new EagleWebService.wsInsurrance(); EagleWebService.TraceEntity ret = new EagleWebService.TraceEntity(); ret = ws.DiscardIt(printHandle.m_pInfo.m_username, printHandle.m_pInfo.m_password, txtENumber.Text); return(ret); }
/// <summary> /// 取产品列表 /// </summary> /// <param name="iaCode">默认选中的产品编号</param> void GetProductList(string iaCode) { try { EagleWebService.wsInsurrance ws = new EagleWebService.wsInsurrance(); EagleWebService.ProductListResponseEntity ret; ret = ws.GetProductList(Options.GlobalVar.IAUsername, Options.GlobalVar.IAPassword); if (string.IsNullOrEmpty(ret.Trace.ErrorMsg)) { if (ret.ProductList.Length < 1) { return; } this.cmbInsuranceType.DisplayMember = "productName"; this.cmbInsuranceType.ValueMember = "FilterComment";//借用该字段 for (int i = 0; i < ret.ProductList.Length; i++) { EagleWebService.t_Product product = ret.ProductList[i]; product.FilterComment = product.productID + "|" + product.productDuration;//借用该string型字段,否则无法通过编译. this.cmbInsuranceType.Items.Add(product); //if (product.productID.ToString() == iaCode) //this.cmbInsuranceType.SelectedIndex = i;//有bug!因为设置了cmbInsuranceType的Sorted属性,每次Add时会重新排列,而SelectedIndex却不变,导致最终显示错位! //cmbInsuranceType.SelectedItem = product;//依然bug!因为该操作也间接设置了SelectedIndex,情况同上,导致显示错位! //解决方法:不要在该数据填充循环中执行初始化操作,移到循环外,即下面的foreach循环 } foreach (var item in cmbInsuranceType.Items) { EagleWebService.t_Product product = (EagleWebService.t_Product)item; if (product.productID.ToString() == iaCode) { cmbInsuranceType.SelectedItem = product; break; } } if (this.cmbInsuranceType.SelectedIndex < 0) { this.cmbInsuranceType.SelectedIndex = 0; } } else { MessageBox.Show("获取产品列表失败:" + ret.Trace.ErrorMsg + System.Environment.NewLine + ret.Trace.Detail); } } catch (Exception e) { EagleString.EagleFileIO.LogWrite(e.ToString()); } }
private void tsbBalance_Click(object sender, EventArgs e) { EagleWebService.wsInsurrance ws = new EagleWebService.wsInsurrance(); this.tsbBalance.Text = ws.CountBalance(Options.GlobalVar.IAUsername, "").ToString(); }
bool GetInsuranceSeq() { EagleWebService.wsInsurrance ws = new EagleWebService.wsInsurrance(); EagleWebService.PurchaseResponseEntity ret; EagleWebService.PurchaseRequestEntity req = new EagleWebService.PurchaseRequestEntity(); this.Invoke(new MethodInvoker(delegate() { string productString = ((EagleWebService.t_Product)(cmbInsuranceType.Items[cmbInsuranceType.SelectedIndex])).FilterComment; string[] productIdAndDuration = productString.Split('|'); string productID = productIdAndDuration[0]; req.customerID = txtCardNo.Text.Trim(); req.customerName = cbName.Text.Trim(); req.customerPhone = txtCustomerPhone.Text.Trim(); req.flightDate = dtpFlightDate.Value; req.flightNo = txtFlightNo.Text.Trim(); req.InsuranceCode = productID; req.password = printHandle.m_pInfo.m_password; req.username = printHandle.m_pInfo.m_username; req.PNR = autoSizeTextBox1.Text.Trim(); //req.Reserved = txtPrintingNo.Text.Trim(); req.customerIDType = (EagleWebService.IdentityType)Enum.Parse(typeof(EagleWebService.IdentityType), cmbCardType.Text); req.customerGender = rbMale.Checked ? EagleWebService.Gender.Male : EagleWebService.Gender.Female; req.customerBirth = dtpBirth.Value.Date; txtCode.Text = txtENumber.Text = string.Empty; //清空单证号 })); ret = ws.Purchase(req); //2011.11.13 发现bug:服务端在对接第三方接口时严重的超时,对接失败后仍然进行入库操作,返回; //与此同时本机也由于长时间等待而超时,导致此处抛出异常(实际上服务器已出单,只是对接第三方失败) if (!string.IsNullOrEmpty(ret.Trace.ErrorMsg)) { MessageBox.Show(ret.Trace.ErrorMsg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } else { this.Invoke(new MethodInvoker(delegate() { //if (!string.IsNullOrEmpty(ret.Trace.Detail)) // MessageBox.Show(ret.Trace.Detail, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); if (!string.IsNullOrEmpty(ret.PolicyNo))//正式保单号 { txtCode.Text = ret.PolicyNo; } if (!string.IsNullOrEmpty(ret.CaseNo)) { txtENumber.Text = ret.CaseNo; } if (!string.IsNullOrEmpty(ret.AgentName)) { txtSign.Text = ret.AgentName; } if (!string.IsNullOrEmpty(ret.Insurer))//承保公司 { txtInsurer.Text = ret.Insurer; } if (!string.IsNullOrEmpty(ret.AmountInsured))//保额 { txtAmountInsured.Text = ret.AmountInsured; } if (!string.IsNullOrEmpty(ret.ValidationPhoneNumber))//查询电话 { txtCustomerService.Text = ret.ValidationPhoneNumber; } if (!string.IsNullOrEmpty(ret.ValidationWebsite))//查询网址 { txtWebsite.Text = ret.ValidationWebsite; } })); return(true); } }