Esempio n. 1
0
        public ActionResult Comment(int SubID)
        {
            ViewBag.SubID = SubID;
            var submission = dataAccess.GetSubmittionByID(SubID);

            ViewBag.TitleSub    = submission.Sub_Title;
            ViewBag.Description = submission.Sub_Description;
            ViewBag.CreatedDate = submission.Created_Date.Value.ToString("dd/MM/yyyy");
            ViewBag.CreatedBy   = submission.USER.Username;

            var comments = dataAccess.GetListCommentBySubID(SubID);
            var model    = comments.Select(x => new CommentViewModel()
            {
                CommentID      = x.Com_ID,
                CommentContent = x.Com_Name,
                UserID         = x.User_ID,
                Username       = x.USER.Username,
                SubID          = x.Sub_ID,
                CreatedBy      = x.Created_By,
                CreatedDate    = x.Created_Date
            }).OrderByDescending(x => x.CreatedDate).ToList();

            return(View(model));
        }