private object GetModulesList() { ColumnsApp c_ModulesApp = new ColumnsApp(); var data = c_ModulesApp.GetListNoDel(m => m.EnabledMark != false); Dictionary <string, object> dictionary = new Dictionary <string, object>(); foreach (ColumnsEntity item in data) { var fieldItem = new { encode = item.ActionName, fullname = item.FullName }; dictionary.Add(item.Id, fieldItem); } return(dictionary); }
/// <summary> /// 获取请求路径栏目Id /// </summary> /// <returns></returns> private string GetColumnIds(System.Web.HttpContext context) { string cIds = string.Empty; string urlHost = GetHost(context); string urlRaw = context.Request.RawUrl.ToString(); urlRaw = context.Server.UrlDecode(urlRaw); //处理Url参数 urlRaw = Common.HandleUrlRaw(urlRaw); List <string> urlRaws = WebHelper.GetUrls(urlRaw); WebSiteApp app = new WebSiteApp(); ColumnsApp c_ColumnsApp = new ColumnsApp(); WebSiteEntity entity = app.GetModelByUrlHost(urlHost); if (urlRaws == null || urlRaws.Count == 0) { ColumnsEntity columnsEntity = c_ColumnsApp.GetMain(entity.Id); if (columnsEntity != null) { cIds = columnsEntity.Id; } } else { if (urlRaws.Count > 0) { ColumnsEntity columnsEntity = c_ColumnsApp.GetFormByActionName(urlRaws.FirstOrDefault(), entity.Id); if (columnsEntity != null) { cIds = columnsEntity.Id; } } } return(cIds); }