protected void Page_PreInit(object sender, EventArgs e) { try { if (Session["User"] == null) { Response.Write("<script language=javascript>parent.parent.location.href='../../WebUI/Start/SessionTimeOut.aspx';</script>"); return; } if (!IsPostBack) { InitLoading(); } string FormID = Request.QueryString["FormID"]; //權限 if (Context.User.Identity.Name.ToLower() == "administrator" || Context.User.Identity.Name.ToLower() == "supervisor") ViewState["Permission"] = "3333333330"; else { string cnkey = ""; if (Session["UserType"].ToString() == "EP") cnkey = Session["EnterpriseID"].ToString(); Js.BLL.Account.UserDal user = new Js.BLL.Account.UserDal(Context.User.Identity.Name, cnkey); ViewState["Permission"] = user.GetUserPermissionByFormID(FormID); } Js.BLL.Sys.SysManageDal dal = new Js.BLL.Sys.SysManageDal(); DataTable dt = dal.GetSysEmptyRecord(); DataRow dr = dt.NewRow(); dr["UserType"] = Session["UserType"].ToString(); dr["UserName"] = Session["User"].ToString(); dr["PersonName"] = Session["User"].ToString(); dr["OpDate"] = DateTime.Now; dr["FormID"] = Request.QueryString["FormID"] + ""; Js.BLL.Sys.TreeListDal tdal = new Js.BLL.Sys.TreeListDal(); Js.Model.Sys.TreeListInfo model = tdal.GetModel(dr["FormID"].ToString()); if(Session["language_session"].ToString().ToLower()=="zh-tw") dr["FormName"] = model.Text; else if (Session["language_session"].ToString().ToLower() == "zh-cn") dr["FormName"] = model.Text_cn; else dr["FormName"] = model.Text_en; dr["ActionState"] = ""; //dr["IP"] = HttpContext.Current.Request.UserHostAddress; dr["IP"] = Page.Request.UserHostAddress; dal.InsertSysRrecord(dr); } catch(Exception ex) { } }
protected void Page_Load(object sender, EventArgs e) { if (Session["cnKey"] != null) cnKey = Session["cnKey"].ToString(); Js.BLL.Sys.TreeListDal dal = new Js.BLL.Sys.TreeListDal(cnKey); string UserType = Session["UserType"].ToString(); string filter = ""; if (UserType == "BU") filter = "SysID<11 and FormID<>'EP_UserPwdUpdate'"; //else if (UserType == "EP") // filter = "(SysID=0 or SysID=3 Or PrintPrefix='EP')"; else filter = " 1=1"; dt = dal.GetLeftBar(filter, Session["language_session"].ToString()); string preModuleName = ""; string preSubModuleName = ""; Table tbModule = null; Panel pSubModule = null; int index = 0; foreach (DataRow dr in dt.Rows) { string currentModuleName = dr["ParentTitle"].ToString(); string currentSubModuleName = dr["Text"].ToString(); string url = dr["Url"].ToString() + "?FormID=" + dr["FormID"].ToString(); string image = dr["ImageUrl"].ToString(); string ParentImage = dr["ParentImageUrl"].ToString(); string ModuleID = dr["ID"].ToString(); if (preModuleName != currentModuleName) { preModuleName = currentModuleName; preSubModuleName = currentSubModuleName; //string parentCode = dr["MenuCode"].ToString().Substring(0, 8); tbModule = this.CreateModuleTable(preModuleName, ParentImage); tbModule.ID = "table" + index.ToString(); this.plMenu.Controls.Add(tbModule); pSubModule = new Panel(); // pSubModule.Height = 50; pSubModule.ID = "div" + index.ToString(); pSubModule.Attributes.Add("style", "display:none;"); tbModule.Attributes.Add("onclick", "Display('" + index.ToString() + "');"); this.plMenu.Controls.Add(pSubModule); pSubModule.Controls.Add(CreateSubModuleTable(preModuleName, preSubModuleName, url, image, "tab_" + ModuleID)); } else { if (preSubModuleName != currentSubModuleName) { preSubModuleName = currentSubModuleName; pSubModule.Controls.Add(CreateSubModuleTable(preModuleName, preSubModuleName, url, image, "tab_" + ModuleID)); } } index++; } //tbModule = CreateModuleTable("退出系统", ""); //tbModule.ID = "table" + index.ToString(); //pSubModule = new Panel(); //this.plMenu.Controls.Add(tbModule); //pSubModule = new Panel(); //pSubModule.ID = "div" + index.ToString(); //pSubModule.Attributes.Add("style", "display:none;"); //pSubModule.Controls.Add(CreateLogoutTable()); //tbModule.Attributes.Add("onclick", "Display('" + index.ToString() + "');"); //this.plMenu.Controls.Add(pSubModule); //操作权限保存Sesion中(ModuleID,OperatorCode,MenuCode) //dt.Columns.Remove("MenuImage"); //dt.Columns.Remove("MenuUrl"); //dt.Columns.Remove("MenuTitle"); //dt.Columns.Remove("MenuParent"); //Session["DT_UserOperation"] = dt; }
private void frmSelect_Load(object sender, EventArgs e) { Js.BLL.Sys.TreeListDal dal = new Js.BLL.Sys.TreeListDal(); Js.Model.Sys.TreeListInfo model = dal.GetModel(FormID); KeyName = model.KeyField; BindComboBox(); this.cmbField.SelectedIndex = 0; SetBtnEnabled(""); SetColumn(); }