private void loadPolicyData(string policyId) { DataTable dt = To_PolicyManager.GetList(int.Parse(policyId)); int makerid; int.TryParse(dt.Rows[0]["policy_makerId"].ToString(), out makerid); LoginInfo login = LoginInfoManager.getLoginInfoById(makerid); DepartmentInfo department = DepartmentInfoManager.getDepartmentInfoById(login.Departid); txtdepart.Value = department.Departcname; txttime.Value = DateTime.Now.ToString("yyyy年MM月dd日"); lblkhmc.Text = dt.Rows[0]["cusCName"].ToString(); //客户名称 lblcm.Text = dt.Rows[0]["shipName"].ToString(); //船名 lbltbrq.Text = Convert.IsDBNull(dt.Rows[0]["policy_date"]) ? "" : Convert.ToDateTime(dt.Rows[0]["policy_date"]).ToString("yyyy年MM月dd日"); //投保日期 lblbxgs.Text = dt.Rows[0]["comCname"].ToString(); //保险公司 lblbxxz.Text = dt.Rows[0]["ProdTypeName"].ToString(); //险种 lblbfhj.Text = dt.Rows[0]["totalPremium"].ToString(); //总保费 bank.InnerHtml = "公司名称:" + dt.Rows[0]["cardName"].ToString() + "<br />开 户 行:" + dt.Rows[0]["bank"].ToString() + "<br />账 号:" + dt.Rows[0]["cardId"].ToString(); //银行信息 lblbpr.Text = dt.Rows[0]["policy_maker"].ToString(); //报批人 }
/// <summary> /// 加载数据 /// </summary> /// <param name="policyid"></param> private void LoadPolicyData(string policyid) { DataTable dt = To_PolicyManager.GetList(int.Parse(policyid)); int makerid; int.TryParse(dt.Rows[0]["policy_makerId"].ToString(), out makerid); LoginInfo login = LoginInfoManager.getLoginInfoById(makerid); DepartmentInfo depart = DepartmentInfoManager.getDepartmentInfoById(login.Departid); txtdepart.Value = depart.Departcname; //制单部门名称 txttime.Value = DateTime.Now.ToString("yyyy年MM月dd日"); //显示提交的时间 lblkhmc.Text = dt.Rows[0]["cusCName"].ToString(); //客户名称 lblxz.Text = dt.Rows[0]["ProdTypeName"].ToString(); //险种 txtzbf.Value = dt.Rows[0]["totalPremium"].ToString(); //总保费 txtjjf.Value = dt.Rows[0]["totalEconomic"].ToString(); //经济费 lblzffs.Text = Request.QueryString["type"].ToString(); //支付方式 lblbxgs.Text = dt.Rows[0]["comCname"].ToString(); //保险公司 txtzxf.Value = dt.Rows[0]["totalRich"].ToString(); //咨询费 lblbpr.Text = dt.Rows[0]["policy_maker"].ToString();//报批人 }
/// <summary> /// 加载当前保单信息 /// </summary> /// <param name="id"></param> private void InitData(int id) { To_Policy policyModel = new To_Policy(); DataTable data = To_PolicyManager.GetList(id); if (data.Rows.Count > 0) { LblAssured.Text = data.Rows[0]["assured"].ToString(); //被保险人 //LblBrokerage.Text = data.Rows[0][""].ToString();//经纪费 LblCompany.Text = data.Rows[0]["comshortname"].ToString(); //保险公司 LblCustomer.Text = data.Rows[0]["cusshortName"].ToString(); //投保客户 LblIsRenewal.Text = Convert.ToInt32(data.Rows[0]["IsRenewal"]) == 0 ? "否" : "是"; //是否续保 LblPolicyDate.Text = Convert.ToDateTime(data.Rows[0]["policy_date"]).ToString("yyyy-MM-dd"); //保单日期 LblPolicyMaker.Text = data.Rows[0]["policy_maker"].ToString(); //制单人 LblPolicyNum.Text = data.Rows[0]["policy_num"].ToString(); //保单编号 LblPolicyState.Text = Convert.ToInt32(data.Rows[0]["policy_state"]) == 0 ? "无效" : "有效"; //保单状态 //LblPremium.Text = data.Rows[0][""].ToString();//保费合计 //LblSalesman.Text = data.Rows[0]["cname"].ToString();//所属业务员 LoginInfo userInfo = LoginInfoManager.getLoginInfoById(Convert.ToInt32(data.Rows[0]["policy_makerId"])); if (userInfo != null) { DepartmentInfo department = DepartmentInfoManager.getDepartmentInfoById(userInfo.Departid); if (department != null) { LblMakerDepart.Text = department.Departcname; //制单部门 } } zjjfrate.Text = data.Rows[0]["totalEcoRate"].ToString(); //总经济费比率 zbf.Text = data.Rows[0]["totalPremium"].ToString(); //总保费 zjjf.Text = data.Rows[0]["totalEconomic"].ToString(); //总经济费 zbe.Text = data.Rows[0]["totalBrokerage"].ToString(); //总保额 ztf.Text = data.Rows[0]["totalRich"].ToString(); //总贴费 cm.Text = data.Rows[0]["shipName"].ToString(); //船名 LblSerialNum.Text = data.Rows[0]["serialnum"].ToString(); //内部流水号 LblTimeEnd.Text = Convert.ToDateTime(data.Rows[0]["policy_enddate"]).ToString("yyyy-MM-dd"); //保单日期结束日期 LblTimeStart.Text = Convert.ToDateTime(data.Rows[0]["policy_startdate"]).ToString("yyyy-MM-dd"); //保单日期开始日期 ltrYearsCount.Text = (Convert.ToDateTime(data.Rows[0]["policy_enddate"]).Year - Convert.ToDateTime(data.Rows[0]["policy_startdate"]).Year).ToString(); LblType.Text = data.Rows[0]["ProdTypeName"].ToString(); //险种 optiniontxt.InnerHtml = ShowOpiniontxt(int.Parse(data.Rows[0]["isVerify"].ToString())); //审核人意见 lblUserCompany.Text = data.Rows[0]["userCompany"].ToString(); LoadAuditImg(int.Parse(data.Rows[0]["ruleid"].ToString())); InitProductType(id); LoadNowAudit(data.Rows[0]["isVerify"].ToString()); BudgetPre1.InitData(id); UCTarget1.BindTarget(id); LoadFile(); } }
/// <summary> /// 检验是否能成功产生单据名称 /// </summary> /// <param name="cuscode">输入的客户代码</param> /// <param name="cname">客户代码全称</param> /// <param name="attachment">>客户代码不包含流水号</param> /// <param name="txt">流水号</param> private bool StrNumbers(string strcuscode, out string cuscode, out string codeformat, out string ordernum) { bool result = true; cuscode = ""; //客户代码全称 codeformat = ""; //名称,不包含流水号 ordernum = ""; //流水号 DataTable tbl = GetModuleCoding(); //自动编码 string txtformat = tbl.Rows[0]["txtformat"].ToString(); //名称的格式 string usecode = tbl.Rows[0]["usecode"].ToString(); //流水号 int len = int.Parse(tbl.Rows[0]["orderlen"].ToString()); //流水号长度 DataTable custbl = null; string strsql = ""; //查询字符窜 if (usecode == "0") { if (strcuscode.Trim() != "") { cuscode = strcuscode; //客户代码全称 } else { result = false; Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "test", "<script>alert('保存失败,业务编号不能为空!')</script>"); } } else { int num = 1; //默认流水号 codeformat = Numbers(txtformat); //名称 strsql = " codeFormart= '" + codeformat + "' AND LEN(orderNum) =" + len.ToString(); custbl = To_PolicyManager.GetList(1, strsql, " id desc "); if (custbl.Rows.Count >= 1) { if (custbl.Rows[0]["orderNum"].ToString() != "") { num = int.Parse(custbl.Rows[0]["orderNum"].ToString()) + 1; //流水号 if (num.ToString().Length > len) { result = false; Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "test", "<script>alert('保存失败,业务编号长度不够!')</script>"); } } } ordernum = num.ToString().PadLeft(len, '0'); //流水号 cuscode = codeformat + ordernum; //客户代码全称 } return(result); }
/// <summary> /// 初始化信息 /// </summary> /// <param name="id"></param> /// <param name="loginID"></param> private void InitData(int id, int loginID) { DataTable data = To_PolicyManager.GetList(id); if (data.Rows.Count > 0) { if (data.Rows[0]["savestatus"].ToString().Trim() == "已提交") { Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "load", "<script>alert('已提交的保单不能修改');window.location='PolicyList.aspx'</script>"); } TxtAssured.Text = data.Rows[0]["assured"].ToString(); //被保险人 //TxtBrokerage.Text = data.Rows[0][""].ToString();//经纪费合计 TxtCompany.Text = data.Rows[0]["comshortname"].ToString(); //保险公司 TxtCustomer.Text = data.Rows[0]["cusShortName"].ToString(); //投保客户 TxtPolicyDate.Text = Convert.ToDateTime(data.Rows[0]["policy_date"]).ToString("yyyy-MM-dd"); //保单日期 TxtPolicyMaker.Text = data.Rows[0]["policy_maker"].ToString(); //制单人 TxtPolicyNum.Text = data.Rows[0]["policy_num"].ToString(); //保单编号 //TxtPremium.Text = data.Rows[0][""].ToString();//保费合计 //TxtSalesman.Text = data.Rows[0]["cname"].ToString();//所属业务员 TxtSerialNum.Text = data.Rows[0]["serialnum"].ToString(); //内部流水号 //TxtYears.Text = (Convert.ToDateTime(data.Rows[0]["policy_enddate"]).Year - Convert.ToDateTime(data.Rows[0]["policy_startdate"]).Year).ToString();//保单期限结束日期 TxtTimeStart.Text = Convert.ToDateTime(data.Rows[0]["policy_startdate"]).ToString("yyyy-MM-dd"); //保单期限开始日期 txtEndTime.Text = Convert.ToDateTime(data.Rows[0]["policy_enddate"]).ToString("yyyy-MM-dd"); TxtType.Text = data.Rows[0]["ProdTypeName"].ToString(); //险种 //TxtVerifyDate.Text = Convert.ToDateTime(data.Rows[0]["verifydate"]).ToString("yyyy-MM-dd");//审核日期 //TxtVerifyUser.Text = data.Rows[0]["verifyUser"].ToString();//审核人 DdlIsRenewal.SelectedIndex = data.Rows[0]["IsRenewal"] == null ? 1 : (data.Rows[0]["IsRenewal"].ToString() == "0" ? 1 : 0); //是否续保 //DdlIsVirify.SelectedIndex = data.Rows[0]["isVerify"] == null ? 1 : (data.Rows[0]["isVerify"].ToString() == "0" ? 1 : 0);//审核状态 DdlPolicyState.SelectedIndex = data.Rows[0]["policy_state"] == null ? 0 : (data.Rows[0]["policy_state"].ToString() == "0" ? 1 : 0); //保单状态 zjjfrate.Text = data.Rows[0]["totalEcoRate"].ToString(); //总经济费比率 zbf.Text = data.Rows[0]["totalPremium"].ToString(); //总保费 zjjf.Text = data.Rows[0]["totalEconomic"].ToString(); //总经济费 zbe.Text = data.Rows[0]["totalBrokerage"].ToString(); //总保额 ztf.Text = data.Rows[0]["totalRich"].ToString(); //总贴费 cm.Text = data.Rows[0]["shipName"].ToString(); //船名 HidComId.Value = data.Rows[0]["company"].ToString(); HidCusId.Value = data.Rows[0]["customer"].ToString(); HidTypeId.Value = data.Rows[0]["ProdTypeNo"].ToString(); HidSalesman.Value = data.Rows[0]["salesman"].ToString(); this.DdlIsVirify.SelectedValue = data.Rows[0]["ruleid"].ToString(); //审核规则 LoadAuditImg(int.Parse(data.Rows[0]["ruleid"].ToString())); DdlIsDaidian.SelectedValue = data.Rows[0]["isDaidian"].ToString(); LoginInfo userInfo = LoginInfoManager.getLoginInfoById(Convert.ToInt32(data.Rows[0]["policy_makerId"])); if (userInfo != null) { DepartmentInfo department = DepartmentInfoManager.getDepartmentInfoById(userInfo.Departid); if (department != null) { txtMarkerDepart.Text = department.Departcname; } } InitProductType(id); TxtSerialNum.Attributes.Add("ReadOnly", "true"); TxtPolicyMaker.Attributes.Add("ReadOnly", "true"); //初始化盈亏测算数据 UCBudgetEdit1.InitBudgetData(id); UCTarget1.BindTarget(id); LoadFileList(id); } else { Response.End(); } }