Пример #1
0
        private SelectList GetModuls(int storeId = 0)
        {
            var moduls = GetDefaultModuls();

            storeId = GetStoreId(storeId);
            var navigations = NavigationRepository.GetStoreNavigations(storeId);


            foreach (var navigation in navigations)
            {
                String value = navigation.ControllerName.ToLower() + "-" + navigation.ActionName.ToLower();

                if (moduls.Any(r => value.Equals(r.Value.ToLower(), StringComparison.InvariantCultureIgnoreCase)))
                {
                    moduls.Remove(
                        moduls.FirstOrDefault(
                            r => r.Value.ToLower().Equals(value, StringComparison.InvariantCultureIgnoreCase)));
                }
            }

            var m = new SelectListItem();

            m.Value = "Pages-Pages";
            m.Text  = "Pages";
            moduls.Add(m);

            var sList = new SelectList(moduls, "Value", "Text");

            return(sList);
        }