protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { DataRowView dv = e.Row.DataItem as DataRowView; if (dv != null) { DataRow dr = dv.Row; String id1 = dr["id"].ToString(); HyperLink Hyper1 = e.Row.FindControl("ChuZhiCount") as HyperLink; if (Hyper1 != null) { if (dv != null) { ZC2BU bu1 = new ZC2BU(); Hyper1.Text = bu1.GetChuZhiCountByID(int.Parse(id1)).ToString(); if (Hyper1.Text == "0") { Hyper1.Text = ""; } } } HyperLink hyp2 = e.Row.FindControl("HyperLink1") as HyperLink; if (hyp2 != null) { ZcspBU bu1 = new ZcspBU(); int zcspCount = bu1.GetZcCount(int.Parse(id1), ZCKind.单条资产); hyp2.NavigateUrl = String.Format("javascript:myAddZc({0},{1});", id1, zcspCount); hyp2.Target = "_self"; } } }
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { String temp = null; ZcspBU bu1 = new ZcspBU(); DataRowView dv = e.Row.DataItem as DataRowView; if (dv != null) { DataRow dr = dv.Row; HyperLink link1 = e.Row.FindControl("link1") as HyperLink; if (link1 != null) { link1.Text = JSJ.SysFrame.Util.GetMaxLenth(dr["bname"].ToString().Trim(), 18); if (dr["id"].ToString().Trim() != String.Empty) { link1.NavigateUrl = "~/ZcMng2/ZcBaoDetail1.aspx?id=" + dr["id"].ToString(); link1.ToolTip = "浏览资产包的详细情况"; //link1.Target = "_blank"; } } //计算本金 double benjin = 0; Label lab1 = e.Row.FindControl("benjin") as Label; if (lab1 != null) { temp = dr["bj"].ToString().Replace(",", ""); if (String.IsNullOrEmpty(temp)) { temp = "0"; } benjin = double.Parse(temp); lab1.Text = benjin.ToString("n"); } //计算利息 double lixi = 0; lab1 = e.Row.FindControl("lixi") as Label; if (lab1 != null) { temp = dr["lx"].ToString().Replace(",", ""); if (String.IsNullOrEmpty(temp)) { temp = "0"; } lixi = double.Parse(temp); lab1.Text = lixi.ToString("n"); } //计算总额 lab1 = e.Row.FindControl("zqce") as Label; if (lab1 != null) { lab1.Text = (benjin + lixi).ToString("n"); } DataRow info1 = bu1.GetShenPiInfo("spstatus,spresult,status1,status2 ", dr["id"].ToString(), "2"); //审批状态 lab1 = e.Row.FindControl("spstatus") as Label; if (lab1 != null && dr["id"].ToString().Trim() != String.Empty) { String s1 = String.Empty; if (info1 != null) { s1 = info1["spstatus"].ToString().Trim(); } if (s1 == String.Empty) { s1 = "-1"; } int status1 = int.Parse(s1); if (status1 == -1) { lab1.Text = "<span title='未启动审批'>□</span>"; } if (status1 == 0) { lab1.Text = "<span title='审批中'><font color='blue'>○</font></span>"; } if (status1 == 1) { lab1.Text = "<span title='审核委员会批'><font color='Red'>☆</font></span>"; } if (status1 == 2) { lab1.Text = "<span title='决策委员会批'><font color='Red'>☆☆</font></span>"; } } //执行结果 lab1 = e.Row.FindControl("spresult") as Label; if (lab1 != null && dr["id"].ToString().Trim() != String.Empty) { if (info1 != null) { lab1.Text = info1["spresult"].ToString().Trim(); } } //执行状态 lab1 = e.Row.FindControl("zxzt") as Label; if (lab1 != null && dr["id"].ToString().Trim() != String.Empty) { if (info1 != null) { if (info1["status1"].ToString().Trim() != String.Empty) { temp = info1["status1"].ToString() + "-" + info1["status2"].ToString(); } else { temp = " "; } lab1.Text = temp; } } //计算资产包的ID lab1 = e.Row.FindControl("zcbid") as Label; if (lab1 != null) { lab1.Text = dr["id"].ToString().Trim(); } } }
//计算回款和支持 protected override void OnPreRender(EventArgs e) { Label lab1 = null; Label lab2 = null; Label lab3 = null; String zcid = null; String zcbid = null; ArrayList list1 = new ArrayList(); ArrayList list2 = new ArrayList(); ZcspBU bu1 = new ZcspBU(); double d1 = 0; double d2 = 0; double d0 = 0; foreach (GridViewRow row in this.GridView1.Rows) { lab1 = row.FindControl("zcid") as Label; if (lab1 != null) { zcid = lab1.Text.Trim(); } lab1 = row.FindControl("zcbid") as Label; if (lab1 != null) { zcbid = lab1.Text.Trim(); } lab2 = row.FindControl("huikuan") as Label; lab3 = row.FindControl("zhichu") as Label; if (lab2 != null && lab3 != null) { if (String.IsNullOrEmpty(zcid) == false) { d0 = bu1.GetHuiKuan(zcid, ZCKind.单条资产); d1 = d1 + d0; lab2.Text = d0.ToString("n"); d0 = bu1.GetZhiChu(zcid, ZCKind.单条资产); d2 = d2 + d0; lab3.Text = d0.ToString("n"); } else { if (String.IsNullOrEmpty(zcbid) == false) { d0 = bu1.GetHuiKuan(zcbid, ZCKind.资产包); d1 = d1 + d0; lab2.Text = d0.ToString("n"); d0 = bu1.GetZhiChu(zcbid, ZCKind.资产包); d2 = d2 + d0; lab3.Text = d0.ToString("n"); } else { lab2.Text = d1.ToString("n"); lab3.Text = d2.ToString("n"); } } } } }
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { String temp = null; ZcspBU bu1 = new ZcspBU(); DataRowView dv = e.Row.DataItem as DataRowView; if (dv != null) { DataRow dr = dv.Row; //计算本金 double benjin = 0; Label lab1 = e.Row.FindControl("benjin") as Label; if (lab1 != null) { temp = dr["bj"].ToString().Replace(",", ""); if (String.IsNullOrEmpty(temp)) { temp = "0"; } benjin = double.Parse(temp); lab1.Text = benjin.ToString("n"); } //计算利息 double lixi = 0; lab1 = e.Row.FindControl("lixi") as Label; if (lab1 != null) { temp = dr["lx"].ToString().Replace(",", ""); if (String.IsNullOrEmpty(temp)) { temp = "0"; } lixi = double.Parse(temp); lab1.Text = lixi.ToString("n"); } //计算总额 lab1 = e.Row.FindControl("zqce") as Label; if (lab1 != null) { lab1.Text = (benjin + lixi).ToString("n"); } DataRow info1 = bu1.GetShenPiInfo("spstatus,spresult,status1,status2 ", dr["id"].ToString(), "1"); //审批状态 lab1 = e.Row.FindControl("spstatus") as Label; if (lab1 != null && dr["id"].ToString().Trim() != String.Empty) { String s1 = String.Empty; if (info1 != null) { s1 = info1["spstatus"].ToString().Trim(); } if (s1 == String.Empty) { s1 = "-1"; } int status1 = int.Parse(s1); if (status1 == -1) { lab1.Text = "<span title='未启动审批'>□</span>"; } if (status1 == 0) { lab1.Text = "<span title='审批中'><font color='blue'>○</font></span>"; } if (status1 == 1) { lab1.Text = "<span title='审核委员会批'><font color='Red'>☆</font></span>"; } if (status1 == 2) { lab1.Text = "<span title='决策委员会批'><font color='Red'>☆☆</font></span>"; } } //执行结果 lab1 = e.Row.FindControl("spresult") as Label; if (lab1 != null && dr["id"].ToString().Trim() != String.Empty) { if (info1 != null) { lab1.Text = info1["spresult"].ToString().Trim(); } } //执行状态 lab1 = e.Row.FindControl("zxzt") as Label; if (lab1 != null && dr["id"].ToString().Trim() != String.Empty) { if (info1 != null) { if (info1["status1"].ToString().Trim() != String.Empty) { temp = info1["status1"].ToString() + "-" + info1["status2"].ToString(); } else { temp = " "; } lab1.Text = temp; } } //计算资产回款和支持用 lab1 = e.Row.FindControl("zcid") as Label; if (lab1 != null) { lab1.Text = dr["id"].ToString().Trim(); } } }
protected override void OnPreRender(EventArgs e) { GridView[] arr1 = new GridView[] { this.GridView1, this.GridView2 }; Label lab1 = null; Label lab2 = null; Label lab3 = null; String zcid = null; String zcbid = null; ArrayList list1 = new ArrayList(); ArrayList list2 = new ArrayList(); ZcspBU bu1 = new ZcspBU(); for (int i = 0; i < arr1.Length; i++) { double d1 = 0; double d2 = 0; double d0 = 0; foreach (GridViewRow row in arr1[i].Rows) { lab1 = row.FindControl("zcid") as Label; if (lab1 != null) { zcid = lab1.Text.Trim(); } lab1 = row.FindControl("zcbid") as Label; if (lab1 != null) { zcbid = lab1.Text.Trim(); } lab2 = row.FindControl("huikuan") as Label; lab3 = row.FindControl("zhichu") as Label; if (lab2 != null && lab3 != null) { if (String.IsNullOrEmpty(zcid) == false) { if (list1.Contains(zcid) == false) { list1.Add(zcid); d0 = bu1.GetHuiKuan(zcid, ZCKind.单条资产); d1 = d1 + d0; lab2.Text = d0.ToString("n"); d0 = bu1.GetZhiChu(zcid, ZCKind.单条资产); d2 = d2 + d0; lab3.Text = d0.ToString("n"); } else { lab2.Text = "-"; lab3.Text = "-"; } } else { if (String.IsNullOrEmpty(zcbid) == false) { if (list2.Contains(zcbid) == false) { list2.Add(zcbid); d0 = bu1.GetHuiKuan(zcbid, ZCKind.资产包); d1 = d1 + d0; lab2.Text = d0.ToString("n"); d0 = bu1.GetZhiChu(zcbid, ZCKind.资产包); d2 = d2 + d0; lab3.Text = d0.ToString("n"); } else { lab2.Text = "-"; lab3.Text = "-"; } } else { lab2.Text = d1.ToString("n"); lab3.Text = d2.ToString("n"); } } } } } base.OnPreRender(e); }
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { ZcspBU bu1 = new ZcspBU(); DataRowView dv = e.Row.DataItem as DataRowView; if (dv != null) { DataRow dr = dv.Row; //设置档案号 HyperLink link2 = e.Row.FindControl("Link2") as HyperLink; if (link2 != null) { if (dr["zcid"].ToString().Trim() != String.Empty) { link2.NavigateUrl = "~/ZcMng2/ZcDetail1.aspx?id=" + dr["zcid"].ToString(); link2.ToolTip = "浏览资产的详细情况"; } if (dr["zcbid"].ToString().Trim() != String.Empty) { link2.NavigateUrl = "~/ZcMng2/ZcBaoDetail1.aspx?id=" + dr["zcbid"].ToString(); link2.ToolTip = "浏览资产包的详细情况"; } link2.Target = "_blank"; String num = dr["num2"].ToString().Trim(); if (num == String.Empty) { num = "无编号"; } link2.Text = num; } //设置项目名称 //设置资产处置链接的地址 HyperLink link1 = e.Row.FindControl("Link1") as HyperLink; if (link1 != null) { if (dr["id"].ToString().Trim() != String.Empty) { link1.NavigateUrl = "EditSbb.aspx?id=" + dr["id"].ToString(); } link1.Text = JSJ.SysFrame.Util.GetMaxLenth(dr["xmmc"].ToString(), 20); link1.Target = "_blank"; } //计算本金 String temp = null; Label lab1 = e.Row.FindControl("benjin") as Label; if (lab1 != null) { temp = dr["benjin"].ToString().Replace(",", ""); if (String.IsNullOrEmpty(temp)) { temp = "0"; } lab1.Text = double.Parse(temp).ToString("n"); } //计算利息 lab1 = e.Row.FindControl("lixi") as Label; if (lab1 != null) { temp = dr["lixi"].ToString().Replace(",", ""); if (String.IsNullOrEmpty(temp)) { temp = "0"; } lab1.Text = double.Parse(temp).ToString("n"); } //计算总额 lab1 = e.Row.FindControl("zqce") as Label; if (lab1 != null) { temp = dr["zqce"].ToString().Replace(",", ""); if (String.IsNullOrEmpty(temp)) { temp = "0"; } lab1.Text = double.Parse(temp).ToString("n"); } //审批状态 lab1 = e.Row.FindControl("spstatus") as Label; if (lab1 != null && dr["id"].ToString().Trim() != String.Empty) { int status1 = bu1.GetShenPiStatus(dr["id"].ToString()); if (status1 == -1) { lab1.Text = "<span title='未启动审批'>□</span>"; } if (status1 == 0) { lab1.Text = "<span title='审批中'><font color='blue'>○</font></span>"; } if (status1 == 1) { lab1.Text = "<span title='审核委员会批'><font color='Red'>☆</font></span>"; } if (status1 == 2) { lab1.Text = "<span title='决策委员会批'><font color='Red'>☆☆</font></span>"; } } //执行状态 lab1 = e.Row.FindControl("zxzt") as Label; if (lab1 != null) { if (dr["status1"].ToString().Trim() != String.Empty) { temp = dr["status1"].ToString() + "-" + dr["status2"].ToString(); } else { temp = " "; } lab1.Text = temp; } lab1 = e.Row.FindControl("zcid") as Label; if (lab1 != null) { lab1.Text = dr["zcid"].ToString().Trim(); } lab1 = e.Row.FindControl("zcbid") as Label; if (lab1 != null) { lab1.Text = dr["zcbid"].ToString().Trim(); } } }
//计算回款和支持 protected override void OnPreRender(EventArgs e) { if (!Page.IsPostBack) { // this.BindData(null,null); // this.AdvanceSearch1.SetDepartRow(false); // this.NewBindData(); this.SearchControl1.GetSearchCondition(); this.NewBindData(); } Label lab1 = null; Label lab2 = null; Label lab3 = null; String zcid = null; String zcbid = null; ArrayList list1 = new ArrayList(); ArrayList list2 = new ArrayList(); ZcspBU bu1 = new ZcspBU(); double d1 = 0; double d2 = 0; double d0 = 0; foreach (GridViewRow row in this.GridView1.Rows) { lab1 = row.FindControl("zcid") as Label; if (lab1 != null) { zcid = lab1.Text.Trim(); } lab1 = row.FindControl("zcbid") as Label; if (lab1 != null) { zcbid = lab1.Text.Trim(); } lab2 = row.FindControl("huikuan") as Label; lab3 = row.FindControl("zhichu") as Label; if (lab2 != null && lab3 != null) { if (String.IsNullOrEmpty(zcid) == false) { d0 = bu1.GetHuiKuan(zcid, ZCKind.单条资产); d1 = d1 + d0; lab2.Text = d0.ToString("n"); d0 = bu1.GetZhiChu(zcid, ZCKind.单条资产); d2 = d2 + d0; lab3.Text = d0.ToString("n"); } else { if (String.IsNullOrEmpty(zcbid) == false) { d0 = bu1.GetHuiKuan(zcbid, ZCKind.资产包); d1 = d1 + d0; lab2.Text = d0.ToString("n"); d0 = bu1.GetZhiChu(zcbid, ZCKind.资产包); d2 = d2 + d0; lab3.Text = d0.ToString("n"); } else { lab2.Text = d1.ToString("n"); lab3.Text = d2.ToString("n"); } } } } }
//调整数据的变化 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { DataRowView dv = e.Row.DataItem as DataRowView; if (dv != null) { DataRow dr = dv.Row; String czid = dr["id"].ToString(); //设置资产(或资产包)的类别 int col1 = 8; //表示状态 String spkind = dr["zcbid"].ToString().Trim(); if (spkind == String.Empty) { e.Row.Cells[col1].Text = "资产"; } else { e.Row.Cells[col1].Text = "资产包"; } ZcspBU spbu1 = new ZcspBU(); //设置资产审批BU类 int status1 = spbu1.GetShenPiStatus(czid); //设置资产处置的审批状态 Label labsp = e.Row.FindControl("spstatus") as Label; if (labsp != null) { if (status1 == -1) { labsp.Text = "<span title='未启动审批'>□</span>"; } if (status1 == 0) { labsp.Text = "<span title='审批中'><font color='blue'>○</font></span>"; } if (status1 == 1) { labsp.Text = "<span title='审核委员会批'><font color='Red'>☆</font></span>"; } if (status1 == 2) { labsp.Text = "<span title='决策委员会批'><font color='Red'>☆☆</font></span>"; } } //计算会议时间 Label lab1 = e.Row.FindControl("hysj") as Label; if (lab1 != null) { if (status1 == 1) { lab1.Text = dr["hysj1"].ToString(); } if (status1 == 2) { lab1.Text = dr["hysj2"].ToString(); } } //设置资产的执行状态 Label lab2 = e.Row.FindControl("zxzt") as Label; if (lab2 != null) { if (dr["status1"].ToString().Trim() != String.Empty) { lab2.Text = dr["status1"].ToString().Trim() + "-" + dr["status2"].ToString().Trim(); } } //设置资产处置链接的地址 HyperLink link1 = e.Row.FindControl("Link1") as HyperLink; if (link1 != null) { if (dr["id"].ToString().Trim() != String.Empty) { link1.NavigateUrl = "EditSbb.aspx?id=" + dr["id"].ToString(); } if (ViewState["MenuIndex"] != null) { link1.NavigateUrl += "&menuIndex=" + ViewState["MenuIndex"].ToString(); } link1.Text = dr["xmmc"].ToString(); } //设置资产信息处置链接的地址 HyperLink link2 = e.Row.FindControl("Link2") as HyperLink; if (link1 != null) { if (dr["zcid"].ToString().Trim() != String.Empty) { link2.NavigateUrl = "~/ZcMng2/ZcDetail1.aspx?id=" + dr["zcid"].ToString(); link2.ToolTip = "浏览资产的详细情况"; } if (dr["zcbid"].ToString().Trim() != String.Empty) { link2.NavigateUrl = "~/ZcMng2/ZcBaoDetail1.aspx?id=" + dr["zcbid"].ToString(); link2.ToolTip = "浏览资产包的详细情况"; } link2.Target = "_blank"; String num = dr["num2"].ToString().Trim(); if (num == String.Empty) { num = "无编号"; } link2.Text = num; } //设置删除的操作是否可用 LinkButton button1 = e.Row.FindControl("button1") as LinkButton; if (button1 != null) { bool spFlag = this.GetSpCount(dr["id"].ToString()); if (spFlag) { button1.Visible = false; } } } }
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { String temp = null; ZcspBU bu1 = new ZcspBU(); DataRowView dv = e.Row.DataItem as DataRowView; String hankouRoot = System.Configuration.ConfigurationManager.AppSettings["hkbankurl"]; String lxRoot = System.Configuration.ConfigurationManager.AppSettings["lxbankurl"]; if (dv != null) { DataRow dr = dv.Row; HyperLink link1 = e.Row.FindControl("link1") as HyperLink; if (link1 != null) { link1.Target = "_blank"; link1.Text = JSJ.SysFrame.Util.GetMaxLenth(dr["danwei"].ToString().Trim(), 18); if (dr["id"].ToString().Trim() != String.Empty) { if (dr["tablekind"].ToString() == "0") { link1.NavigateUrl = "~/ZcMng2/ZcDetail1.aspx?id=" + dr["id"].ToString(); link1.ToolTip = "浏览资产的详细情况"; } else if (dr["tablekind"].ToString() == "1") { link1.Text = link1.Text + "(汉)"; link1.NavigateUrl = hankouRoot + Page.User.Identity.Name + "&ReturnUrl=" + Server.UrlEncode("/ZcMng2/ZcDetail1.aspx?id=" + dr["id"].ToString()); link1.ToolTip = "浏览资产的详细情况"; } else { link1.Text = link1.Text + "(联)"; link1.NavigateUrl = lxRoot + Page.User.Identity.Name + "&ReturnUrl=" + Server.UrlEncode("/ZcMng2/ZcDetail1.aspx?id=" + dr["id"].ToString()); link1.ToolTip = "浏览资产的详细情况"; } //link1.Target = "_blank"; } } //计算本金 double benjin = 0; Label lab1 = e.Row.FindControl("benjin") as Label; if (lab1 != null) { temp = dr["bj"].ToString().Replace(",", ""); if (String.IsNullOrEmpty(temp)) { temp = "0"; } benjin = double.Parse(temp); lab1.Text = benjin.ToString("n"); } //计算利息 double lixi = 0; lab1 = e.Row.FindControl("lixi") as Label; if (lab1 != null) { temp = dr["lx"].ToString().Replace(",", ""); if (String.IsNullOrEmpty(temp)) { temp = "0"; } lixi = double.Parse(temp); lab1.Text = lixi.ToString("n"); } //计算总额 lab1 = e.Row.FindControl("zqce") as Label; if (lab1 != null) { lab1.Text = (benjin + lixi).ToString("n"); } DataRow info1 = dr; //DataRow info1 = bu1.GetShenPiInfo("spstatus,spresult,status1,status2 ", dr["id"].ToString(), "1"); //审批状态 lab1 = e.Row.FindControl("spstatus") as Label; if (lab1 != null && dr["id"].ToString().Trim() != String.Empty) { String s1 = String.Empty; if (info1 != null) { s1 = info1["spstatus"].ToString().Trim(); } if (s1 == String.Empty) { s1 = "-1"; } int status1 = int.Parse(s1); if (status1 == -1) { lab1.Text = "<span title='未启动审批'>□</span>"; } if (status1 == 0) { lab1.Text = "<span title='审批中'><font color='blue'>○</font></span>"; } if (status1 == 1) { lab1.Text = "<span title='审核委员会批'><font color='Red'>☆</font></span>"; } if (status1 == 2) { lab1.Text = "<span title='决策委员会批'><font color='Red'>☆☆</font></span>"; } } //执行结果 lab1 = e.Row.FindControl("spresult") as Label; if (lab1 != null && dr["id"].ToString().Trim() != String.Empty) { if (info1 != null) { lab1.Text = info1["spresult"].ToString().Trim(); } } //执行状态 lab1 = e.Row.FindControl("zxzt") as Label; if (lab1 != null && dr["id"].ToString().Trim() != String.Empty) { if (info1 != null) { if (info1["status1"].ToString().Trim() != String.Empty) { temp = info1["status1"].ToString() + "-" + info1["status2"].ToString(); } else { temp = " "; } lab1.Text = temp; } } /* * if (this.SearchControl1.SearchType == SearchDataType.单条资产) * { * lab1 = e.Row.FindControl("zcid") as Label; * if (lab1 != null) * { * lab1.Text = dr["id"].ToString().Trim(); * } * } * else * { * lab1 = e.Row.FindControl("zcbid") as Label; * if (lab1 != null) * { * lab1.Text = dr["id"].ToString().Trim(); * } * }*/ } }