using System; using System.Data; using System.Text; using System.Threading; using CMSC.Class; using CMSC.Class.CsSubs; using CMSC.OA.Web.Com.Class; using CMSC.OA.Dal.Sys.Base; namespace CMSC.OA.Web.Com.Select { public partial class SelectUser : CsPageLayer { private string SysCode = ""; private string PageFrame = ""; private string BackObject = ""; private string BackEvent = ""; private string BackRow = ""; private TabBar LeftTabBar = new TabBar("LeftTabBar"); protected void Page_Load(object sender, EventArgs e) { try { this.PagePermit = "FreeView"; this.LoginUser = Com_Sys.GetLoginUser(PageCookie); this.PageLoadData(); this.BigTitle = false; this.LayerTitleBar.TitleName = "选择员工"; this.AddScriptFile("table.js"); this.AddScriptFile("dtree.js"); this.PageSplit = true; this.PageSplitWidth = 200; this.CreatePage(); } catch (ThreadAbortException) { } catch (Exception ex) { LoadTip.TipText = ex.Message; LoadTip.CloseLayer("SelectUser"); Response.Write(LoadTip.SetScriptHtml()); Response.End(); } } #region 页面加载 private void PageLoadData() { #region PageLoadData if (Request["pageframe"] == null || Request["pageframe"].ToString().Trim() == "") throw new Exception("获取Request参数数据为Null或空值"); if (Request["obj"] == null || Request["obj"].ToString().Trim() == "") throw new Exception("获取Request参数数据为Null或空值"); if (Request["fn"] == null || Request["fn"].ToString().Trim() == "") throw new Exception("获取Request参数数据为Null或空值"); PageFrame = Request["pageframe"].ToString().Trim(); BackObject = Request["obj"].ToString().Trim(); BackEvent = Request["fn"].ToString().Trim(); BackRow = Request["row"].ToString().Trim(); if (Request["syscode"] != null && Request["syscode"].ToString().Trim() != "") { SysCode = Request["syscode"].ToString().Trim(); } else { SysCode = this.GetSysCodeByPagePermit("Sys_Base_User_View"); } #endregion } protected override void SetMenusBar() { #region SetMenusBar this.LayerTitleBar.PageMenusBar.Add(new string[] { "ico", "add.gif", "" }); this.LayerTitleBar.PageMenusBar.Add(new string[] { "link", "添加新员工", "javascript:addUser();" }); this.LayerTitleBar.PageMenusBar.Add(new string[] { "split", "", "" }); this.LayerTitleBar.PageMenusBar.Add(new string[] { "ico", "edit.gif", "" }); this.LayerTitleBar.PageMenusBar.Add(new string[] { "link", "编辑", "javascript:editUser();" }); this.LayerTitleBar.PageMenusBar.Add(new string[] { "split", "", "" }); this.LayerTitleBar.PageMenusBar.Add(new string[] { "ico", "del.gif", "" }); this.LayerTitleBar.PageMenusBar.Add(new string[] { "link", "禁用", "javascript:delUser();" }); #endregion } protected override StringBuilder SetHtml() { #region SetHtml StringBuilder html = new StringBuilder(); html.Append(@"<iframe id=""ListFrame"" name=""ListFrame"" class=""mainfrm"" src=""SelectUser_List.aspx?pageframe=" + PageFrame + @"&obj=" + BackObject + @"&fn=" + BackEvent + @"&row=" + BackRow + @"&syscode=" + SysCode + @""" "); html.Append(@"marginwidth=""0"" marginheight=""0"" frameBorder=""0"" scrolling=""no""></iframe>"); return html; #endregion } protected override StringBuilder SetLeftHtml() { #region SetLeftHtml StringBuilder treehtml = new StringBuilder(); treehtml.Append(@"<table width=""100%"" height=""100%"" cellpadding=""0"" cellspacing=""0"" border=""0"">"); treehtml.Append(@"<tr height=""100%""><td valign=""top"" class=""tabframe"">"); treehtml.Append(@"<div id=""ScrollTree"" class=""scrolldiv"">"); treehtml.Append(Com_Sys.GetOrgTreeList(0, LoginUser.RootCode, "SelectUser_List.aspx?pageframe=" + PageFrame + @"&obj=" + BackObject + @"&fn=" + BackEvent + @"&row=" + BackRow + @"&syscode=", "ListFrame")); treehtml.Append(@"</div>"); treehtml.Append(@"</td></tr>"); treehtml.Append(@"</table>"); StringBuilder filthtml = new StringBuilder(); filthtml.Append(@"<table width=""100%"" height=""100%"" cellpadding=""0"" cellspacing=""0"" border=""0"">"); filthtml.Append(@"<tr height=""100%""><td valign=""top"" class=""tabframe"">"); filthtml.Append(SetSearchHtml()); filthtml.Append(@"</td></tr>"); filthtml.Append(@"</table>"); LeftTabBar.AddItem(1, "分类", treehtml, true); LeftTabBar.AddItem(2, "搜索", filthtml, false); return LeftTabBar.BoxHtml(); #endregion } private StringBuilder SetSearchHtml() { #region SetSearchHtml StringBuilder html = new StringBuilder(); html.Append(@"<form id=""SearchForm"" name=""SearchForm"" method=""get"" action=""SelectUser_List.aspx"" target=""ListFrame"">"); html.Append(@"<input type=""hidden"" name=""subflag"" value=""0"" />"); html.Append(@"<input type=""hidden"" name=""searchmode"" value=""1"" />"); html.Append(@"<input type=""hidden"" name=""syscode"" value=""" + SysCode + @""" />"); html.Append(@"<input type=""hidden"" name=""pageframe"" value=""" + PageFrame + @""" />"); html.Append(@"<input type=""hidden"" name=""obj"" value=""" + BackObject + @""" />"); html.Append(@"<input type=""hidden"" name=""fn"" value=""" + BackEvent + @""" />"); html.Append(@"<input type=""hidden"" name=""row"" value=""" + BackRow + @""" />"); html.Append(@"<div class=""searchform"">"); html.Append(@"<div class=""title"">所属部门:</div>"); html.Append(@"<div class=""control""><select id=""syscode"" name=""syscode2"" class=""sselect"" onchange=""javascript:getJobList();"">"); html.Append(Com_Function.GetOrgListSelectOption(LoginUser.RootCode, LoginUser.RootCode, 1)); html.Append(@"</select></div>"); html.Append(@"<div class=""title"">所在职位:</div>"); html.Append(@"<div class=""control""><select id=""jobcode"" name=""jobcode"" class=""sselect"">"); html.Append(@"<option value="""">==不限==</option>"); html.Append(@"</select></div>"); html.Append(@"<div class=""title"">员工工号:</div>"); html.Append(@"<div class=""control""><input type=""text"" name=""usercode"" class=""sinput"" style=""150px;"" /></div>"); html.Append(@"<div class=""title"">个性帐号:</div>"); html.Append(@"<div class=""control""><input type=""text"" name=""username"" class=""sinput"" style=""150px;"" /></div>"); html.Append(@"<div class=""title"">真实姓名:</div>"); html.Append(@"<div class=""control""><input type=""text"" name=""truename"" class=""sinput"" style=""150px;"" /></div>"); html.Append(@"<div class=""title"">联系方式:</div>"); html.Append(@"<div class=""control""><input type=""text"" name=""contact"" class=""sinput"" style=""150px;"" /></div>"); html.Append(@"<div class=""title"">用户类型:</div>"); html.Append(@"<div class=""control""><select name=""userflag"" class=""sselect"">"); html.Append(@"<option value="""">==不限==</option>"); html.Append(@"<option value=""0"">真实员工</option>"); html.Append(@"<option value=""1"">虚拟用户</option>"); html.Append(@"</select></div>"); html.Append(@"<div class=""title"">允许登录:</div>"); html.Append(@"<div class=""control""><select name=""issysuser"" class=""sselect"">"); html.Append(@"<option value="""">==不限==</option>"); html.Append(@"<option value=""0"">否</option>"); html.Append(@"<option value=""1"">是</option>"); html.Append(@"</select></div>"); html.Append(@"<div class=""button""><input type=""image"" src=""/inc/inc/btn_ok.jpg"" border=""0""/></div>"); html.Append(@"<div class=""errinfo""></div>"); html.Append(@"</div>"); html.Append(@"</form>"); return html; #endregion } protected override StringBuilder SetEndHtml() { #region SetEndHtml StringBuilder html = new StringBuilder(); HiddenForm hf = new HiddenForm(0, "GetPostBackForm", "post"); hf.Action = "/Com/Get/GetJobListBySysCode.aspx"; hf.Target = "HiddenFrame"; hf.AddFormItem("getsyscode", ""); hf.AddFormItem("pageframe", "SelectUserFrame"); html.Append(hf.BoxHtml()); return html; #endregion } protected override StringBuilder EndScript() { #region EndScript StringBuilder js = new StringBuilder(); js.Append(Com_Sys.TreeClickScript()); js.Append(LeftTabBar.TabBarScript()); js.Append(@"var CMSCPageSplit = CMSC.PageSplit();"); js.Append(@"var win = CMSC.$$(""ListFrame"").contentWindow;"); js.Append(@"function selectUser() {win.selectUser();}"); js.Append(@"function addUser() {win.addUser();}"); js.Append(@"function editUser() {win.editUser();}"); js.Append(@"function delUser() {win.delUser();}"); js.Append(@"function searchList() {win.searchList();}"); js.Append(@"function getJobList() {"); js.Append(@"var frmobj = CMSC.$$(""SearchForm"");"); js.Append(@"var syscode = frmobj.syscode2.value;"); js.Append(@"var getfrmobj = CMSC.$$(""GetPostBackForm"");"); js.Append(@"getfrmobj.getsyscode.value=syscode;"); js.Append(@"getfrmobj.submit();"); js.Append(@""); js.Append(@"}"); return js; #endregion } #endregion } }