private void BindData() { if (Request["zcid"] != null) { string zcid = Request["zcid"].ToString(); U_ZCBU zc1 = new U_ZCBU(); DataSet ds = zc1.GetZCDBInfoByID(zcid); zc1.Close(); if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < arr1.Length; i++) { Util.SetControlValue(this.bzyx.Parent.FindControl(arr1[i]), ds.Tables[0].Rows[0][arr1[i]]); } if (ds.Tables[0].Rows[0]["hssj"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["hssj"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.bzyx.Parent.FindControl("hssj"), dt); } } string[] num1 = new string[] { "zwrhsgz", "bzrhsgz", "qthsgz", "bzje", "klazfy", "dyhsgz1", "dyhsgz2" }; for (int i = 0; i < num1.Length; i++) { Label l1 = this.zwrhsgz.Parent.FindControl(num1[i]) as Label; if (l1 != null) { l1.Text = PubComm.GetNumberFormat(l1.Text); } } ds.Dispose(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CW_ShouKuan1BU shoukuan1 = new CW_ShouKuan1BU(); Hashtable ht = shoukuan1.GetObjectByID(Request.QueryString["id"]); for (int i = 0; i < arr1.Length; i++) { Util.SetControlValue(this.bill.Parent.FindControl(arr1[i]), ht[arr1[i]]); } if (this.billtime.Text != "" && this.billtime.Text != null) { this.billtime.Text = DateTime.Parse(this.billtime.Text).ToString("yyyy-M-d"); } this.pbj.Text = PubComm.GetNumberFormat(this.pbj.Text); this.plx.Text = PubComm.GetNumberFormat(this.plx.Text); shoukuan1.Close(); if (ht["checktime"] != DBNull.Value) { this.Button1.Visible = false; this.Button2.Attributes["onclick"] = "history.go(-1);return false;"; } else { this.Button2.Attributes["onclick"] = "top.location.href='CheckShouKuanList1.aspx';return false;"; } } }
private void BindData() { if (Request["zcid"] != null) { string id = Request["zcid"]; U_ZCBU zc1 = new U_ZCBU(); string fs = "danwei,depart,zeren,bj,lx,pbj,plx,fee1,fee2,fee3,fee4,fee5,fee6,fee7,fee8,fee9,fee10,fee11,fee12,bjye,lxye,hbxh,bxhjye,fyhj"; DataSet ds = zc1.GetDetailByID(id, "danwei,depart,zeren,bj,pbj,plx,fee1,fee2,fee3,fee4,fee5,fee6,fee7,fee8,fee9,fee10,fee11,fee12,isnull(bj,0)-isnull(pbj,0) as bjye ,isnull(lx1,0)+isnull(lx2,0)+isnull(lx3,0)-plx as lxye,isnull(pbj,0)+isnull(plx,0) as hbxh,isnull(bj,0)+isnull(lx1,0)+isnull(lx2,0)+isnull(lx3,0)-isnull(pbj,0)-isnull(plx,0) as bxhjye,isnull(fee1,0)+isnull(fee2,0)+isnull(fee3,0)+isnull(fee4,0)+isnull(fee5,0)+isnull(fee6,0)+isnull(fee7,0)+isnull(fee8,0)+isnull(fee9,0)+isnull(fee10,0)+isnull(fee11,0)+isnull(fee12,0)+isnull(fee13,0)+isnull(fee14,0)+isnull(fee15,0)+isnull(fee16,0)+isnull(fee17,0)+isnull(fee18,0)+isnull(fee19,0)+isnull(fee20,0) as fyhj,isnull(lx1,0)+isnull(lx2,0)+isnull(lx3,0) as lx"); zc1.Close(); string[] AF = fs.Split(','); if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < AF.Length; i++) { Util.SetControlValue(this.pbj.Parent.FindControl(AF[i]), ds.Tables[0].Rows[0][AF[i]]); } } //设置数字金额的显示 string[] num1 = new string[] { "pbj", "plx", "fee1", "fee2", "fee3", "fee4", "fee5", "fee6", "fee7", "fee8", "fee9", "fee10", "fee11", "fee12", "bjye", "lxye", "hbxh", "bxhjye", "fyhj" }; for (int i = 0; i < num1.Length; i++) { Label l1 = this.pbj.Parent.FindControl(num1[i]) as Label; if (l1 != null) { l1.Text = PubComm.GetNumberFormat(l1.Text); } } ds.Dispose(); } }
private void BindData(string begintime, string endtime) { CW_PayBU pay1 = new CW_PayBU(); DataSet ds = pay1.GetZhiChuByDepart(begintime, endtime); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { ds.Tables[0].Rows[i]["Sumfee"] = PubComm.GetNumberFormat(ds.Tables[0].Rows[i]["Sumfee"].ToString()); AllHK = AllHK + double.Parse(ds.Tables[0].Rows[i]["Sumfee"].ToString()); } this.Repeater1.DataSource = ds; this.Repeater1.DataBind(); pay1.Close(); }
//绑定资产审批的基本数据 private void BindData1(U_ZCBU zc1, string czid) { //设置基本数据 string[] arr1 = new string[] { "xmsbh", "danwei", "xmbj", "zclx", "zcse", "zqze", "bj", "lx", "fsxzly", "djyj", "cbdepart", "cbzeren", "num2" }; DataSet ds2 = zc1.GetShenBaoInfo(czid); if (ds2.Tables[0].Rows.Count > 0) { string zcid = ds2.Tables[0].Rows[0]["zcid"].ToString(); for (int i = 0; i < arr1.Length; i++) { Util.SetControlValue(this.xmbj.Parent.FindControl(arr1[i]), ds2.Tables[0].Rows[0][arr1[i]]); } } this.bj.Text = PubComm.GetNumberFormat(this.bj.Text); this.lx.Text = PubComm.GetNumberFormat(this.lx.Text); this.zqze.Text = PubComm.GetNumberFormat(this.zqze.Text); ds2.Dispose(); //得到部门审批人和审批意见 //U_UserNameBU user1 = new U_UserNameBU(); //string leader = user1.GetDirLeader(); //user1.Close(); U_ZCSPBU zcsp1 = new U_ZCSPBU(); DataSet ds3 = zcsp1.GetZcSPRemark(Request["czczid"].ToString(), SP.部门审批); if (ds3.Tables[0].Rows.Count > 0) { if (ds3.Tables[0].Rows[0]["remark"] != DBNull.Value) { this.bmremark.Text = ds3.Tables[0].Rows[0]["remark"].ToString(); this.zeren1.Text = ds3.Tables[0].Rows[0]["zeren"].ToString(); } if (ds3.Tables[0].Rows[0]["time1"] != DBNull.Value) { DateTime dt1 = (DateTime)ds3.Tables[0].Rows[0]["time1"]; this.time1.Text = dt1.ToString("yyyy年MM月dd日"); } DateTime dt2 = (DateTime)ds3.Tables[0].Rows[0]["time0"]; this.time.Text = dt2.ToString("yyyy年MM月dd日"); } ds3.Dispose(); zcsp1.Close(); }
private void BindData(string begintime, string endtime) { CW_ShouKuanBU sk1 = new CW_ShouKuanBU(); DataSet ds = sk1.GetHuiKuanByDepart(begintime, endtime); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { ds.Tables[0].Rows[i]["hkje"] = PubComm.GetNumberFormat(ds.Tables[0].Rows[i]["hkje"].ToString()); AllHK = AllHK + double.Parse(ds.Tables[0].Rows[i]["hkje"].ToString()); } this.Repeater1.DataSource = ds; this.Repeater1.DataBind(); sk1.Close(); }
private void BindData() { List <SearchField> list1 = (List <SearchField>)ViewState["SearchCondition"]; U_ZCBU zc1 = new U_ZCBU(); DataSet ds1 = zc1.GetDetailByID(list1, "*,isnull(pbj,0)+isnull(plx,0) as hbxh,isnull(bj,0)+isnull(lx1,0)+isnull(lx2,0)+isnull(lx3,0) as bxh,isnull(fee1,0)+isnull(fee2,0)+isnull(fee3,0)+isnull(fee4,0)+isnull(fee5,0)+isnull(fee6,0)+isnull(fee7,0)+isnull(fee8,0)+isnull(fee9,0)+isnull(fee10,0)+isnull(fee11,0)+isnull(fee12,0)+isnull(fee13,0)+isnull(fee14,0)+isnull(fee15,0)+isnull(fee16,0)+isnull(fee17,0)+isnull(fee18,0)+isnull(fee19,0)+isnull(fee20,0) as fyhj"); zc1.Close(); this.hs.Text = ds1.Tables[0].Rows.Count.ToString(); double bxh1 = 0; double bxh2 = 0; double hbxh1 = 0; double hbxh2 = 0; double fyhj = 0; string id = ""; for (int i = 0; i < ds1.Tables[0].Rows.Count; i++) { if (ds1.Tables[0].Rows[i]["huobi"].ToString() == "美元") { bxh2 = bxh2 + double.Parse(ds1.Tables[0].Rows[i]["bxh"].ToString()); hbxh2 = hbxh2 + double.Parse(ds1.Tables[0].Rows[i]["hbxh"].ToString()); } else { bxh1 = bxh1 + double.Parse(ds1.Tables[0].Rows[i]["bxh"].ToString()); hbxh1 = hbxh1 + double.Parse(ds1.Tables[0].Rows[i]["hbxh"].ToString()); } fyhj = fyhj + double.Parse(ds1.Tables[0].Rows[i]["fyhj"].ToString()); if (i == 0) { id = ds1.Tables[0].Rows[i]["id"].ToString(); } else { id = id + "," + ds1.Tables[0].Rows[i]["id"].ToString(); } } this.bxh1.Text = PubComm.GetNumberFormat(bxh1.ToString()) + "元"; this.bxh2.Text = PubComm.GetNumberFormat(bxh2.ToString()) + "美元"; this.hbxh1.Text = PubComm.GetNumberFormat(hbxh1.ToString()) + "元"; this.hbxh2.Text = PubComm.GetNumberFormat(hbxh2.ToString()) + "美元"; this.fyhj.Text = PubComm.GetNumberFormat(fyhj.ToString()) + "元"; ViewState["id"] = id; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CW_PayBU pay1 = new CW_PayBU(); Hashtable ht = pay1.GetObjectByID(Request.QueryString["id"]); pay1.Close(); for (int i = 0; i < arr1.Length; i++) { Util.SetControlValue(this.bill.Parent.FindControl(arr1[i]), ht[arr1[i]]); } if (this.billtime.Text != "" && this.billtime.Text != null) { this.billtime.Text = DateTime.Parse(this.billtime.Text).ToString("yyyy-M-d"); } for (int j = 0; j < arr2.Length; j++) { Label lab1 = this.bill.Parent.FindControl(arr2[j]) as Label; if (lab1 != null) { lab1.Text = PubComm.GetNumberFormat(lab1.Text); } } if (ht["checktime"] != DBNull.Value) { this.Button1.Visible = false; this.Button2.Attributes["onclick"] = "history.go(-1);return false;"; } else { this.Button2.Attributes["onclick"] = "top.location.href='CheckShouKuanList.aspx';return false;"; } //会计和出纳和修改单据的信息 U_RolesBU role1 = new U_RolesBU(); bool caiwu = role1.isRole(new string[] { "会计", "出纳" }); role1.Close(); if (caiwu == false) { this.Button3.Visible = false; } } }
private void BindData() { if (Request["id"] != null) { string id = Request["id"]; U_ZCBAOBU zcb1 = new U_ZCBAOBU(); DataSet ds = zcb1.GetDetailByID(id, "id,depart,bzeren,bstatus,statusText,bname,bljsk,bljzc"); this.Bname.Text = ds.Tables[0].Rows[0]["bname"].ToString(); this.Bid.Text = ds.Tables[0].Rows[0]["id"].ToString(); this.depart.Text = ds.Tables[0].Rows[0]["depart"].ToString(); this.bzeren.Text = ds.Tables[0].Rows[0]["bzeren"].ToString(); this.status.Text = ds.Tables[0].Rows[0]["bstatus"].ToString(); this.statusText.Text = ds.Tables[0].Rows[0]["statusText"].ToString(); this.ljsk.Text = ds.Tables[0].Rows[0]["bljsk"].ToString(); this.ljzc.Text = ds.Tables[0].Rows[0]["bljzc"].ToString(); if (this.statusText.Text == "") { this.statusText.Text = "阅卷"; } ds.Dispose(); Hashtable ht = zcb1.GetZcBbjANDlx(this.Bid.Text); this.bbjhj.Text = ht["bbjhj"].ToString(); this.blxhj.Text = ht["blxhj"].ToString(); zcb1.Close(); //设置数字金额的显示 string[] num1 = new string[] { "bbjhj", "blxhj", "ljzc", "ljsk" }; for (int i = 0; i < num1.Length; i++) { Label l1 = this.bbjhj.Parent.FindControl(num1[i]) as Label; if (l1 != null) { l1.Text = PubComm.GetNumberFormat(l1.Text); } } ds.Dispose(); } }
protected override void Render(HtmlTextWriter writer) { //设置统计信息 foreach (Control item in this.Repeater1.Controls) { RepeaterItem item1 = (RepeaterItem)item; if (item1.ItemType == ListItemType.Footer) { if (item.FindControl("labSum1") != null) { Label lab1 = item.FindControl("labSum1") as Label; Label lab2 = item.FindControl("labSum2") as Label; lab1.Text = PubComm.GetNumberFormat(sum1); lab2.Text = PubComm.GetNumberFormat(sum2); break; } } } base.Render(writer); }
protected void Repeater1_DataBound(object sender, RepeaterItemEventArgs e) { CW_PayBU pay1 = new CW_PayBU(); DataSet ds10 = pay1.GetGSFYHJ(btime, etime); ds10.Tables[0].Rows[0]["fyhj"] = PubComm.GetNumberFormat(AllHK); GridView gridview10 = e.Item.FindControl("GridView10") as GridView; if (gridview10 != null) { gridview10.ShowHeader = false; gridview10.DataSource = ds10; gridview10.DataBind(); } Label lab1 = e.Item.FindControl("labDepart") as Label; if (lab1 != null) { DataSet ds1 = pay1.GetZhiChu(btime, etime, lab1.Text); for (int i = 0; i < ds1.Tables[0].Rows.Count; i++) { for (int k = 1; k < 13; k++) { ds1.Tables[0].Rows[i]["Sumfee" + k] = PubComm.GetNumberFormat(ds1.Tables[0].Rows[i]["Sumfee" + k].ToString()); } ds1.Tables[0].Rows[i]["Sumfee"] = PubComm.GetNumberFormat(ds1.Tables[0].Rows[i]["Sumfee"].ToString()); } GridView gridview1 = e.Item.FindControl("GridView1") as GridView; if (gridview1 != null) { gridview1.DataSource = ds1; gridview1.DataBind(); } gridview1.Dispose(); } pay1.Close(); }
private void BindData() { if (Request["zcid"] != null) { string id = Request["zcid"]; U_ZCBU zc1 = new U_ZCBU(); DataSet ds = zc1.GetDetailByID(id); zc1.Close(); if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < arr1.Length; i++) { Util.SetControlValue(this.zcbao.Parent.FindControl(arr1[i]), ds.Tables[0].Rows[0][arr1[i]]); } if (ds.Tables[0].Rows[0]["time0"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["time0"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.zcbao.Parent.FindControl("time0"), dt); } if (ds.Tables[0].Rows[0]["status"] != DBNull.Value) { string st = ds.Tables[0].Rows[0]["statusText"].ToString(); Util.SetControlValue(this.zcbao.Parent.FindControl("status"), st); } //设置数字金额的显示 string[] num1 = new string[] { "bj", "lx1", "lx2", "lx3", "zczb" }; for (int i = 0; i < num1.Length; i++) { Label l1 = this.bj.Parent.FindControl(num1[i]) as Label; if (l1 != null) { l1.Text = PubComm.GetNumberFormat(l1.Text); } } } ds.Dispose(); } }
//绑定资产调查数据 private void BindData() { if (Request["id"] != null) { string id = Request["id"]; U_ZCBU zc1 = new U_ZCBU(); DataSet ds = zc1.GetDetailByID(id, "depart,zeren,status,statusText,danwei,bj"); zc1.Close(); this.danwei.Text = ds.Tables[0].Rows[0]["danwei"].ToString(); this.status.Text = ds.Tables[0].Rows[0]["status"].ToString(); this.statusText.Text = ds.Tables[0].Rows[0]["statusText"].ToString(); if (this.status.Text == "00") { this.statusText.Text = "非现场调查(档案核查)"; } else if (this.status.Text == "01") { this.statusText.Text = "现场调查(抵质押物)"; } else if (this.status.Text == "02") { this.statusText.Text = "现场调查(保证人)"; } else if (this.status.Text == "03") { this.statusText.Text = "现场调查(借款人)"; } //this.depart.Text = ds.Tables[0].Rows[0]["depart"].ToString(); //this.zeren.Text = ds.Tables[0].Rows[0]["zeren"].ToString(); this.bj.Text = PubComm.GetNumberFormat(ds.Tables[0].Rows[0]["bj"].ToString()); ds.Dispose(); this.SetButton(); } }
//绑定人员 protected void Repeater1_DataBound(object sender, RepeaterItemEventArgs e) { CW_ShouKuanBU sk1 = new CW_ShouKuanBU(); DataSet ds10 = sk1.GetGSHK(this.BeginTime.Text, this.EndTime.Text); ds10.Tables[0].Rows[0]["hkje"] = PubComm.GetNumberFormat(AllHK); GridView gridview10 = e.Item.FindControl("GridView10") as GridView; if (gridview10 != null) { gridview10.ShowHeader = false; gridview10.DataSource = ds10; gridview10.DataBind(); } //gridview10.Dispose(); Label lab1 = e.Item.FindControl("labDepart") as Label; if (lab1 != null) { DataSet ds1 = sk1.Gethuikuan(this.BeginTime.Text, this.EndTime.Text, lab1.Text); for (int i = 0; i < ds1.Tables[0].Rows.Count; i++) { ds1.Tables[0].Rows[i]["hkje"] = PubComm.GetNumberFormat(ds1.Tables[0].Rows[i]["hkje"].ToString()); } GridView gridview1 = e.Item.FindControl("GridView1") as GridView; if (gridview1 != null) { gridview1.DataSource = ds1; gridview1.DataBind(); } gridview1.Dispose(); } sk1.Close(); }
private void BindData() { if (Request["id"] != null) { string zcid = Request["id"].ToString(); U_ZCBU zc1 = new U_ZCBU(); DataSet ds = zc1.GetZCDBInfoByID(zcid); string user1 = zc1.GetZerenByZCID(zcid); zc1.Close(); if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < arr1.Length; i++) { Util.SetControlValue(this.bzyx.Parent.FindControl(arr1[i]), ds.Tables[0].Rows[0][arr1[i]]); Util.SetControlValue(this.bzyx.Parent.FindControl(arr1[i] + "_1"), ds.Tables[0].Rows[0][arr1[i]]); } if (ds.Tables[0].Rows[0]["hssj"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["hssj"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.bzyx.Parent.FindControl("hssj"), dt); Util.SetControlValue(this.bzyx.Parent.FindControl("hssj_1"), dt); } } ds.Dispose(); //设置按钮的权限 if (user1 == User.Identity.Name || (user1.Trim() == "" && PubComm.IsRole("系统管理员"))) { this.Button1.Visible = true; this.Adddyw.Visible = true; this.Addzyw.Visible = true; for (int i = 0; i < arr1.Length; i++) { if (this.bzyx.Parent.FindControl(arr1[i] + "_1") != null) { this.bzyx.Parent.FindControl(arr1[i] + "_1").Visible = false; } } } else { this.Button1.Visible = false; this.Adddyw.Visible = false; this.Addzyw.Visible = false; for (int i = 0; i < arr1.Length; i++) { if (this.bzyx.Parent.FindControl(arr1[i]) != null) { this.bzyx.Parent.FindControl(arr1[i]).Visible = false; } } } if (PubComm.IsRole("系统管理员")) { this.Button2.Visible = true; } else { this.Button2.Visible = false; } //设置数字金额的显示 string[] num1 = new string[] { "zwrhsgz", "bzrhsgz", "qthsgz", "bzje", "klazfy", "dyhsgz1", "dyhsgz2" }; for (int i = 0; i < num1.Length; i++) { TextBox t1 = this.zwrhsgz.Parent.FindControl(num1[i]) as TextBox; Label l1 = this.zwrhsgz.Parent.FindControl(num1[i] + "_1") as Label; if (t1 != null) { t1.Text = PubComm.GetNumberFormat(t1.Text); } if (l1 != null) { l1.Text = PubComm.GetNumberFormat(l1.Text); } } } }
//设置页面控制的值及显示格式等 private void SetPageData() { string id = Request["id"]; U_ZCBU zc1 = new U_ZCBU(); DataSet ds = zc1.GetDetailByID(id); zc1.Close(); //设置控件的值 bool owner = false; string user1 = ""; if (ds.Tables[0].Rows[0]["zeren"] != DBNull.Value) { user1 = ds.Tables[0].Rows[0]["zeren"].ToString(); } if (user1 == User.Identity.Name || (user1.Trim() == "" && PubComm.IsRole("系统管理员"))) { owner = true; } else { this.but0.Visible = false; } if (PubComm.IsRole("系统管理员")) { this.Button1.Visible = true; this.Button2.Visible = true; this.Button3.Visible = true; } else { this.Button1.Visible = false; this.Button2.Visible = false; this.Button3.Visible = false; } //设置控件数据的显示 for (int i = 1; i < ds.Tables[0].Columns.Count; i++) { string colName = ds.Tables[0].Columns[i].ColumnName.ToLower(); if (owner) { if (this.zcbao.Parent.FindControl(colName) != null) { Util.SetControlValue(this.zcbao.Parent.FindControl(colName), ds.Tables[0].Rows[0][colName]); } if (this.zcbao.Parent.FindControl(colName + "_1") != null) { this.zcbao.Parent.FindControl(colName + "_1").Visible = false;; } } else { if (this.zcbao.Parent.FindControl(colName + "_1") != null) { Util.SetControlValue(this.zcbao.Parent.FindControl(colName + "_1"), ds.Tables[0].Rows[0][colName]); } if (this.zcbao.Parent.FindControl(colName) != null) { this.zcbao.Parent.FindControl(colName).Visible = false;; } } this.status.Text = ds.Tables[0].Rows[0]["statustext"].ToString(); this.status_1.Text = ds.Tables[0].Rows[0]["statustext"].ToString(); if (ds.Tables[0].Rows[0]["time0"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["time0"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.zcbao.Parent.FindControl("time0"), dt); Util.SetControlValue(this.zcbao.Parent.FindControl("time0_1"), dt); } if (ds.Tables[0].Rows[0]["status"] != DBNull.Value) { string st = ds.Tables[0].Rows[0]["statusText"].ToString(); Util.SetControlValue(this.zcbao.Parent.FindControl("status"), st); Util.SetControlValue(this.zcbao.Parent.FindControl("status_1"), st); } if (ds.Tables[0].Rows[0]["clsj"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["clsj"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.zcbao.Parent.FindControl("clsj"), dt); Util.SetControlValue(this.zcbao.Parent.FindControl("clsj_1"), dt); } if (ds.Tables[0].Rows[0]["xdri"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["xdri"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.zcbao.Parent.FindControl("xdri"), dt); Util.SetControlValue(this.zcbao.Parent.FindControl("xdri_1"), dt); } if (ds.Tables[0].Rows[0]["dkffrq1"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["dkffrq1"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.zcbao.Parent.FindControl("dkffrq1"), dt); Util.SetControlValue(this.zcbao.Parent.FindControl("dkffrq1_1"), dt); } if (ds.Tables[0].Rows[0]["xcyqrq"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["xcyqrq"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.zcbao.Parent.FindControl("xcyqrq"), dt); Util.SetControlValue(this.zcbao.Parent.FindControl("xcyqrq_1"), dt); } if (ds.Tables[0].Rows[0]["jrblsj"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["jrblsj"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.zcbao.Parent.FindControl("jrblsj"), dt); Util.SetControlValue(this.zcbao.Parent.FindControl("jrblsj_1"), dt); } } //设置转入价的显示 if (PubComm.IsRole("公司领导") || PubComm.IsRole("评审部角色")) { this.zcbao.Parent.FindControl("zhuang_1").Visible = true; } else { this.zcbao.Parent.FindControl("zhuang_1").Visible = false; } //设置数字金额的显示 string[] num1 = new string[] { "bj", "lx1", "lx2", "lx3", "zczb", "dkye", "zjycszje" }; for (int i = 0; i < num1.Length; i++) { TextBox t1 = this.bj.Parent.FindControl(num1[i]) as TextBox; Label l1 = this.bj.Parent.FindControl(num1[i] + "_1") as Label; if (t1 != null) { t1.Text = PubComm.GetNumberFormat(t1.Text); } if (l1 != null) { l1.Text = PubComm.GetNumberFormat(l1.Text); } } }
/// <summary> /// 插入表格1行数据 /// </summary> /// <param name="depart">部门</param> /// <param name="zeren">责任人</param> /// <param name="huikuan">金额</param> private void InsertRow(string depart, string zeren, double huikuan) { string time1 = ""; if (HttpContext.Current.Items["time0"].ToString() != "") { time1 = (DateTime.Parse(HttpContext.Current.Items["time0"].ToString())).ToString("yyyy-MM-dd"); } string time2 = ""; if (HttpContext.Current.Items["time1"].ToString() != "") { time2 = (DateTime.Parse(HttpContext.Current.Items["time1"].ToString())).ToString("yyyy-MM-dd"); } TableRow tr = new TableRow(); tr.HorizontalAlign = HorizontalAlign.Center; if (depart != "" && zeren == "") { tr.BackColor = Color.FromArgb(0xcc, 0xff, 0xcc); } else { tr.BackColor = Color.White; } tr.Height = Unit.Parse("18pt"); //第1列 TableCell tc1 = new TableCell(); if (depart == "" && zeren == "") { tc1.Text = "<b><font color='#ff0000'>总计</font></b>"; } else if (zeren == "") { tc1.Text = String.Format("{0}小计", depart); } else { tc1.Text = depart; } tr.Cells.Add(tc1); //第2列 TableCell tc2 = new TableCell(); tc2.Text = zeren; if (tc2.Text == "") { tc2.Text = "----"; } tr.Cells.Add(tc2); //第3列 TableCell tc3 = new TableCell(); tc3.HorizontalAlign = HorizontalAlign.Right; if (huikuan != 0) { HyperLink link1 = new HyperLink(); link1.Text = "¥" + PubComm.GetNumberFormat(huikuan) + " "; link1.NavigateUrl = string.Format("TJ_HK_List.aspx?dt1={0}&dt2={1}&depart={2}&zeren={3}", time1, time2, Server.UrlEncode(depart), Server.UrlEncode(zeren)); link1.Target = "_blank"; link1.ForeColor = Color.Blue; link1.ToolTip = "点击浏览详细"; link1.Font.Underline = true; tc3.Controls.Add(link1); } else { tc3.Text = "0¥" + " ";; } tr.Cells.Add(tc3); this.Table1.Rows.Add(tr); }
private void SetPageData() { if (Request["id"] != null) { string id = Request["id"]; U_ZCBAOBU zcb1 = new U_ZCBAOBU(); DataSet ds = zcb1.GetZCBAOInfoByID(id); zcb1.Close(); //设置控件的值 bool owner = false; string user1 = ""; if (ds.Tables[0].Rows[0]["bzeren"] != DBNull.Value) { user1 = ds.Tables[0].Rows[0]["bzeren"].ToString(); } if (user1 == User.Identity.Name || (user1.Trim() == "" && PubComm.IsRole("系统管理员"))) { owner = true; } else { this.Button1.Visible = false; } //设置控件数据的显示 for (int i = 1; i < ds.Tables[0].Columns.Count; i++) { string colName = ds.Tables[0].Columns[i].ColumnName.ToLower(); if (owner) { if (this.Bname.Parent.FindControl(colName) != null) { Util.SetControlValue(this.Bname.Parent.FindControl(colName), ds.Tables[0].Rows[0][colName]); } if (this.Bname.Parent.FindControl(colName + "_1") != null) { this.Bname.Parent.FindControl(colName + "_1").Visible = false;; } } else { if (this.Bname.Parent.FindControl(colName + "_1") != null) { Util.SetControlValue(this.Bname.Parent.FindControl(colName + "_1"), ds.Tables[0].Rows[0][colName]); } if (this.Bname.Parent.FindControl(colName) != null) { this.Bname.Parent.FindControl(colName).Visible = false;; } } } //设置数字金额的显示 string[] num1 = new string[] { "Bljsk", "Bljzc" }; for (int i = 0; i < num1.Length; i++) { TextBox t1 = this.Bljsk.Parent.FindControl(num1[i]) as TextBox; Label l1 = this.Bljsk.Parent.FindControl(num1[i] + "_1") as Label; if (t1 != null) { t1.Text = PubComm.GetNumberFormat(t1.Text); } if (l1 != null) { l1.Text = PubComm.GetNumberFormat(l1.Text); } } } }
/// <summary> /// 插入一行表格数据 /// </summary> /// <param name="depart">部门</param> /// <param name="zeren">责任人</param> /// <param name="val1">费用数组</param> private void InsertRow(string depart, string zeren, double[] val) { string time1 = ""; if (HttpContext.Current.Items["time0"].ToString() != "") { time1 = (DateTime.Parse(HttpContext.Current.Items["time0"].ToString())).ToString("yyyy-MM-dd"); } string time2 = ""; if (HttpContext.Current.Items["time1"].ToString() != "") { time2 = (DateTime.Parse(HttpContext.Current.Items["time1"].ToString())).ToString("yyyy-MM-dd"); } TableRow tr = new TableRow(); tr.HorizontalAlign = HorizontalAlign.Center; if (depart != "" && zeren == "") { tr.BackColor = Color.FromArgb(0xcc, 0xff, 0xcc); } else { tr.BackColor = Color.White; } tr.Height = Unit.Parse("18pt"); //第1列 TableCell tc1 = new TableCell(); if (depart == "" && zeren == "") { tc1.Text = "<b><font color='#ff0000'>公司总计</font></b>"; } else if (zeren == "") { tc1.Text = String.Format("{0}小计", depart); } else { tc1.Text = depart; } tr.Cells.Add(tc1); //第2列 TableCell tc2 = new TableCell(); tc2.Text = zeren; if (tc2.Text == "") { tc2.Text = "----"; } tr.Cells.Add(tc2); //第3-14列 double sum1 = 0; for (int k = 0; k < val.Length; k++) { TableCell tc3 = new TableCell(); tc3.HorizontalAlign = HorizontalAlign.Right; tc3.Text = "¥" + PubComm.GetNumberFormat(val[k]); sum1 = sum1 + val[k]; tr.Cells.Add(tc3); } //第15列 TableCell tc15 = new TableCell(); tc15.HorizontalAlign = HorizontalAlign.Right; HyperLink link1 = new HyperLink(); link1.Text = "<u>¥" + PubComm.GetNumberFormat(sum1) + "</u>"; link1.Target = "_blank"; link1.ForeColor = Color.Blue; link1.ToolTip = "点击浏览详细"; link1.NavigateUrl = string.Format("TJ_ZhiChu_List.aspx?dt1={0}&dt2={1}&zeren={2}&depart={3}", time1, time2, Server.UrlEncode(zeren), Server.UrlEncode(depart)); tc15.Controls.Add(link1); tr.Cells.AddAt(2, tc15); this.Table1.Rows.Add(tr); }
//设置页面控件的值 private void SetPageData1() { string id = Request["id"]; U_ZCBU zc1 = new U_ZCBU(); DataSet ds = zc1.GetDetailByID(id); zc1.Close(); if (ds.Tables[0].Rows.Count > 0) { //设置管理员字段 //for (int i = 0; i < arr1.Length; i++) //{ // Util.SetControlValue(this.zcbao.Parent.FindControl(arr1[i]), ds.Tables[0].Rows[0][arr1[i]]); // if (this.zcbao.Parent.FindControl(arr1[i] + "_1") != null) // { // //设置对应的标签提示信息 // Util.SetControlValue(this.zcbao.Parent.FindControl(arr1[i] + "_1"), ds.Tables[0].Rows[0][arr1[i]]); // } //} if (ds.Tables[0].Rows[0]["time0"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["time0"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.zcbao.Parent.FindControl("time0"), dt); Util.SetControlValue(this.zcbao.Parent.FindControl("time0_1"), dt); } if (ds.Tables[0].Rows[0]["status"] != DBNull.Value) { string st = ds.Tables[0].Rows[0]["statusText"].ToString(); Util.SetControlValue(this.zcbao.Parent.FindControl("status"), st); Util.SetControlValue(this.zcbao.Parent.FindControl("status_1"), st); } if (ds.Tables[0].Rows[0]["clsj"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["clsj"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.zcbao.Parent.FindControl("clsj"), dt); Util.SetControlValue(this.zcbao.Parent.FindControl("clsj_1"), dt); } if (ds.Tables[0].Rows[0]["xdri"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["xdri"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.zcbao.Parent.FindControl("xdri"), dt); Util.SetControlValue(this.zcbao.Parent.FindControl("xdri_1"), dt); } if (ds.Tables[0].Rows[0]["dkffrq1"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["dkffrq1"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.zcbao.Parent.FindControl("dkffrq1"), dt); Util.SetControlValue(this.zcbao.Parent.FindControl("dkffrq1_1"), dt); } if (ds.Tables[0].Rows[0]["xcyqrq"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["xcyqrq"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.zcbao.Parent.FindControl("xcyqrq"), dt); Util.SetControlValue(this.zcbao.Parent.FindControl("xcyqrq_1"), dt); } if (ds.Tables[0].Rows[0]["jrblsj"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["jrblsj"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.zcbao.Parent.FindControl("jrblsj"), dt); Util.SetControlValue(this.zcbao.Parent.FindControl("jrblsj_1"), dt); } } ds.Dispose(); this.bj.Text = PubComm.GetNumberFormat(this.bj.Text); //设置按钮的权限 string user1 = this.zeren.Text; if (user1 == User.Identity.Name || (user1.Trim() == "" && PubComm.IsRole("系统管理员"))) { this.but0.Visible = true; } else { this.but0.Visible = false; } //设置控件数据的显示 if (user1 == User.Identity.Name || (user1.Trim() == "" && PubComm.IsRole("系统管理员"))) { //for (int i = 0; i < arr1.Length; i++) //{ // if (this.zcbao.Parent.FindControl(arr1[i] + "_1") != null) // { // //设置对应的标签提示信息 // this.zcbao.Parent.FindControl(arr1[i] + "_1").Visible = false; // } //} //for (int i = 0; i < arr2.Length; i++) //{ // if (this.zcbao.Parent.FindControl(arr2[i] + "_1") != null) // { // //设置对应的标签提示信息 // this.zcbao.Parent.FindControl(arr2[i] + "_1").Visible = false; // } //} } else { //for (int i = 0; i < arr1.Length; i++) //{ // if (this.zcbao.Parent.FindControl(arr1[i]) != null) // { // //设置对应的标签提示信息 // this.zcbao.Parent.FindControl(arr1[i]).Visible = false; // } //} //for (int i = 0; i < arr2.Length; i++) //{ // if (this.zcbao.Parent.FindControl(arr2[i]) != null) // { // //设置对应的标签提示信息 // this.zcbao.Parent.FindControl(arr2[i]).Visible = false; // } //} } if (PubComm.IsRole("公司领导") || PubComm.IsRole("评审部角色")) { this.zcbao.Parent.FindControl("zhuang_1").Visible = true; } else { this.zcbao.Parent.FindControl("zhuang_1").Visible = false; } }
private void BindData() { if (Request["zcid"] != null) { string id = Request["zcid"]; U_ZCBU zc1 = new U_ZCBU(); DataSet ds = zc1.GetDetailByID(id); zc1.Close(); if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < arr1.Length; i++) { Util.SetControlValue(this.zzjg.Parent.FindControl(arr1[i]), ds.Tables[0].Rows[0][arr1[i]]); } if (ds.Tables[0].Rows[0]["clsj"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["clsj"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.zzjg.Parent.FindControl("clsj"), dt); } if (ds.Tables[0].Rows[0]["xdri"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["xdri"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.zzjg.Parent.FindControl("xdri"), dt); } if (ds.Tables[0].Rows[0]["dkffrq1"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["dkffrq1"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.zzjg.Parent.FindControl("dkffrq1"), dt); } if (ds.Tables[0].Rows[0]["dkffrq2"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["dkffrq2"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.zzjg.Parent.FindControl("dkffrq2"), dt); } if (ds.Tables[0].Rows[0]["htdqr"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["htdqr"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.zzjg.Parent.FindControl("htdqr"), dt); } if (ds.Tables[0].Rows[0]["xcyqrq"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["xcyqrq"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.zzjg.Parent.FindControl("xcyqrq"), dt); } if (ds.Tables[0].Rows[0]["jrblsj"] != DBNull.Value) { string dt = DateTime.Parse(ds.Tables[0].Rows[0]["jrblsj"].ToString()).ToString("yyyy-MM-dd"); Util.SetControlValue(this.zzjg.Parent.FindControl("jrblsj"), dt); } //设置数字金额的显示 string[] num1 = new string[] { "dkye", "zjycszje" }; for (int i = 0; i < num1.Length; i++) { Label l1 = this.dkye.Parent.FindControl(num1[i]) as Label; if (l1 != null) { l1.Text = PubComm.GetNumberFormat(l1.Text); } } } ds.Dispose(); } }