public void AddControlForAboutDiplom(SimplePageVM model) { var diploms = CourseService.DiplomTracks().ToList(); var sections = UniqCourseInSection(GroupVMService.GetSectionCourseTCs(diploms)); var data = sections.Select(x => Tuple.Create(x.Key, CourseListVMService.GetAll(new TrackListVM { IsDiplomPage = true, Courses = x.ToList() }).FluentUpdate(y => y.EntityName = x.Key.Name))).ToList(); var list = new DiplomProgramListVM { List = data }; model.Controls.Add(new SimplePageVM.Control(Views.Page.DiplomProgramList, list)); }
private DiplomProgramListVM GetTrainingPrograms(PageController page) { return(MethodBase.GetCurrentMethod().CacheDay(() => { var programs = CourseService.GetAllHitTracks() .Select(x => x.Course_TC).Except(CourseTC.HalfTracks.Keys).ToList(); var sectionCourseTCs = GroupVMService.GetSectionCourseTCs(programs); var sections = UniqCourseInSection(sectionCourseTCs); var data = sections.Select(x => Tuple.Create(x.Key, CourseListVMService.GetAll(new TrackListVM { IsTrainingProgramsPage = true, Courses = x.ToList() }).FluentUpdate(y => { y.EntityName = x.Key.Name; y.EntityUrl = page.Html.Url().Section().Urls.Details(x.Key.UrlName); }))).ToList(); var list = new DiplomProgramListVM { List = data }; return list; })); }