protected IEnumerable <CommonCourseListItemVM> GetCourses() { var courses = CourseListVMService.GetAll(null) .Common.Items.Where(x => x.Prices.Any(z => !PriceTypes.IsIndividual(z.PriceType_TC)) && !CourseTC.HalfTrackCourses.Contains(x.Course.Course_TC)); return(courses); }
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)); }
public virtual ActionResult CourseList(string typeName, object pk, string name) { var entity = SiteObject.GetEntity(typeName, pk); if (entity == null) { return(null); } var model = CourseListVMService.GetAll(entity); model.EntityName = name; model.EntityType = entity.GetType(); return(MView(PartialViewNames.AllCourseListPart, model)); }
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; })); }
public virtual ActionResult CourseListForModel(object model) { var courses = CourseListVMService.GetAll(model); return(View(PartialViewNames.AllCourseListPart, courses)); }