コード例 #1
0
ファイル: Preview.aspx.cs プロジェクト: zxmajunhong/wanghai
        /// <summary>
        /// 加载具体保险信息
        /// </summary>
        /// <param name="pid"></param>
        private void InitProductType(int pid)
        {
            ProductManager proBLL = new ProductManager();
            DataTable      data   = To_PolicyDetailManager.GetListByPolicyid(pid);


            RpProType.DataSource = data;
            RpProType.DataBind();


            decimal coverage = 0;
            decimal premium  = 0;

            for (int i = 0; i < data.Rows.Count; i++)
            {
                if (data.Rows[i]["fmone"] != null && data.Rows[i]["rich"] != null)
                {
                    coverage += Convert.ToDecimal(data.Rows[i]["fmone"]);
                    premium  += Convert.ToDecimal(data.Rows[i]["rich"]);
                }
            }

            totalCoverage.InnerText = coverage.ToString("C");
            totalPremium.InnerText  = premium.ToString("C");
        }
コード例 #2
0
ファイル: AddPolicy.aspx.cs プロジェクト: zxmajunhong/wanghai
        /// <summary>
        /// 绑定保单对应的保险项目
        /// </summary>
        /// <param name="pid">保单ID</param>
        private void InitProductType(int pid)
        {
            #region 无用代码
            //ProductManager proBLL = new ProductManager();
            //DataTable data = To_PolicyDetailManager.GetListByPolicy(pid);


            //RpProType.DataSource = data;
            //RpProType.DataBind();

            //StringBuilder pros = new StringBuilder();
            //for (int i = 0; i < data.Rows.Count; i++)
            //{
            //    pros.Append(data.Rows[i]["ProdID"]);
            //    pros.Append("$");
            //    pros.Append(data.Rows[i]["coverage"]);
            //    pros.Append("$");
            //    pros.Append(data.Rows[i]["premium"]);
            //    pros.Append("|");
            //}

            //HidPros.Value = pros.ToString();
            #endregion

            DataTable     tbl        = To_PolicyDetailManager.GetListByPolicyid(pid);
            HtmlTableRow  row        = null;
            HtmlTableCell cell       = null;
            string        strnumeral = "";
            for (int i = 0; i < tbl.Rows.Count; i++)
            {
                if (i == 0)
                {
                    row = this.table.Rows[1];

                    //业务员列
                    cell = row.Cells[0];
                    cell.Attributes.Add("onclick", "document.getElementById('hidsaleman').value=$(this).find('input').attr('id')");
                    cell.InnerHtml = "<input type='text' value='" + (string)tbl.Rows[i]["salesman"] + "' id='saleman1' class='Salesman' style='text-align: center' />";

                    //部门列
                    cell           = row.Cells[1];
                    cell.InnerHtml = "<input type='text' value='" + (string)tbl.Rows[i]["departname"] + "' id='depart1' class='depart' style='text-align: center' readonly='readonly' />";

                    //比率列
                    cell           = row.Cells[2];
                    strnumeral     = tbl.Rows[i]["numrate"].ToString();
                    cell.InnerHtml = "<input type='text' value='" + strnumeral + "' class='clsrate' style='width: 95%' onblur='SetRate(this);GetNumjjf(this,jjf1)' />%";

                    //经济费列
                    cell           = row.Cells[3];
                    strnumeral     = tbl.Rows[i]["fmone"].ToString();
                    cell.InnerHtml = "<input type='text' value='" + strnumeral + "' id='jjf1' class='clsjjf' reanonly='readonly' />";

                    //贴费列
                    cell           = row.Cells[4];
                    strnumeral     = tbl.Rows[i]["rich"].ToString();
                    cell.InnerHtml = "<input type='text' value='" + strnumeral + "' class='clstiefei' />";

                    //备注列
                    cell           = row.Cells[5];
                    cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["mark"].ToString() + "' />";
                }

                else
                {
                    row = new HtmlTableRow();

                    cell = new HtmlTableCell();
                    string departid   = "depart" + (i + 1).ToString();
                    string salesmanid = "salesman" + (i + 1).ToString();
                    cell.Attributes.Add("onclick", "document.getElementById('hidsaleman').value=$(this).find('input').attr('id'),artDialog.open('SelectSalesman.aspx?depart=" + departid + "')");
                    cell.InnerHtml = "<input type='text' value='" + (string)tbl.Rows[i]["salesman"] + "' id='" + salesmanid + "' class='salesman' style='text-align: center' />";
                    row.Controls.Add(cell);

                    cell           = new HtmlTableCell();
                    cell.InnerHtml = "<input type='text' value='" + (string)tbl.Rows[i]["departname"] + "' id='" + departid + "' class='depart' style='text-align: center' readonly='readonly' />";
                    row.Controls.Add(cell);

                    cell = new HtmlTableCell();
                    string jjfid = "jjf" + (i + 1).ToString();
                    strnumeral     = tbl.Rows[i]["numrate"].ToString();
                    cell.InnerHtml = "<input type='text' value='" + strnumeral + "' class='clsrate' style='width: 95%' onblur='SetRate(this);GetNumjjf(this," + jjfid + ")' />%";
                    row.Controls.Add(cell);

                    cell           = new HtmlTableCell();
                    strnumeral     = tbl.Rows[i]["fmone"].ToString();
                    cell.InnerHtml = "<input type='text' value='" + strnumeral + "' id='" + jjfid + "' class='clsjjf' readonly='readonly' />";
                    row.Controls.Add(cell);

                    cell           = new HtmlTableCell();
                    strnumeral     = tbl.Rows[i]["rich"].ToString();
                    cell.InnerHtml = "<input type='text' value='" + strnumeral + "' class='clstiefei' />";
                    row.Controls.Add(cell);

                    cell           = new HtmlTableCell();
                    cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["mark"].ToString() + "' />";
                    row.Controls.Add(cell);

                    cell = new HtmlTableCell();
                    cell.Attributes.Add("align", "center");
                    cell.InnerHtml = "<div class='imgdel'>&nbsp;</div>";
                    row.Controls.Add(cell);

                    this.table.Controls.Add(row);
                }

                this.hidsalemanrows.Value = (Convert.ToInt32(tbl.Rows.Count) + 1).ToString();
                this.hiddepartrows.Value  = (Convert.ToInt32(tbl.Rows.Count) + 1).ToString();
                this.hidjjfrows.Value     = (Convert.ToInt32(tbl.Rows.Count) + 1).ToString();
            }
        }