/// <summary> /// 获取角色ID列表 /// </summary> public static string GetRoleIDList(Yo_User user) { if (user == null) { return(""); } else { return(user.RoleIDList.Trim(',')); } }
protected override void OnInit(EventArgs e) { base.OnInit(e); if (!string.IsNullOrEmpty(Tool.CookieGet("YoUserID"))) { MyUser = Yo_UserBLL.GetModel(Convert.ToInt32(Tool.CookieGet("YoUserID"))); if (MyUser.IsLock) { Response.Redirect("~/LogOut.aspx"); } } else { Response.Redirect("~/Login.aspx"); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; // 反射方法 string cmd = context.Request["cmd"]; if (!string.IsNullOrEmpty(cmd)) { if (cmd != "LoginUser") { if (!string.IsNullOrEmpty(Tool.CookieGet("YoUserID"))) { MyUser = Yo_UserBLL.GetModel(Convert.ToInt32(Tool.CookieGet("YoUserID"))); if (MyUser.IsLock) { context.Response.Write("{\"flag\":\"false\",\"msg\":\"用户被锁定。\"}"); return; } } else { context.Response.Write("{\"flag\":\"false\",\"msg\":\"未登录\"}"); return; } } System.Reflection.MethodInfo Remethod = this.GetType().GetMethod(cmd); if (Remethod != null) { Remethod.Invoke(this, new object[] { context }); } } else { context.Response.Write("{\"flag\":\"false\",\"msg\":\"非法操作\"}"); } }
/// <summary> /// 获取权限ID列表 /// </summary> public static string GetJurisdictionIDList(Yo_User user) { if (GetRoleIDList(user) == "") { return(""); } List <Yo_Role> rList = Yo_RoleBLL.GetModelList("ID in (" + GetRoleIDList(user) + ")"); string result = ""; if (rList.Count <= 0) { return(result); } else { foreach (Yo_Role rItem in rList) { result += "," + rItem.JurisdictionIDList.Trim(','); } return(result.Trim(',')); } }