public JsonResult DeleteComments(int Commentid, int Postid) { UserPost_Comments UserComments = new UserPost_Comments() { PostId = Postid, }; int id = UserPostService.DeleteUserComment(Commentid); var data = GenericMethods.UserComments(UserComments); return Json(data, JsonRequestBehavior.AllowGet); }
public JsonResult DeleteComments(int Commentid, int Postid) { UserPost_Comments UserComments = new UserPost_Comments() { PostId = Postid, }; int id = UserPostService.DeleteUserComment(Commentid); var data = GenericMethods.UserComments(UserComments); return(Json(data, JsonRequestBehavior.AllowGet)); }
public JsonResult UserPostComments(int?PostId, string comment) { UserPost_Comments UserComments = new UserPost_Comments() { PostId = PostId, Comment = comment, UserId = Convert.ToInt32(Session["UserId"].ToString()), CreatedOn = DateTime.Now, Status = true, }; var data = GenericMethods.UserComments(UserComments); return(Json(data, JsonRequestBehavior.AllowGet)); }
public int DeleteUserComment(int id) { try { using (var context = _dbContextFactory.CreateConnection()) { UserPost_Comments comment = context.UserPost_Comments.Where(x => x.CommentId == id).FirstOrDefault(); comment.Status = false; context.SaveChanges(); return(id); } } catch (Exception ex) { _Logger.Error(ex.Message, ex); throw ex; } }
public JsonResult UserPostComments(int? PostId, string comment) { UserPost_Comments UserComments = new UserPost_Comments() { PostId = PostId, Comment = comment, UserId = Convert.ToInt32(Session["UserId"].ToString()), CreatedOn = DateTime.Now, Status = true, }; var data = GenericMethods.UserComments(UserComments); return Json(data, JsonRequestBehavior.AllowGet); }
public List <UserdetailsDTO> UserComments(UserPost_Comments Obj) { return(_genericMethodsRepo.UserComments(Obj)); }