Exemplo n.º 1
0
        public ActionResult AddArticle(ArticleSummaryPageView articleSummaryPageView)
        {
            try
            {
                var request = new AddArticleRequest
                              	{
                              		ArticleId =articleSummaryPageView.Article.Id==Guid.Empty?Guid.NewGuid():articleSummaryPageView.Article.Id,
                              		Name = articleSummaryPageView.Article.Name,
                                    Description = articleSummaryPageView.Article.Description,
                                };

                var response = articleSummaryPageView.Article.Id == Guid.Empty ? _articleService.AddArticle(request) : _articleService.EditArticle(request);
                return RedirectToAction("AddSection", "Article", new {response.ArticleView.Name});
            }
            catch (ArticleInvalidException)
            {
                //ToDo Handle ArticleInvalidException
                throw new NotImplementedException();
            }
        }
Exemplo n.º 2
0
        public ViewResult List()
        {
            var response = _articleService.GetAllArticles();

            var articleSummaryPageView = new ArticleSummaryPageView
                                         	{
                                         		Articles = response.Articles
                                         	};
            return View(articleSummaryPageView);
        }