public SectionVM GetBy(string urlName, int?id) { var section = urlName.IsEmpty() ? SectionService.GetByPK(id) : SectionService.GetAll().ByUrlName(urlName); if (section == null) { return(null); } var sectionIdsContainUserWorks = GetSectionIdsContainUserWorks(); var entityWithTags = EntityCommonService.GetEntityWithTags(section); AddMicrosoft(section, entityWithTags); var parent = SectionService.GetSectionsTree() .FirstOrDefault(z => z.SubSections .Any(x => x.Section_ID == section.Section_ID)); return (new SectionVM { Section = section, Parent = parent, EntityWithTags = entityWithTags, SectionIdContainUserWorks = sectionIdsContainUserWorks, }); }
public EntityCommonVM GetByUrl(string url, PageController controller) { var page = SimplePageService.GetByUrl(url); if (page == null) { return(null); } if (page.UseTabs && page.Children.Any()) { page = page.Children.OrderBy(x => x.WebSortOrder).First(); } var model = EntityCommonService.Get(page); if (page.SysName == SimplePages.HotGroups) { page.Name = "Группы " + CommonTexts.Discounts + CommonTexts.OnDay; } switch (page.SysName) { case SimplePages.UsefulInformation: AddControlForUsefulInformation(model); break; case SimplePages.Trainers: AddControlForTrainers(model); break; case SimplePages.Managers: AddControlForManagers(model); break; case SimplePages.Locations: AddControlForLocations(model); break; case SimplePages.HotGroups: AddControlForHotGroups(model, controller); break; case SimplePages.WeekendCourses: AddControlForWeekendCourses(model); break; case SimplePages.OnlineTesting: AddControlForOnlineTesting(model); break; case SimplePages.NewYearCourses: AddControlForNewYearCourses(model); break; case SimplePages.OpenClasses: AddControlForOpenClasses(model); break; case SimplePages.PartnerVacancy: AddControlForPartnerVacancy(model); break; case SimplePages.Probation: AddControlForProbation(model); break; case SimplePages.ClassIpCamera: AddControlForClassIpCamera(model); break; case SimplePages.Career: AddControlForCareer(model); break; case SimplePages.Job: AddControlForCareer(model); break; case SimplePages.PersonalManager: AddControlForPersonalManager(model); break; case SimplePages.OflManager: AddControlForOflManager(model); break; case SimplePages.MarketingActions: AddControlForMarketingActions(model); break; case SimplePages.SpecialActions: AddControlForSpecialActions(model); break; case SimplePages.Discounts: AddControlForDiscounts(model); break; case SimplePages.Reserve: AddControlForReserve(model); break; case SimplePages.Webinar: AddControlForWebinar(model); break; case SimplePages.WebinarResponses: AddControlForWebinarResponses(model); break; case SimplePages.IntraExtraResponses: AddControlForIntraExtraResponses(model); break; case SimplePages.DiplomResponses: AddControlForDiplomResponses(model); break; case SimplePages.Center: AddControlCenter(model); break; case SimplePages.Recruiter2011: AddControlRecruiter2011(model); break; case SimplePages.SpecialistTV: AddControlSpecialistTV(model); break; case SimplePages.CollectionMcts: AddControlForCollectionMcts(model); break; case SimplePages.SignUpWebinar: AddControlForSingUpWebinar(model); break; case SimplePages.MicrosoftSeminars: AddControlForMicrosoftSeminars(model); break; case SimplePages.TestingCenter: AddControlForTestingCenter(model); break; case SimplePages.IntramuralExtramural: AddControlForIntramuralExtramural(model); break; case SimplePages.AboutDiplom: AddControlForAboutDiplom(model); break; case SimplePages.TrainingPrograms: AddControlForTrainingPrograms(model, controller); break; case SimplePages.CorpOffers: AddControlForCorpOffers(model); break; case SimplePages.Unlimit: AddControlForUnlimit(model, controller); break; case SimplePages.UnlimitEng: AddControlForUnlimit(model, controller); break; case SimplePages.UnlimitWithCharge: AddControlForUnlimitWithCharge(model); break; case SimplePages.WebinarInv: AddControlForWebinarInv(model); break; case SimplePages.UnlimitWithoutCharge: AddControlForUnlimitWithoutCharge(model); break; case SimplePages.UnlimitNoChargeEng: AddControlForUnlimitWithoutCharge(model, true); break; } return(model); }