protected List <GroupForUser> GetModel() { var languageId = WebSettingsConfig.Instance.GetLanguageFromId(); IGroupsQuery groupsQuery = new GroupsQuery(languageId); List <GroupForUser> groups = groupsQuery.GetVisibleGroups(GroupType); var sorter = new GroupsSorter(HttpContext.Request.Cookies); sorter.Sort(groups); return(groups); }
public ModuleModel() { //TODO: inject logger! //DI is for Dependency injection! sheets = new SheetCache(); destinations = new DestinationStorage(); //TODO:Конфигурация! sorter = new GroupsSorter <Sheet>("Формат"); PropertiesExractor propertiesExractor = new PropertiesExractor(); sheetExtractor = new SheetsExtractor(propertiesExractor, new SheetCreator(new BoundsCalculator())); destinationsExtractor = new DestinationsExtractor(propertiesExractor, new DestinationCreator()); }
public ActionResult Index() { if (WebSettingsConfig.Instance.IsSectionForbidden(SectionId.FillDifference)) { return(RedirectToAction("Index", RouteConfig.MAIN_CONTROLLER_NAME)); } var languageId = WebSettingsConfig.Instance.GetLanguageFromId(); var comparisonsQuery = new ComparisonsQuery(languageId); List <ComparisonForUser> comparisons = comparisonsQuery.GetVisibleWithoutRules(); var sorter = new GroupsSorter(HttpContext.Request.Cookies); sorter.Sort(comparisons); return(View(comparisons)); }
public ActionResult Index(VideoType type) { if (WebSettingsConfig.Instance.IsSectionForbidden(SectionId.Video)) { return(RedirectToAction("Index", RouteConfig.MAIN_CONTROLLER_NAME)); } IVideosQuery videosQuery = GetVideosQuery(); List <VideoForUser> videos = videosQuery.GetVisible(type); var sorter = new GroupsSorter(HttpContext.Request.Cookies); sorter.Sort(videos); List <GroupForUser> convertedVideos = videos.Select(e => new GroupForUser(e.Id, e.Title, e.HasImage)).ToList(); return(View(convertedVideos)); }
public ActionResult Index() { if (WebSettingsConfig.Instance.IsSectionForbidden(SectionId.VisualDictionary)) { return(RedirectToAction("Index", RouteConfig.MAIN_CONTROLLER_NAME)); } long languageId = WebSettingsConfig.Instance.GetLanguageFromId(); var representationsQuery = new RepresentationsQuery(languageId); List <RepresentationForUser> representations = representationsQuery.GetVisibleWithoutAreas(); var sorter = new GroupsSorter(HttpContext.Request.Cookies); sorter.Sort(representations); List <GroupForUser> convertedRepresentations = representations.Select(e => new GroupForUser(e.Id, e.Title, true)).ToList(); return(View(convertedRepresentations)); }
public List <Tuple <int, string, bool> > GetItems() { return(GroupsSorter.GetTypes(HttpContext.Current.Request.Cookies)); }
public SheetsGroupTree(string groupBy, SheetTreeNodeCache nodeCache) { this.sorter = new GroupsSorter <SheetTreeNode>(groupBy); this.nodeCache = nodeCache; }