//获取登录用户的快捷方式权限 public ActionResult getMenuList() { int uid = Convert.ToInt32(Request["id"]); var temp = WXXBaoJiaQuanXianService.LoadEntities(x => x.UserID == uid).FirstOrDefault(); if (temp != null) { WXXQX wxx = new WXXQX(); wxx.ID = temp.ID; wxx.UserID = temp.UserID; string[] CanSeeAry = temp.CanSeeNum.Split(','); List <string> CanSee = new List <string>(); for (int i = 0; i < CanSeeAry.Length; i++) { var thisID = Convert.ToInt32(CanSeeAry[i]); var aMenu = WXXMenuInfoService.LoadEntities(x => x.ID == thisID).FirstOrDefault(); CanSee.Add(aMenu.EngName); } wxx.CanSee = CanSee; return(Json(new { ret = "ok", rows = wxx }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { ret = "no" }, JsonRequestBehavior.AllowGet)); } }
//获取菜单列表 public ActionResult getWXXMenuList() { var temp = WXXMenuInfoService.LoadEntities(x => x.ID > 0).DefaultIfEmpty().ToList(); if (temp[0] != null) { return(Json(new { ret = "ok", rows = temp }, JsonRequestBehavior.AllowGet)); } return(Json(new { ret = "no", msg = "数据表中无数据!" }, JsonRequestBehavior.AllowGet)); }
//获取所有成员的权限信息 public ActionResult getAllUserQXInfo() { var temp = WXXBaoJiaQuanXianService.LoadEntities(x => x.ID > 0).DefaultIfEmpty().ToList(); var menuInfo = WXXMenuInfoService.LoadEntities(x => x.ID > 0).DefaultIfEmpty().ToList(); if (temp[0] != null) { foreach (var a in temp) { string[] cansee = a.CanSeeNum.Split(','); string s = ""; for (int i = 0; i < cansee.Length; i++) { for (int j = 0; j < menuInfo.Count; j++) { if (Convert.ToInt32(cansee[i]) == menuInfo[j].ID) { if (i == cansee.Length - 1) { s = s + menuInfo[j].Name; } else { s = s + menuInfo[j].Name + ","; } } continue; } } a.CanSeeNum = s; } var rtmp = from a in temp select new { ID = a.ID, UserID = a.UserID, UserName = a.UserInfo.PerSonName + "【" + a.UserInfo.BumenInfoSet.Name + "】", QXInfo = a.CanSeeNum }; return(Json(new { ret = "ok", rows = rtmp }, JsonRequestBehavior.AllowGet)); } return(Json(new { ret = "no", msg = "无数据,联系管理员" }, JsonRequestBehavior.AllowGet)); }