Exemplo n.º 1
0
        public PageViewModel GetPageByFiendlyUrl(string url, PageLanguages language)
        {
            Page data = _pageRepository.GetPageByFriendlyUrl(url);

            if (data != null)
            {
                var header = _headerTemplateRepository.GetHeaderTemplateById(data.HeaderTemplateId.Value);
                var footer = _footerTemplateRepository.GetFooterTemplateById(data.FooterTemplateId.Value);
                if (language == PageLanguages.Vietnamese)
                {
                    return(new PageViewModel()
                    {
                        Title = data.Title,
                        HeaderContent = header.Content,
                        PageContent = data.Content,
                        FooterContent = footer.Content,
                    });
                }
                else if (language == PageLanguages.English)
                {
                    return(new PageViewModel()
                    {
                        Title = data.TitleEnglish,
                        HeaderContent = header.ContentEnglish,
                        PageContent = data.ContentEnglish,
                        FooterContent = footer.ContentEnglish,
                    });
                }
            }
            return(new PageViewModel());
        }
Exemplo n.º 2
0
        public FooterTemplateManageModel GetFooterTemplateById(int id)
        {
            FooterTemplate data = _footerRepository.GetFooterTemplateById(id);

            if (data != null)
            {
                return(MappingManageModel(data));
            }
            return(new FooterTemplateManageModel());
        }