getCommentByID() public method

public getCommentByID ( int ID ) : Comment
ID int
return Comment
Ejemplo n.º 1
0
        public ActionResult EditComment(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add update logic here
                ICommentsRepository comments = new CommentsRepository();
                Comment c = comments.getCommentByID(id);
                c.Comments = collection["Comment"];
                c.RoleAccess = collection["RoleAccess"];
                c.DateModified = DateTime.Now;

                int i= comments.Save(c);
                int review = int.Parse(collection["ReviewID"]);
                int palib = int.Parse(collection["PALibID"]);

                return RedirectToAction("ParagraphDetailsEdit", new { ReviewID = review, PALibID = palib });
            }
            catch
            {
                return View();
            }
        }
Ejemplo n.º 2
0
        public ActionResult EditComment(int id, int ReviewID_, int PALibID_)
        {
            ICommentsRepository comments = new CommentsRepository();
            Comment c = comments.getCommentByID(id);
            ViewData["Comment"] = c.Comments;
            ViewData["ReviewID"] = ReviewID_;
            ViewData["PALibID"] = PALibID_;

            IMembershipRepository members = new MembershipRepository();
            //ViewData["RolesAccess"] = new SelectList(members.getAllRoles(),c.RoleAccess);
            ViewData["RolesAccess"] = new SelectList(UpdateUtils.getViewersList(), c.RoleAccess);

            return View();
        }