Example #1
0
 public void AddControlForHotGroups(SimplePageVM model, PageController controller)
 {
     model.Controls.Add(
         new SimplePageVM.Control(Htmls.GroupSort("Выберите свой курс со скидкой!",
                                                  controller.Url.Group().Urls.HotGroupsWithSort(0))
                                  .ToString()));
 }
Example #2
0
        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));
        }
Example #3
0
        public void AddControlForTrainers(SimplePageVM model)
        {
            var controlModel =
                EmployeeService.GetAllTrainers();

            model.Controls.Add(
                new SimplePageVM.Control(PartialViewNames.AllTrainers, controlModel));
        }
Example #4
0
        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);
        }
Example #5
0
 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()));*/
 }
Example #6
0
        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()));
        }
Example #7
0
        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)));
        }
Example #8
0
        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);
        }
Example #9
0
        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));
        }
Example #10
0
        public void AddControlForUsefulInformation(SimplePageVM model)
        {
            var usefulInformation = UsefulInformationService.GetAll().IsActive()
                                    .OrderBy(a => a.UpdateDate);

            model.Controls.Add(
                new SimplePageVM.Control(PartialViewNames.UsefulInformation,
                                         usefulInformation.ToList()));
        }
Example #11
0
        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);
        }
Example #12
0
        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));
        }
Example #13
0
 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()));
 }
Example #14
0
        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));
        }
Example #15
0
        public void AddControlForWebinarResponses(SimplePageVM model)
        {
            var responses = ResponseServise.GetRandomForWebinar();

            model.Controls.Add(
                new SimplePageVM.Control(Views.Shared.Common.ResponseList, responses)
            {
                OnBottom = true
            });
        }
Example #16
0
        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())));
        }
Example #17
0
        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));
        }
Example #18
0
        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
            });
        }
Example #19
0
        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));
        }
Example #20
0
        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
            });
        }
Example #21
0
        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()
            }));
        }
Example #22
0
        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));
        }
Example #23
0
        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));
        }
Example #24
0
        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));
        }
Example #25
0
        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())));
        }
Example #26
0
        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
            }));
        }
Example #27
0
        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()));
        }
Example #28
0
        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;
        }
Example #29
0
        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"));
            }
        }
Example #30
0
        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));
        }