public static List<LabMS.Model.Function> GetManaFunctionByUserID(string strUserID) { List<LabMS.Model.UserRole> listuRole = new List<LabMS.Model.UserRole>(); LabMS.BLL.UserRole buRole = new LabMS.BLL.UserRole(); List<LabMS.Model.RoleFucntion> listRoleF = new List<LabMS.Model.RoleFucntion>(); LabMS.BLL.RoleFucntion bRoleF = new LabMS.BLL.RoleFucntion(); listuRole = buRole.GetModelList("UserID = " + strUserID); string strWhere = " 1<>1 "; foreach (LabMS.Model.UserRole ur in listuRole) { strWhere += " or RoleID = " + ur.RoleID.Value.ToString(); } listRoleF = bRoleF.GetModelList(strWhere); List<LabMS.Model.Function> listFunction = new List<LabMS.Model.Function>(); LabMS.BLL.Function bFunction = new LabMS.BLL.Function(); strWhere = " 1<>1 "; foreach (LabMS.Model.RoleFucntion rf in listRoleF) { strWhere += " or Code = '" + rf.FCode.ToString()+"'"; } listFunction = bFunction.GetModelList(strWhere); return listFunction; }
protected void Page_Load(object sender, EventArgs e) { strPagePrivilege.Add("JSGL"); strPageUserType.Add("mana"); if (!IsPostBack) { if (Request.QueryString["RoleId"] == null) { Common.JShelper.JSAlert(this.Page, "", "你无权查看此页面!"); } else { int RoleId = int.Parse(Request.QueryString["RoleId"].ToString()); InitBind(RoleId); } } int otherRoleId = int.Parse(Request.QueryString["RoleId"].ToString()); List<LabMS.Model.RoleFucntion> listRF = new List<LabMS.Model.RoleFucntion>(); LabMS.BLL.RoleFucntion bRF = new LabMS.BLL.RoleFucntion(); listRF = bRF.GetModelList(" RoleID = " + otherRoleId.ToString()); CreatePrivailyPanel(listRF); }