public static List <IndexModuleConfig> GetAvaliableIndexModule(string userno) { var moduleList = IndexConfigManager.GetAllIndexModules(); var powerList = GetAllPower(userno); for (var index = 0; index < moduleList.Count; ++index) { var itemList = IndexConfigManager.GetIndexItems(moduleList.ElementAt(index).PKID); if (itemList == null || itemList.Count == 0) { moduleList.RemoveAt(index); --index; continue; } bool existAvaliableItem = false; foreach (var item in itemList) { if (powerList.Where(power => power.Action.Equals(item.Action) && power.Controller.Equals(item.Controller) && (!power.IsActive || power.LinkName.Contains("NotDisPlay"))).Count() == 0) { existAvaliableItem = true; break; } } if (!existAvaliableItem) { moduleList.RemoveAt(index); --index; continue; } } return(moduleList); }
public static List <IndexModuleItem> GetAvailableIndexEntryByMoudleId(string userno, int moudleId) { var allModules = IndexConfigManager.GetAllIndexModulesFormCache(); var moudle = allModules.FirstOrDefault(m => m.PKID == moudleId); var allPower = GetAllPower(userno); var result = FilterItems(moudle, allPower); return(result.Items); }