Example #1
0
 public ActionResult AddSection(string name)
 {
     var request = new GetSectionsByArticleRequest { Name = name };
         var response = _articleService.GetSectionsByArticle(request);
         var articlePageView = new SectionCreatePageView
                               	{
                               		ArticleView = response.Article,
                                     SectionsView=response.Sections,
                                     SectionView=new SectionView()
                               	};
         return View(articlePageView);
 }
Example #2
0
        public GetSectionsByArticleResponse GetSectionsByArticle(GetSectionsByArticleRequest request)
        {
            var response = new GetSectionsByArticleResponse();
            var article = _articleRepository.FindByArticleName(request.Name);
            var sections = _sectionRepository.FindByArticle(article.ArticleId);

            response.Sections = sections != null ? sections.ConvertToSectionViews() : new List<SectionView>();
            response.Article = article.ConvertToArticleView();

            return response;
        }
Example #3
0
 public ViewResult Index(string name)
 {
     var request = new GetSectionsByArticleRequest {Name = name};
     var response = _articleService.GetSectionsByArticle(request);
     var articlePageView = new ArticlePageView
                           	{
                                   Sections = response.Sections,
                                   Article=response.Article
                               };
     return View(articlePageView);
 }