예제 #1
0
        /// <summary>
        /// Return the articles of the blog
        /// </summary>
        /// <param name="id">if of the blog</param>
        /// <returns>the view</returns>
        public ActionResult Display(long id)
        {
            BusinessManagement.Blog blog = new BusinessManagement.Blog(id);

            BlogDisplayModel model = new BlogDisplayModel()
            {
                IdBlog = blog.Id,
                Title = blog.GetName(),
                CssPath = Url.Content(blog.GetStylePath()),
                Author = blog.GetAuthor(),
                Description = blog.GetDescription(),
                ArticleModels = blog.GetArticlesDbo().Select(a => new ArticleModel()
                {
                    ArticleId = a.Id,
                    BlogId = a.BlogId,
                    MediaUrl = a.MediaUrl,
                    MediaType = a.MediaTypeId.Value,
                    Caption = a.Caption,
                    Tags = a.Tags,
                    Comments = a.Comments
                }).ToList()
            };

            return View(model);
        }
예제 #2
0
        /// <summary>
        /// Return the articles of the blog
        /// </summary>
        /// <param name="id">if of the blog</param>
        /// <returns>the view</returns>
        public ActionResult Display(long id)
        {
            BusinessManagement.Blog blog = new BusinessManagement.Blog(id);

            BlogDisplayModel model = new BlogDisplayModel()
            {
                IdBlog        = blog.Id,
                Title         = blog.GetName(),
                CssPath       = Url.Content(blog.GetStylePath()),
                Author        = blog.GetAuthor(),
                Description   = blog.GetDescription(),
                ArticleModels = blog.GetArticlesDbo().Select(a => new ArticleModel()
                {
                    ArticleId = a.Id,
                    BlogId    = a.BlogId,
                    MediaUrl  = a.MediaUrl,
                    MediaType = a.MediaTypeId.Value,
                    Caption   = a.Caption,
                    Tags      = a.Tags,
                    Comments  = a.Comments
                }).ToList()
            };

            return(View(model));
        }
예제 #3
0
        public ActionResult BlogManagement(long id)
        {
            BusinessManagement.Blog blog = new BusinessManagement.Blog(id);

            if (User.Identity.Name != blog.GetAuthor())
                RedirectToAction("Blog");

            ViewBag.Title = blog.GetName();
            ViewBag.Articles = blog.GetArticles();
            ViewBag.id = id;

            return View();
        }
예제 #4
0
        public ActionResult BlogManagement(long id)
        {
            BusinessManagement.Blog blog = new BusinessManagement.Blog(id);

            if (User.Identity.Name != blog.GetAuthor())
            {
                RedirectToAction("Blog");
            }

            ViewBag.Title    = blog.GetName();
            ViewBag.Articles = blog.GetArticles();
            ViewBag.id       = id;


            return(View());
        }