private void SetPageData() { if (Request["tcid"] != null) { U_ZCTimeBU time1 = new U_ZCTimeBU(); Hashtable ht = time1.GetTimeDataByID(Request["tcid"]); time1.Close(); if (ht.Count > 0) { foreach (string item in arr1) { Util.SetControlValue(this.timename.Parent.FindControl(item), ht[item]); } } if (this.time0.Text != "" && this.time0.Text != null) { this.time0.Text = DateTime.Parse(this.time0.Text).ToString("yyyy-M-d"); } string sName = ""; string zcid = ht["zcid"].ToString(); U_ZCBU zc1 = new U_ZCBU(); DataSet ds2 = zc1.GetDetailByID(zcid); if (ds2.Tables[0].Rows.Count > 0) { sName = ds2.Tables[0].Rows[0]["danwei"].ToString(); } zc1.Close(); this.hidCorp.Value = sName; this.HiddenField1.Value = ht["zcid"].ToString(); } }
//增加资产时效 protected void Button1_Click(object sender, EventArgs e) { if (Page.IsValid) { bool check = true; Hashtable ht = new Hashtable(); foreach (string item in arr1) { ht.Add(item, Util.GetControlValue(this.timename.Parent.FindControl(item))); } if (ht["time0"].ToString().Trim() == "") { ht.Remove("time0"); } ht["ZCID"] = Request["parentid"]; ///////////////////////////////////////////////////// if (check) { U_ZCTimeBU time1 = new U_ZCTimeBU(); string err1 = time1.InsertTimeData(ht); time1.Close(); if (err1 == null) { Response.Redirect("ZcDetail6.aspx?id=" + Request["parentid"], true); } else { Util.alert(this.Page, err1); } } } }
//Bind data private void BindData(string danwei) { U_ZCTimeBU time1 = new U_ZCTimeBU(); DataSet ds1 = time1.GetMyDepartTimeList(User.Identity.Name, danwei); this.GridView1.DataSource = ds1; this.GridView1.DataBind(); time1.Close(); ds1.Dispose(); }
private void BindData(U_ZCTimeBU time1) { if (Request["id"] != null) { DataSet ds1 = time1.GetTimeListByParentID(Request["id"]); this.Repeater1.DataSource = ds1; this.Repeater1.DataBind(); ds1.Dispose(); } }
private void BindData(U_ZCTimeBU time1) { if (Request["id"] != null) { DataSet ds1 = time1.GetTimeListByParentID(Request["id"]); foreach (DataRow dr1 in ds1.Tables[0].Rows) { dr1["TimeName"] = U_TimeTypeBU.GetTimeNameByCode(dr1["TimeName"].ToString()); } this.Repeater1.DataSource = ds1; this.Repeater1.DataBind(); ds1.Dispose(); } }
void AdvanceSearch1_OnMySearchClick(object sender, EventArgs e) { ZcMng1_AdvanceSearch search1 = sender as ZcMng1_AdvanceSearch; if (search1 != null) { List <SearchField> list1 = search1.SearchConditon; U_ZCTimeBU time1 = new U_ZCTimeBU(); DataSet ds1 = time1.GetMyDepartTimeListInfo(list1, User.Identity.Name, this.danwei.Text.Trim()); this.GridView1.DataSource = ds1; this.GridView1.DataBind(); time1.Close(); ds1.Dispose(); } }
private void BindData() { List <SearchField> list1 = (List <SearchField>)ViewState["SearchCondition"]; U_ZCTimeBU zc1 = new U_ZCTimeBU(); TableRow row1 = new TableRow(); TableCell cell1 = new TableCell(); string[] arr1 = new string[] { "诉讼时效", "保证时效", "抵押时效", "执行时效" }; for (int i = 0; i < arr1.Length; i++) { DataSet ds1 = zc1.GetSXList1(list1, arr1[i]); if (ds1.Tables[0].Rows.Count > 0) { } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { U_RolesBU role1 = new U_RolesBU(); bool isLeader = role1.isRole(new String[] { "公司领导", "综合管理", "评审部角色" }); role1.Close(); if (isLeader) { Response.Redirect("~/ZcMng1/ZongHeSearch.aspx", true); } else { this.BindData(null); //设置时效警告、邮件、最新信息的提示数据 U_ZCTimeBU time1 = new U_ZCTimeBU(); DataSet ds1 = time1.GetMyTimeList(User.Identity.Name, null, 1); this.MyTimeCount.Value = ds1.Tables[0].Rows.Count + ""; time1.Close(); ZX_EmailBu email1 = new ZX_EmailBu(); this.MyEmail.Value = email1.GetNewMailCount() + ""; email1.Close(); ZX_InfoBU info1 = new ZX_InfoBU(); this.MyInfo.Value = info1.GetNewInfoCount() + ""; info1.Close(); if ((this.MyTimeCount.Value != "0" || this.MyEmail.Value != "0" || this.MyInfo.Value != "0") && Session["noReminder_" + User.Identity.Name] == null && Request.Cookies["noReminder_" + User.Identity.Name] == null) { string js = "StartReminder();"; if (!Page.ClientScript.IsStartupScriptRegistered("StartJS")) { Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "StartJS", js, true); } } } } this.AdvanceSearch1.SetDepartRow(false); this.AdvanceSearch1.OnMySearchClick += new EventHandler(AdvanceSearch1_OnMySearchClick); this.SearchControl1.SearchEvent += new EventHandler(SearchControl1_SearchEvent); }
private void BindData() { if (Request["id"] != null) { U_ZCTimeBU time1 = new U_ZCTimeBU(); DataSet ds1 = time1.GetTimeListByParentID(Request["id"]); this.Repeater1.DataSource = ds1; this.Repeater1.DataBind(); time1.Close(); ds1.Dispose(); string id = Request["id"]; U_ZCBU zc1 = new U_ZCBU(); DataSet ds = zc1.GetDetailByID(id, "danwei"); this.depart.Text = ds.Tables[0].Rows[0][0].ToString(); zc1.Close(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZX_EmailBu email1 = new ZX_EmailBu(); this.newmail.Text = email1.GetNewMailCount() + ""; email1.Close(); ZX_InfoBU info1 = new ZX_InfoBU(); this.newinfo.Text = info1.GetNewInfoCount() + ""; info1.Close(); U_ZCTimeBU time1 = new U_ZCTimeBU(); DataSet ds1 = time1.GetMyTimeList(User.Identity.Name, null, 1); this.MyTime.Text = ds1.Tables[0].Rows.Count + ""; ds1.Dispose(); time1.Close(); } }
protected void Repeater1_Command(object sender, RepeaterCommandEventArgs e) { if (e.Item.FindControl("infoid") != null) { Literal liter1 = e.Item.FindControl("infoid") as Literal; string timeid = liter1.Text; if (e.CommandName == "delete") { U_ZCTimeBU time1 = new U_ZCTimeBU(); time1.DelTimeData(timeid); this.BindData(time1); time1.Close(); } else { Response.Redirect("EditTime.aspx?tcid=" + timeid, true); } } }
//更新资料 protected void Button1_Click(object sender, EventArgs e) { if (Page.IsValid) { bool check = true; Hashtable ht = new Hashtable(); foreach (string item in arr1) { ht.Add(item, Util.GetControlValue(this.timename.Parent.FindControl(item))); } if (ht["time0"].ToString().Trim() == "") { //Util.alert(this.Page, "错误信息:时效日期不能为空!"); //check = false; ht.Remove("time0"); } if (check) { U_ZCTimeBU time1 = new U_ZCTimeBU(); string remark; int parentid = time1.EditTimeData(Request["tcid"], ht, out remark); time1.Close(); string title = String.Format("{0}已修改了{1}时效管理数据,请审阅", User.Identity.Name, this.hidCorp.Value); //发送邮件 if (remark != "") { Comm.SendMailToLeader(title, remark, Application["root"] + "/ZcMng2/ZcDetail1.aspx?id=" + this.HiddenField1.Value); } Response.Redirect("ZcDetail6.aspx?id=" + parentid, true); } } }