/// <summary> /// 获取菜单选择列表 /// </summary> /// <param name="context"></param> /// <returns></returns> private string GetMenuSelectList(HttpContext context) { string result = string.Empty; result = new MySpider.MyCategories().GetSelectOptionHtml(bll.GetList <HelpCategory>(), "CategoryID", "PreID", "NodeName", 0, "ddlPreMenu", "width:200px", ""); return(result.ToString()); }
/// <summary> /// 分类查询 /// </summary> /// <param name="context"></param> /// <returns></returns> private string QueryCategory(HttpContext context) { List <HelpCategory> list;//分页去掉 = bll.GetLit<BLLMJCMS.Model.HelpCategory>(rows, page, searchCondition, "CategoryID"); list = bll.GetList <HelpCategory>().OrderBy(p => p.Sort).ToList(); List <HelpCategory> showList = new List <HelpCategory>(); MySpider.MyCategories m = new MySpider.MyCategories(); foreach (ListItem item in m.GetCateListItem(m.GetCommCateModelList <HelpCategory>("CategoryID", "PreID", "NodeName", list), 0)) { try { HelpCategory tmpModel = list.Where(p => p.CategoryID.ToString().Equals(item.Value)).ToList()[0]; tmpModel.NodeName = item.Text; showList.Add(tmpModel); } catch { } } int totalCount = showList.Count; string jsonResult = ZentCloud.Common.JSONHelper.ObjectToJson(totalCount, showList); return(jsonResult); }
/// <summary> /// 获取微信菜单 /// </summary> /// <param name="context"></param> /// <returns></returns> private string QueryWeixinMenu(HttpContext context) { List <WeixinMenu> list; list = bllWeixin.GetList <WeixinMenu>(string.Format("UserID='{0}'", currentUserInfo.UserID)); list = list.OrderBy(p => p.MenuSort).ToList(); List <WeixinMenu> showList = new List <WeixinMenu>(); MySpider.MyCategories m = new MySpider.MyCategories(); foreach (ListItem item in m.GetCateListItem(m.GetCommCateModelList <WeixinMenu>("MenuID", "PreID", "NodeName", list), 0)) { try { WeixinMenu tmpModel = list.Where(p => p.MenuID.ToString().Equals(item.Value)).ToList()[0]; tmpModel.NodeName = item.Text; showList.Add(tmpModel); } catch { } } int totalCount = showList.Count; return(Common.JSONHelper.ObjectToJson( new { total = totalCount, rows = showList })); }
/// <summary> /// 获取菜单选择列表 /// </summary> /// <param name="context"></param> /// <returns></returns> private string GetMenuSelectList(HttpContext context) { string result = string.Empty; result = new MySpider.MyCategories().GetSelectOptionHtml(bllWeixin.GetList <WeixinMenu>(string.Format("UserID='{0}'", currentUserInfo.UserID)), "MenuID", "PreID", "NodeName", 0, "ddlPreMenu", "width:200px", ""); return(result.ToString()); }
/// <summary> /// 获取菜单选择列表 /// </summary> /// <param name="context"></param> /// <returns></returns> private string GetMenuSelectList(HttpContext context) { string result = string.Empty; List <MenuInfo> menuList = bllMenu.GetWebsiteMenuList(null, 2, false, false); result = new MySpider.MyCategories().GetSelectOptionHtml(menuList, "MenuID", "PreID", "NodeName", 0, "ddlPreMenu", "width:150px", ""); return(result.ToString()); }
/// <summary> /// 获取菜单选择列表 /// </summary> /// <param name="context"></param> /// <returns></returns> private string GetMenuSelectList(HttpContext context) { List <MenuInfo> list = new List <MenuInfo>(); string websiteOwner = context.Request["websiteOwner"]; string menuTypeStr = context.Request["menuType"]; string showPreMenuStr = context.Request["showPreMenu"]; int menuType = string.IsNullOrWhiteSpace(menuTypeStr) ? 3 : Convert.ToInt32(menuTypeStr); bool showPreMenu = showPreMenuStr == "1" ? true : false; string showLevelStr = context.Request["showLevel"]; string showHideStr = context.Request["showHide"]; bool showHide = showHideStr == "1" ? true : false; int showLevel = 3; if (currentUserInfo.UserType == 1) { showLevel = showLevelStr == "1" ? 1 : 2; } else if (currentUserInfo.UserID == pmsBll.WebsiteOwner) { showLevel = 2; } list = bllMenu.GetWebsiteMenuList(websiteOwner, showLevel, showPreMenu, showHide); //获取权限组ids string relationIds = "''"; List <long> pmsGroupIdList = pmsBll.GetPmsGroupIDByUser(websiteOwner); if (pmsGroupIdList.Count > 0) { relationIds = MyStringHelper.ListToStr(pmsGroupIdList, "'", ","); } list = bllMenu.CheckMenuRelationList(list, websiteOwner, relationIds); if (!showHide) { list = list.Where(p => p.IsHide.Value == 0).ToList(); } string result = string.Empty; result = new MySpider.MyCategories().GetSelectOptionHtml(list, "MenuID", "PreID", "NodeName", 0, "ddlPreMenu", "width:90%", ""); return(result.ToString()); }
private string Query(HttpContext context) { //int page = Convert.ToInt32(context.Request["page"]); //int rows = Convert.ToInt32(context.Request["rows"]); List <MenuInfo> menuList = new List <MenuInfo>(); //分页去掉 //list = pmsBll.GetLit<MenuInfo>(rows, page, null, "MenuID"); string websiteOwner = context.Request["websiteOwner"]; string menuTypeStr = context.Request["menuType"]; int menuType = string.IsNullOrWhiteSpace(menuTypeStr) ? 3 : Convert.ToInt32(menuTypeStr); string showLevelStr = context.Request["showLevel"]; string showHideStr = context.Request["showHide"]; bool showHide = showHideStr == "1" ? true : false; int showLevel = 3; if (currentUserInfo.UserType == 1) { showLevel = showLevelStr == "1" ? 1 : 2; } else if (currentUserInfo.UserID == pmsBll.WebsiteOwner) { showLevel = 2; } menuList.AddRange(bllMenu.GetWebsiteMenuList(websiteOwner, showLevel, false, showHide)); //获取权限组ids string relationIds = "''"; List <long> pmsGroupIdList = pmsBll.GetPmsGroupIDByUser(websiteOwner); if (pmsGroupIdList.Count > 0) { relationIds = MyStringHelper.ListToStr(pmsGroupIdList, "'", ","); } menuList = bllMenu.CheckMenuRelationList(menuList, websiteOwner, relationIds); if (!showHide) { menuList = menuList.Where(p => p.IsHide.Value == 0).ToList(); } List <MenuInfo> showList = new List <MenuInfo>(); MySpider.MyCategories m = new MySpider.MyCategories(); List <MySpider.Model.MyCategoryModel> listCate = m.GetCommCateModelList <MenuInfo>("MenuID", "PreID", "NodeName", menuList); foreach (ListItem item in m.GetCateListItem(listCate, 0)) { try { MenuInfo tmpModel = (MenuInfo)menuList.Where(p => p.MenuID.ToString().Equals(item.Value)).ToList()[0].Clone(); tmpModel.NodeName = item.Text; showList.Add(tmpModel); } catch { } } int totalCount = showList.Count; return(Common.JSONHelper.ObjectToJson( new{ total = totalCount, rows = showList })); }