public void AddControlForHotGroups(SimplePageVM model, PageController controller) { model.Controls.Add( new SimplePageVM.Control(Htmls.GroupSort("Выберите свой курс со скидкой!", controller.Url.Group().Urls.HotGroupsWithSort(0)) .ToString())); }
public void AddControlRecruiter2011(SimplePageVM model) { var sections = SectionService.GetAll(x => new[] { 370, 371 }.Contains(x.Section_ID)).ToList(); model.Controls.Add( new SimplePageVM.Control(Views.Page.Recruiter2011, sections)); }
public void AddControlForTrainers(SimplePageVM model) { var controlModel = EmployeeService.GetAllTrainers(); model.Controls.Add( new SimplePageVM.Control(PartialViewNames.AllTrainers, controlModel)); }
private void AddUnlimitWithoutChargeCourses(SimplePageVM model, bool isEng) { var courseTCs = PriceService.CourseWithUnlimite().Except(PriceService.CourseWithUnlimitePrice().Keys); var courses = courseTCs.Select(x => Tuple.Create( CourseService.GetAllCourseNames().GetValueOrDefault(x), 0M)).Where(x => x.Item1 != null).ToList(); AddCourseTable(model, courses, false, isEng); }
public void AddControlForDiscounts(SimplePageVM model) { /* var actions = MarketingActionService.GetAll().IsActive() * .Where(a => !a.IsAdvert && !a.IsSecret); * model.Controls.Add( * new SimplePageVM.Control(PartialViewNames.Discounts, * actions.ToList()));*/ }
public void AddControlForSpecialActions(SimplePageVM model) { var actions = MarketingActionService.GetAll().IsActive() .Where(a => a.IsSpecialOffer).OrderBy(a => a.WebSortOrder); model.Controls.Add( new SimplePageVM.Control(PartialViewNames.ActionList, actions.ToList())); }
public void AddControlForSingUpWebinar(SimplePageVM model) { var groups = GroupService.GetPlannedAndNotBegin().NotSpecial() .Where(x => x.WebinarExists).Take(30).ToList(); model.Controls.Add( new SimplePageVM.Control(PartialViewNames.NearestGroupList, new NearestGroupsVM(groups))); }
public void AddControlForUnlimitWithCharge(SimplePageVM model) { var courseTCs = PriceService.CourseWithUnlimitePrice(); var courses = courseTCs.Select(x => Tuple.Create( CourseService.GetAllCourseNames().GetValueOrDefault(x.Key), x.Value)) .Where(x => x.Item1 != null).ToList(); AddCourseTable(model, courses, true); }
public void AddControlForProbation(SimplePageVM model) { var vacancies = VacancyService.GetAll().IsActive().Where(v => v.Type == CenterVacancyType.Probation) .OrderByDescending(v => v.PublishDate).Take(50).ToList(); model.Controls.Add( new SimplePageVM.Control(Views.Page.PartnerVacancies, vacancies)); }
public void AddControlForUsefulInformation(SimplePageVM model) { var usefulInformation = UsefulInformationService.GetAll().IsActive() .OrderBy(a => a.UpdateDate); model.Controls.Add( new SimplePageVM.Control(PartialViewNames.UsefulInformation, usefulInformation.ToList())); }
public void AddControlForUnlimit(SimplePageVM model, PageController controller) { var urlHelper = controller.Url; var user = controller.User; var link = GetUnlimitOrderButton(urlHelper, user); var desc = TemplateEngine.GetText(model.Entity.Description, new { OrderButton = link.ToString() }); model.Description = new TextWithInfoTags(desc); }
public void AddControlForLocations(SimplePageVM model) { var cities = CityService.GetAll().OrderBy(c => c.SortOrder); model.Controls.Add( new SimplePageVM.Control(PartialViewNames.Cities, cities)); model.Controls.Add( new SimplePageVM.Control(PartialViewNames.SectionsResponses, null)); }
private void AddControlForManagers(SimplePageVM model) { model.Controls.Add( new SimplePageVM.Control( PartialViewNames.EmployeeList, EmployeeService .GetAll().Where(e => e.EmpGroup_TC != EmpGroups.Trainer && e.EmpGroup_TC != EmpGroups.Dismiss && !Employees.SpecialTrainers.Contains(e.Employee_TC)) .CommonList().ToList())); }
public void AddControlForWebinar(SimplePageVM model) { var groups = GroupService.GetPlannedAndNotBegin() .Where(g => g.WebinarExists) .NotSeminars() .Take(CommonConst.WebinarCount); model.RightColumnControls.Add( new SimplePageVM.Control(PartialViewNames.WebinarsBlock, groups)); }
public void AddControlForWebinarResponses(SimplePageVM model) { var responses = ResponseServise.GetRandomForWebinar(); model.Controls.Add( new SimplePageVM.Control(Views.Shared.Common.ResponseList, responses) { OnBottom = true }); }
private void AddControlForWeekendCourses(SimplePageVM model) { var groups = GroupService.GetPlannedAndNotBegin() .Where(g => DaySequences.GetAll.Contains(g.DaySequence_TC) && g.DateBeg < DateTime.Now.AddMonths(1)).NotSpecial(); model.Controls.Add( new SimplePageVM.Control(PartialViewNames.NearestGroupList, new NearestGroupsVM(groups.ToList()))); }
public void AddControlForIntramuralExtramural(SimplePageVM model) { var openClasses = GroupService.GetPlannedAndNotBegin() .Where(x => x.IsIntraExtramural).Take(30).ToList(); var groups = GroupVMService.GetSectionGroups(openClasses) .Select(x => Tuple.Create(x.Key, new NearestGroupsVM(x.ToList()))).ToList(); model.Controls.Add( new SimplePageVM.Control(Views.Shared.Education.NearestGroupListWithSections, groups)); }
public void AddControlForDiplomResponses(SimplePageVM model) { var responses = ResponseServise.GetAll(x => x.IsActive && x.IsDiplom) .OrderByDescending(x => x.ResponseID) .Take(20).ToList(); model.Controls.Add( new SimplePageVM.Control(Views.Shared.Common.ResponseList, responses) { OnBottom = true }); }
public void AddControlForOpenClasses(SimplePageVM model) { var openClasses = GroupService.GetPlannedAndNotBegin() .Where(x => x.IsOpenLearning).Take(30).ToList(); model.Controls.Add( new SimplePageVM.Control(PartialViewNames.NearestGroupList, new NearestGroupsVM(openClasses))); model.Controls.Add( new SimplePageVM.Control(PartialViewNames.OpenClasses, null)); }
public void AddControlForTestingCenter(SimplePageVM model) { var vendors = VendorService.GetAll(x => Vendor.ForTest.Contains(x.Vendor_ID) && x.IsActive).ToList() .OrderBy(x => Vendor.ForTest.IndexOf(x.Vendor_ID)).ToList(); model.Controls.Add( new SimplePageVM.Control(Views.Shared.Catalog.Vendors, vendors) { OnBottom = true }); }
public void AddControlForReserve(SimplePageVM model) { var reserve = MarketingActionService.GetAll().BySysName( MarketingActions.Reserve); model.Controls.Add( new SimplePageVM.Control(PartialViewNames.Reserve, new ReserveVM { Discounts = reserve .Discounts.Where(d => d.IsActive).ToList() })); }
public void AddControlForClassIpCamera(SimplePageVM model) { /*var date = DateTime.Now; * var lecture = LectureService.GetAll(x => x.LectureDateBeg <= date && x.LectureDateEnd >= date * && x.ClassRoom_TC == "МС2") * .FirstOrDefault(); * var groups = new List<Group>(); * if(lecture != null)*/ var groups = GroupService.GetPlannedAndNotBegin().Where(x => x.Discount.HasValue).Take(10); model.Controls.Add(new SimplePageVM.Control(PartialViewNames.IpCamera, groups)); }
public void AddControlForCareer(SimplePageVM model) { // var vacancies = VacancyService.GetAll().IsActive().OrderByDescending(v => // v.IsHot // ).OrderByDescending(v => v.PublishDate).Take(CommonConst.MaxHotVacansyCount); var vacancies = VacancyService.GetAll().IsActive().Where(v => v.IsHot && !v.IsPartner && v.Type != CenterVacancyType.Probation) .OrderByDescending(v => v.PublishDate); // if (vacancies.Any(v => v.IsHot)) // vacancies = vacancies.Where(v => v.IsHot); model.RightColumnControls.Add( new SimplePageVM.Control(PartialViewNames.VacanciesBlock, vacancies)); }
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 void AddControlForNewYearCourses(SimplePageVM model) { var cityTC = UserSettingsService.CityTC; var newYearGroups = GroupService.GetPlannedAndNotBegin() .Where(g => g.DateBeg >= new DateTime(2012, 1, 1) && g.DateEnd <= new DateTime(2012, 1, 12)); var groups = newYearGroups.ByCity(cityTC) .ToList(); if (cityTC != Cities.Moscow) { groups.AddRange(newYearGroups.Where(g => g.WebinarExists)); } model.Controls.Add( new SimplePageVM.Control(PartialViewNames.NearestGroupList, new NearestGroupsVM(groups.ToList()))); }
public void AddControlSpecialistTV(SimplePageVM model) { VideoService.LoadWith(x => x.VideoCategory); var videos = VideoService.GetAll(x => x.IsActive && x.IsNew).OrderByDescending(x => x.VideoID).ToList(); var newVideos = VideoService.GetAll(x => x.IsActive) .OrderByDescending(x => x.VideoID).Take(3).ToList(); var videoCategories = VideoCategoryService.GetAll().Where(x => x.ParentId == null).ToList(); model.Controls.Add( new SimplePageVM.Control(Views.Page.Videos, new VideosVM { Videos = videos, NewVideos = newVideos, Categories = videoCategories })); }
private static void AddCourseTable(SimplePageVM model, List <System.Tuple <Course, decimal> > courses, bool showPrice, bool isEng = false) { var courseTitle = isEng ? "Course" : "Курс"; var hourTitle = isEng ? "Hours" : "Часы"; var priceTitle = isEng ? "Price" : "Цена БО"; var table = H.table[H.Head(courseTitle, hourTitle, showPrice ? priceTitle : null), courses.OrderBy(x => x.Item1.GetNameOrEng(isEng)) .Select(x => H.Row2(H.td[Links.CourseLink(null, x.Item1.UrlName, x.Item1.GetNameOrEng(isEng))].Style("text-align:left;"), (int)x.Item1.BaseHours, showPrice ? x.Item2.MoneyString() : null))].Class("table"); model.Controls.Add( new SimplePageVM.Control(table.ToString())); }
private void AddControlCenter(SimplePageVM model) { var graduates = model.EntityWithTags.FirstOrDefault(x => x.Entity.As <SimplePage>().SysName == SimplePages.Graduates); if (graduates == null) { return; } var privatePerson = new List <SimplePage> { new SimplePage { UrlName = SimplePages.Urls.SuccessStories, Title = "Истории успеха" }, new SimplePage { UrlName = SimplePages.Urls.Responses, Title = "Отзывы" }, new SimplePage { UrlName = SimplePages.Urls.Works, Title = "Работы выпускников" }, }; foreach (var simplePage in privatePerson) { simplePage.UrlName = "client/privateperson/" + simplePage.UrlName; } graduates.List.InsertRange(0, privatePerson.Cast <IEntityCommonInfo>()); var locations = model.EntityWithTags.FirstOrDefault(x => x.Entity.As <SimplePage>().SysName == SimplePages.Locations); if (locations == null) { return; } var city = CityService.GetAll().First(c => c.City_TC == Cities.Moscow).As <IEntityCommonInfo>(); var entityes = _.List(city).AddFluent(ComplexService.List() .Select(x => x.Value).Where(x => x.IsPublished)); locations.List = entityes; }
public void AddControlForMicrosoftSeminars(SimplePageVM model) { var groups = CourseListVMService.GetSeminars(false) .GroupSeminars.Where(x => x.Group.IsMicrosoftseminar).ToList(); var msSeminars = GroupService.GetPlannedAndNotBegin().Where( x => CourseTC.MsSeminars.Contains(x.Course_TC)) .Select(x => new GroupSeminar(x)).ToList(); model.Controls.Add( new SimplePageVM.Control(Views.Shared.Education.SeminarList, groups)); if (msSeminars.Any()) { model.Controls.Add( new SimplePageVM.Control(Views.Shared.Education.SeminarList, msSeminars, "Расписание семинаров First Look")); } }
public void AddControlForOnlineTesting(SimplePageVM model) { var sections = SectionService.GetSectionsTree(); var testSections = AllTestSections(); sections = sections.Where(x => testSections.Contains(x.Section_ID)).ToList(); var mainTestsVm = new MainTestsVM { Sections = sections }; var isSecond = Htmls.IsSecond; if (isSecond) { mainTestsVm.Description = model.Entity.Description; model.Description = new TextWithInfoTags(string.Empty); } mainTestsVm.IsSecond = isSecond; model.Controls.Add( new SimplePageVM.Control(Views.Page.TestSections, mainTestsVm)); }