Save() public method

public Save ( Comment c ) : int
c Comment
return int
Ejemplo n.º 1
0
        public static int InsertComments(FormCollection collection, int SourceID, int SourceType)
        {
            ICommentsRepository comments = new CommentsRepository();

            Comment c = new Comment();

            c.Comments = collection["S1"];
            c.DateAdded = DateTime.Now;
            c.RoleAccess = collection["ddCommentType"];
            //c.UserID = collection["UserID"];
            c.UserID = Membership.GetUser().ToString();
            c.SourceID = SourceID;
            c.SourceType = SourceType;

            return comments.Save(c);

        }
Ejemplo n.º 2
0
        public static int InsertComments(FormCollection collection, int SourceID, int SourceType)
        {
            ICommentsRepository comments = new CommentsRepository();

            Comment c = new Comment();

            c.Comments = collection["S1"];
            c.DateAdded = DateTime.Now;
            c.RoleAccess = collection["ddCommentType"];
            //c.UserID = collection["UserID"];
            c.UserID = Membership.GetUser().ToString();
            c.SourceID = SourceID;
            c.SourceType = SourceType;

            return comments.Save(c);
        }
Ejemplo n.º 3
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();
            }
        }