protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { PubComm.SetDepart(this.depart, ""); DataRow dr1 = null; if (Request["id"] != null) { dr1 = DangAnBU.GetAdmin(Request["id"]); if (dr1 != null) { this.num.Text = dr1["num"].ToString().Trim(); if (this.depart.Items.FindByValue(dr1["depart"].ToString().Trim()) != null) { this.depart.SelectedValue = dr1["depart"].ToString().Trim(); } } } this.SetUserList(); if (dr1 != null) { if (this.sname.Items.FindByValue(dr1["sname"].ToString().Trim()) != null) { this.sname.SelectedValue = dr1["sname"].ToString().Trim(); } } } }
protected void Button1_Click(object sender, EventArgs e) { if (this.FileUpload1.FileBytes.Length > 0) { String fileName = this.FileUpload1.FileName; String savefileName = fileName + "_" + Page.User.Identity.Name + "_" + DateTime.Now.ToString(); savefileName = PubComm.GetMd5(savefileName) + ".data"; ///////////////////////////////////////// this.FileUpload1.SaveAs(Server.MapPath("~/Common/AttachFiles/" + savefileName)); ///////////////////////////////////////// CommTable comm1 = new CommTable(); comm1.TabName = "U_CZFile"; Hashtable ht = new Hashtable(); ht["czid"] = Request["id"]; ht["FileName"] = savefileName; ht["trueName"] = fileName; comm1.InsertData(ht); comm1.Close(); Response.Redirect(Request.PathInfo, true); } else { JSJ.SysFrame.Util.alert(this.Page, "请点浏览选择一个要上传的文件!"); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.QueryString["kind"] != null && Request.QueryString["kind"] == "31") { U_ZCBU zc1 = new U_ZCBU(); zc1.SetUserKind(Request.QueryString["id"], "31", ""); zc1.Close(); PubComm.ShowInfo("提示:清除用户自定义分类操作成功!", Application["root"] + "/ZcMng1/FixZcUserKind.aspx"); } else if (Request.QueryString["kind"] != null && Request.QueryString["kind"] == "32") { U_ZCBU zc1 = new U_ZCBU(); zc1.SetUserKind(Request.QueryString["id"], "32", ""); zc1.Close(); PubComm.ShowInfo("提示:清除用户自定义分类操作成功!", Application["root"] + "/ZcMng1/MyFixZcUserKind.aspx"); } else { U_ItemBU item = new U_ItemBU(); item.Setuserkind(this.userkind); item.Close(); if (this.userkind.Items.Count > 0) { this.userkind.SelectedIndex = 0; } } } }
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;"; } } }
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { Label lab1 = e.Row.FindControl("bname") as Label; if (lab1 != null) { if (lab1.Text == "合计") { Label lab2 = e.Row.FindControl("Liulan") as Label; if (lab2 != null) { lab2.Text = ""; } } } LinkButton link1 = e.Row.FindControl("dellinBtn") as LinkButton; if (link1 != null) { if (PubComm.IsRole("系统管理员") == false || (lab1 != null && lab1.Text == "合计")) { link1.Visible = false; } } }
protected void SaveDataClick(object sender, EventArgs e) { Hashtable ht = new Hashtable(); string[] arr1 = new string[] { "bill", "billtime", "bname", "bzeren", "remark", "billmen", "fee1", "fee2", "fee3", "fee4", "fee5", "fee6", "fee7", "fee8", "fee9", "fee10", "fee11", "fee12" }; for (int i = 0; i < arr1.Length; i++) { object obj1 = Util.GetControlValue(this.billmen.Parent.FindControl(arr1[i])); if (obj1 != null && obj1.ToString().Trim() != "") { ht.Add(arr1[i], obj1); } } ht.Add("bid", Request.QueryString["bid"]); try { CW_Pay1BU Pay1 = new CW_Pay1BU(); bool result = Pay1.InsertData(ht); Pay1.Close(); if (result) { PubComm.ShowInfo("【增加支出单据】操作成功!", Application["root"] + "/Caiwu/ZcBaoSearch.aspx"); } } catch { PubComm.ShowInfo("【增加支出单据】操作失败,可能的原因是单据编号重复,请重新输入!", Request.RawUrl); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { PubComm.SetDepart(this.depart, "所有部门"); ///////////////////////////////////// ; this.depart.SelectedValue = ""; /////////////////////////////////////// U_ItemBU item1 = new U_ItemBU();; item1.ItemName = "行政区域"; item1.SetLiteralControl(this.quyu, "全部..."); item1.ItemName = "行业分类"; item1.SetLiteralControl(this.hangye, "全部..."); item1.SetStatus(this.jzdc, "尽职调查"); item1.SetStatus(this.fasp, "方案审批"); item1.SetStatus(this.fazx, "方案执行"); item1.Close(); U_ZCBAOBU zcb1 = new U_ZCBAOBU(); zcb1.SetBstatus(this.Bstatus, "全部..."); zcb1.Close(); //////////////////////////////////////////// depart_SelectedIndexChanged(this.depart, e); } }
/// <summary> /// 提交部门审批 /// </summary> /// <param name="id"></param> private void SehenPiForBumen(String id, String dotime1) { if (this.piyue1.SelectedValue == String.Empty) { Util.alert(this.Page, "错误:请选择一个审批意见!"); } else { Hashtable ht = new Hashtable(); ht["remark"] = this.remark.Text.Trim(); ht["zeren"] = User.Identity.Name; if (String.IsNullOrEmpty(dotime1)) { ht["time1"] = DateTime.Now.ToString(); } else { ht["time1"] = dotime1; } ht["ps"] = this.piyue1.SelectedValue; U_ZCSPBU sp1 = new U_ZCSPBU(); String czid = ""; string info1 = sp1.PiYueZcForOffice(id, ht, out czid); sp1.Close(); PubComm.ShowInfo(info1, Application["root"] + "/ZcMng3/EditSbb.aspx?id=" + czid + "&menuIndex=5"); } }
/// <summary> /// 办公室编号 /// </summary> /// <param name="id"></param> private void SehenPiForBanGongShiZhuRen(String id, String dotime1) { if (this.xmsbh.Text == String.Empty) { Util.alert(this.Page, "错误:请输入项目申报号!"); } else { Hashtable ht = new Hashtable(); ht["remark"] = this.remark.Text.Trim(); ht["zeren"] = User.Identity.Name; if (String.IsNullOrEmpty(dotime1)) { ht["time1"] = DateTime.Now.ToString(); } else { ht["time1"] = dotime1; } ht["ps"] = "同意"; ht["xmsbh"] = this.xmsbh.Text; //项目申报号 ht["czid"] = ViewState["czid"].ToString(); //项目的ID U_ZCSPBU sp1 = new U_ZCSPBU(); String czid = ViewState["czid"].ToString(); string info1 = sp1.PiYueZcForSHWeiYuan(id, ht); sp1.Close(); PubComm.ShowInfo(info1, Application["root"] + "/ZcMng3/EditSbb.aspx?id=" + czid + "&menuIndex=5"); } }
//保存支出单据 protected void SaveDataClick(object sender, EventArgs e) { this.SetDataSource(); Hashtable ht = new Hashtable(); string[] arr1 = new string[] { "bill", "billtime", "danwei", "zeren", "remark", "billmen" }; for (int i = 0; i < arr1.Length; i++) { ht.Add(arr1[i], Util.GetControlValue(this.billmen.Parent.FindControl(arr1[i]))); } ht.Add("zcid", Request.QueryString["zcid"]); DataSet ds = (DataSet)ViewState["DataSource"]; try { CW_InStockBU stock1 = new CW_InStockBU(); bool result = stock1.InsertData(ht, ds); stock1.Close(); if (result) { PubComm.ShowInfo("【增加入库单据】操作成功!", Application["root"] + "/Caiwu/ZcSearch.aspx"); } } catch { PubComm.ShowInfo("【增加入库单据】操作失败,可能的原因是单据编号重复,请重新输入!", Request.RawUrl); } }
//更新案卷信息 protected void Button1_Click(object sender, EventArgs e) { Hashtable ht = new Hashtable(); foreach (string item in arr0) { ht[item] = Util.GetControlValue(this.ajnum.Parent.FindControl(item)); } bool check = true; ///////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////// if (check) { try { DA_AnJuanBU anjuan1 = new DA_AnJuanBU(); anjuan1.UpdateAnJuanData(Request["id"], ht); anjuan1.Close(); string url1 = Application["root"] + "/DangAn/AnJuanWeiHu.aspx"; PubComm.ShowInfo("操作提示:更新资料成功!", Request.RawUrl); } catch { Util.alert(this.Page, "错误提示:更新案卷数据失败,可能的原因是数据类型有错误!"); } } }
//控制链接的显示 protected void Repeater_DataBound(object sernder, RepeaterItemEventArgs e) { if (e.Item.FindControl("butDel") != null) { LinkButton but1 = e.Item.FindControl("butDel") as LinkButton; LinkButton but2 = e.Item.FindControl("butEdit") as LinkButton; Label lab1 = e.Item.FindControl("status") as Label; if (this.owner == false) { but1.Visible = false; but2.Visible = false; } if (PubComm.IsRole(User.Identity.Name, "系统管理员")) { but1.Visible = true; } else { but1.Visible = false; } string user1 = this.zeren.Text; if ((PubComm.IsRole(User.Identity.Name, "系统管理员") || user1 == User.Identity.Name) && lab1.Text == "") { but2.Visible = true; } else { but2.Visible = false; } } }
//控制-资产处置中按钮的权限 protected void Repeater6_ItemDataBound(object sender, RepeaterItemEventArgs e) { int status1 = 0; if (this.status.Text != "") { status1 = Int32.Parse(this.status.Text); } bool zcstatus = false; if (status1 == (int)SP.开始审批) { zcstatus = true; } string[] ArrCon = new string[] { "AddZcczfs", "butDel", "butEdit" }; for (int i = 0; i < ArrCon.Length; i++) { if (e.Item.FindControl(ArrCon[i]) != null) { e.Item.FindControl(ArrCon[i]).Visible = (this.owner && zcstatus); } } if (PubComm.IsRole("系统管理员")) { for (int i = 0; i < ArrCon.Length; i++) { if (e.Item.FindControl(ArrCon[i]) != null) { e.Item.FindControl(ArrCon[i]).Visible = true; } } } }
//设置资产责任人 protected void Button1_Click(object sender, EventArgs e) { if (this.zeren.SelectedValue == "") { Util.alert(this.Page, "错误提示:请选择一个责任人!"); } else { U_ZCBU zc1 = new U_ZCBU(); String kind = "0"; if (String.IsNullOrEmpty(Request.QueryString["renkind"]) == false) { kind = Request.QueryString["renkind"]; } bool check1 = zc1.SetZeren(Request["id"], this.zeren.SelectedValue, kind); zc1.Close(); string info = null; if (check1) { info = "提示:成功地将资产的责任人设置为【" + this.zeren.SelectedValue + "】!"; } else { info = "提示:设置资产责任人操作失败!"; } string url = Application["root"] + "/ZcMng1/ZiChangFengPei.aspx"; if (Request["ReturnUrl"] != null && Request["ReturnUrl"] != "") { url = Request["ReturnUrl"]; } PubComm.ShowInfo(info, url); } }
//设置按钮的显示权限 private void SetButton() { if (owner) { string status = this.status.Text; if (status == "") { status = "00"; } int Max1 = Int32.Parse(status) + 1; string[] arr1 = new string[] { "01", "02", "03", "04" }; for (int i = 0; i < arr1.Length; i++) { HtmlGenericControl but1 = this.Button01.Parent.FindControl("but" + arr1[i]) as HtmlGenericControl; if (int.Parse(arr1[i]) <= Max1) { but1.Visible = true; } else { but1.Visible = true; } } } if (PubComm.IsRole("系统管理员")) { this.Button5.Visible = true; } else { this.Button5.Visible = false; } }
//选择修改部门 protected void depart_SelectedIndexChanged(object sender, EventArgs e) { string depart1 = this.depart.SelectedValue; PubComm.SetZeRen(this.zeren, depart1, "所有责任人"); this.zeren.SelectedValue = ""; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { PubComm.SetDepart(this.depart, "所有部门"); ///////////////////////////////////// ; this.depart.SelectedValue = ""; /////////////////////////////////////// U_ItemBU item1 = new U_ItemBU();; item1.ItemName = "行政区域"; item1.SetLiteralControl(this.quyu, "全部..."); item1.ItemName = "行业分类"; item1.SetLiteralControl(this.hangye, "全部..."); item1.ItemName = "资产性质分类"; item1.SetLiteralControl(this.fenlei, "全部..."); item1.Setuserkind(this.userkind); item1.Close(); //////////////////////////////////////////// depart_SelectedIndexChanged(this.depart, e); } }
protected void Button1_Click(object sender, EventArgs e) { if (Page.IsValid) { Hashtable ht = new Hashtable(); ht["remark"] = this.remark.Text.Trim(); ht["zeren"] = User.Identity.Name; ht["time1"] = DateTime.Now.ToString(); ht["ps"] = this.piyue.SelectedValue; if (Request["bkind"].ToString() == "0") { U_ZCSPBU sp1 = new U_ZCSPBU(); string info1 = sp1.PiYueZcForSH1(ViewState["id"].ToString(), ht); sp1.Close(); PubComm.ShowInfo(info1, Application["root"] + "/ZcMng2/ZcDetail3.aspx?id=" + ViewState["zcid"].ToString()); } else { U_ZCBSPBU sp2 = new U_ZCBSPBU(); string info2 = sp2.PiYueZcForSH1(ViewState["id"].ToString(), ht, ViewState["zcid"].ToString()); sp2.Close(); PubComm.ShowInfo(info2, Application["root"] + "/ZcMng2/ZcBaoDetail3.aspx?id=" + ViewState["zcid"].ToString()); } } }
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() { 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 spresult_SelectedIndexChanged(object sender, EventArgs e) { this.status1.Items.Clear(); PubComm.SetProfile(this.spresult.SelectedValue, this.status1, "请选择..."); this.status2.Items.Clear(); PubComm.SetProfile(this.status1.SelectedValue, this.status2, "请选择..."); }
/// <summary> /// 初始化代码 /// </summary> private void SetMyData() { PubComm.SetDepart(this.depart, "所有部门"); this.depart.SelectedValue = ""; string depart1 = this.depart.SelectedValue; PubComm.SetZeRen(this.zeren, depart1, ""); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { PubComm.SetDepart(this.depart, null); this.depart.SelectedIndex = 0; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { PubComm.SetDepart(this.depart, "所有部门"); this.depart.SelectedValue = ""; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { U_TimeTypeBU.SetLiteralControl(this.timename, ""); PubComm.SetTimeDays(tellday); this.time0.Attributes["onfocus"] = "javascript:setday(this);"; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { this.username.Text = User.Identity.Name; this.SetPageInfo(); this.SetPersonTime(); PubComm.Upgrade(); } }
bool owner = false; //资产责任人 protected void Page_Load(object sender, EventArgs e) { this.owner = PubComm.IsZcBaoMng(Request["id"], User.Identity.Name); if (!Page.IsPostBack) { Page.DataBind(); this.BindData(); this.BindSP(null); } }
protected void Button1_Click(object sender, EventArgs e) { U_ZCBU zc1 = new U_ZCBU(); zc1.SetBstatus(Request.QueryString["id"], this.Bstatus.SelectedValue); zc1.Close(); string info = "提示:资产打包操作成功!"; PubComm.ShowInfo(info, Application["root"] + "/ZcMng1/FixZcBao.aspx"); }
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.FindControl("dellinBtn") != null) { LinkButton link1 = (LinkButton)e.Row.FindControl("dellinBtn"); if (PubComm.IsRole("会计") == false) { link1.Visible = false; } } }
//资产审批的删除和批阅 protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.Item.FindControl("seldoc") != null) { string id = (e.Item.FindControl("seldoc") as Label).Text.Trim(); if (e.CommandName == "delete") { U_ZCSPBU sp1 = new U_ZCSPBU(); sp1.DelSp(id); this.BindSP(sp1); sp1.Close(); } else { Context.Items["zcid"] = Request.QueryString["id"]; Context.Items["id"] = id; Context.Items["kind"] = (e.Item.FindControl("kind") as Label).Text.Trim(); Context.Items["czid"] = this.zcczid.Text; //检测【审核委员会主席】和【决策委员会主席】能否审批 U_ZCSPBU sp2 = new U_ZCSPBU(); int nospcount = sp2.GetNoEndSPCount(Request.QueryString["id"]); sp2.Close(); bool check1 = false; string rolename = ""; if (this.status.Text == (int)SP.审核委员会审批 + "") { rolename = "审核委员会主席"; } if (this.status.Text == (int)SP.决策委员会审批 + "") { rolename = "决策委员会主席"; } if (rolename != "") { check1 = PubComm.IsRole(rolename); } if (check1 && nospcount > 1) { Util.alert(this.Page, "抱歉,您是【" + rolename + "】,请等其他委员审批结束后,才能审批"); } else { if (check1) { Context.Items["zhuxi"] = "1"; } Server.Transfer("PiYue" + (e.Item.FindControl("kind") as Label).Text.Trim() + ".aspx?bkind=0", false); } } } }