public ActionResult Index()
        {
            DraftPostVM model = new DraftPostVM()
            {
                NewPost = new BlogPost()
                {
                    Status = new Status(),
                    User   = new User()
                },

                SelectedCategoryIds = new  List <int>()
            };
            var categoryOps = OperationsFactory.CreateCategoryOps();
            var hashOps     = OperationsFactory.CreateHashtagOps();
            var statusOps   = OperationsFactory.CreateStatusOps();

            var categoryList = categoryOps.ListAllCategories();
            var hastagList   = hashOps.ListAllHashtags();
            var statusList   = statusOps.ListAllStatuses();

            model.GenerateHashtagsList(hastagList);
            model.GenerateCategoriesList(categoryList);
            model.GenerateStatusList(statusList);

            return(View(model));
        }
Beispiel #2
0
        public ActionResult PendingApproval(int blogPostId, int statusId)
        {
            var statusOps = OperationsFactory.CreateStatusOps();

            statusOps.UpdateStatus(blogPostId, statusId);

            return(RedirectToAction("PendingApproval"));
        }
Beispiel #3
0
        public ActionResult PendingApproval()
        {
            var model = new ApprovalVM()
            {
                SelectedBlogPost = new BlogPost()
            };
            var blogPostOps = OperationsFactory.CreateBlogPostOps();
            var statusOps   = OperationsFactory.CreateStatusOps();
            var commentOps  = OperationsFactory.CreateCommentOps();

            model.ListOfPosts          = blogPostOps.GetAllBlogPosts().FindAll(x => x.Status.StatusID == 1);
            model.RejectedPostsList    = blogPostOps.GetAllBlogPosts().FindAll(x => x.Status.StatusID == 3);
            model.DraftedPosts         = blogPostOps.GetAllBlogPosts().FindAll(x => x.Status.StatusID == 5);
            model.ScheduledPosts       = blogPostOps.GetAllBlogPosts().FindAll(x => x.Status.StatusID == 6 || x.DateOfPost > DateTime.Today);
            model.CommentsToBeApproved = commentOps.GetAllComments().FindAll(x => x.Status.StatusID == 1);
            var statusList = statusOps.ListAllStatuses();

            model.GenerateStatusList(statusList);

            return(View(model));
        }