Esempio n. 1
0
        public JsonResult PostComment(UserPostCommentBM commentBM)
        {
            UserPostCommentCommentBL commentbl = new UserPostCommentCommentBL();
            UserBM userObj = SessionManager.InstanceCreator.Get<UserBM>(SessionKey.User);
            commentBM.UserName = userObj.Name;
            commentBM.UserId = userObj.Id;
            commentBM.CreatedBy = userObj.Id;
            commentBM.CreationDate = DateTime.Now;

            int CommentId = commentbl.Create(commentBM);
            commentBM.Id = CommentId;
            return Json(commentBM);
        }
Esempio n. 2
0
        public void DeleteComment(UserPostCommentBM commentBM)
        {
            UserPostCommentCommentBL commentbl = new UserPostCommentCommentBL();

            commentbl.Delete(commentBM);
        }
Esempio n. 3
0
        public JsonResult EditComment(UserPostCommentBM commentBM)
        {
            UserPostCommentCommentBL commentbl = new UserPostCommentCommentBL();
            UserBM userObj = SessionManager.InstanceCreator.Get<UserBM>(SessionKey.User);
            commentBM.ModifiedBy = userObj.Id;
            commentBM.ModificationDate = DateTime.UtcNow;

            //date issue http://www.devcurry.com/2013/04/json-dates-are-different-in-aspnet-mvc.html#.Ufvl1Y3VD6Q
            //date issue for ko MVC
            if (commentBM.CreationDate.ToString() == "1/1/0001 12:00:00 AM")
            {
                commentBM.CreationDate = DateTime.Now;
            }

            commentbl.Update(commentBM);
            return Json(commentBM);
        }