protected void Page_Load(object sender, EventArgs e) { if (!Ext.IsAjaxRequest) { #region 初始化单位 MainDeptStore.DataSource = PublicCode.GetMaindept(""); MainDeptStore.DataBind(); if (SessionBox.GetUserSession().rolelevel.Contains("1") || SessionBox.GetUserSession().rolelevel.Contains("0")) { cbbKQ.Disabled = true; cbbPerson.Disabled = true; } else { cbbMianDept.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber; cbbMianDept.Disabled = true; KQStore.DataSource = PublicCode.GetKQdept(SessionBox.GetUserSession().DeptNumber); KQStore.DataBind(); cbbPerson.Disabled = true; } #endregion } }
protected void Page_Load(object sender, EventArgs e) { if (!Ext.IsAjaxRequest) { UserHandle.InitModule(this.PageTag); //初始化此模块的权限。 if (UserHandle.ValidationHandle(PermissionTag.Browse)) //是否有浏览权限 { dfBegin.SelectedDate = System.DateTime.Today.AddDays(1 - System.DateTime.Today.Day); dfEnd.SelectedDate = System.DateTime.Today; //dfBegin.MaxDate = System.DateTime.Today; //dfEnd.MaxDate = System.DateTime.Today; #region 初始化单位 MainDeptStore.DataSource = PublicCode.GetMaindept(""); MainDeptStore.DataBind(); KQStore.DataSource = PublicCode.GetKQdept(SessionBox.GetUserSession().DeptNumber); KQStore.DataBind(); if (SessionBox.GetUserSession().rolelevel.Contains("1") || SessionBox.GetUserSession().rolelevel.Contains("0")) { cbbKQ.Disabled = true; } else { cbbMianDept.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber; cbbMianDept.Disabled = true; } #endregion //LoadData(); if (UserHandle.ValidationHandle(PermissionTag.SearchAll)) { cbbMianDept.Disabled = false; cbbKQ.Disabled = false; btnSearch.Disabled = false; } else if (UserHandle.ValidationHandle(PermissionTag.SearchMainDept)) { cbbMianDept.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber; cbbMianDept.Disabled = true; cbbKQ.Disabled = false; btnSearch.Disabled = false; } else if (UserHandle.ValidationHandle(PermissionTag.SearchDept)) { cbbMianDept.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber; cbbMianDept.Disabled = true; cbbKQ.SelectedItem.Value = PublicCode.GetKQdeptNumber(SessionBox.GetUserSession().PersonNumber); cbbKQ.Disabled = true; btnSearch.Disabled = false; } else if (UserHandle.ValidationHandle(PermissionTag.SearchPersonal)) { cbbMianDept.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber; cbbMianDept.Disabled = true; cbbKQ.SelectedItem.Value = PublicCode.GetKQdeptNumber(SessionBox.GetUserSession().PersonNumber); cbbKQ.Disabled = true; btnSearch.Disabled = false; } else { btnSearch.Disabled = true; } } else { Session["ErrorNum"] = "0"; Response.Redirect("~/Error.aspx"); } } }