public ActionResult AjaxAddComment(FormCollection Fm) { Maticsoft.BLL.SNS.Comments comments = new Maticsoft.BLL.SNS.Comments(); Maticsoft.Model.SNS.Comments comModel = new Maticsoft.Model.SNS.Comments(); int num = Globals.SafeInt(Fm["TargetId"], 0); int num2 = 3; int num3 = 0; string source = ViewModelBase.ReplaceFace(Fm["Des"]); comModel.CreatedDate = DateTime.Now; comModel.CreatedNickName = base.currentUser.NickName; comModel.CreatedUserID = base.currentUser.UserID; comModel.Description = source; comModel.HasReferUser = source.Contains<char>('@'); comModel.IsRead = false; comModel.ReplyCount = 0; comModel.TargetId = num; comModel.Type = num2; comModel.UserIP = base.Request.UserHostAddress; num3 = comments.AddEx(comModel); if (num3 > 0) { comModel.CommentID = num3; comModel.Description = ViewModelBase.RegexNickName(comModel.Description); List<Maticsoft.Model.SNS.Comments> model = new List<Maticsoft.Model.SNS.Comments> { comModel }; return this.PartialView("CommentList", model); } return base.Content("No"); }
public ActionResult AjaxGetComment(FormCollection Fm) { Maticsoft.BLL.SNS.Comments comments = new Maticsoft.BLL.SNS.Comments(); int postID = Globals.SafeInt(Fm["PostId"], 0); if (postID > 0) { this.PostsModel = this.PostsBll.GetModel(postID); List<Maticsoft.Model.SNS.Comments> commentByPost = comments.GetCommentByPost(this.PostsModel); if (commentByPost.Count > 0) { return base.Content(this.jss.Serialize(commentByPost)); } } return base.Content("No"); }
public ActionResult AjaxGetCommentByPostId(FormCollection Fm) { Maticsoft.BLL.SNS.Comments comments = new Maticsoft.BLL.SNS.Comments(); int postID = Globals.SafeInt(Fm["PostId"], 0); if (postID > 0) { this.PostsModel = this.PostsBll.GetModel(postID); List<Maticsoft.Model.SNS.Comments> commentByPost = comments.GetCommentByPost(this.PostsModel); if (commentByPost.Count > 0) { ((dynamic) base.ViewBag).PostId = postID; return base.View(base.CurrentThemeViewPath + "/UserProfile/postCommentList.cshtml", commentByPost); } } return base.Content("No"); }
public ActionResult AjaxGetComments(FormCollection Fm) { int pageIndex = Globals.SafeInt(Fm["pageIndex"], 1); int targetId = Globals.SafeInt(Fm["AlbumId"], 1); List<Maticsoft.Model.SNS.Comments> model = new Maticsoft.BLL.SNS.Comments().GetCommentByPage(3, targetId, ViewModelBase.GetStartPageIndex(this._commentPageSize, pageIndex), ViewModelBase.GetEndPageIndex(this._commentPageSize, pageIndex)); return this.PartialView("CommentList", model); }
public PartialViewResult NewComment(string viewName = "_NewComment", int top = 15) { List<Maticsoft.Model.SNS.Comments> model = new Maticsoft.BLL.SNS.Comments().GetBlogComment(" type=4 and Status=1", " CreatedDate desc", top); if (model.Count > 0) { foreach (Maticsoft.Model.SNS.Comments comments2 in model) { comments2.Description = this.NoHTML(comments2.Description); } } return this.PartialView(viewName, model); }
public ActionResult AjaxAddProductComment(FormCollection Fm) { Maticsoft.Model.SNS.Comments comModel = new Maticsoft.Model.SNS.Comments(); Maticsoft.BLL.SNS.Comments comments2 = new Maticsoft.BLL.SNS.Comments(); int num = Globals.SafeInt(Fm["TargetId"], 0); int num2 = (Fm["Type"] == "Product") ? 2 : 1; int num3 = 0; string source = InjectionFilter.Filter(Fm["Des"]); comModel.CreatedDate = DateTime.Now; comModel.CreatedNickName = base.currentUser.NickName; comModel.CreatedUserID = base.currentUser.UserID; comModel.Description = source; comModel.HasReferUser = source.Contains<char>('@'); comModel.IsRead = false; comModel.ReplyCount = 0; comModel.TargetId = num; comModel.Type = num2; comModel.UserIP = base.Request.UserHostAddress; num3 = comments2.AddEx(comModel); if (num3 <= 0) { return base.Content("No"); } comModel.CommentID = num3; comModel.Description = ViewModelBase.RegexNickName(comModel.Description); List<Maticsoft.Model.SNS.Comments> list = new List<Maticsoft.Model.SNS.Comments>(); if (!FilterWords.ContainsModWords(comModel.Description)) { list.Add(comModel); } return this.PartialView(base.CurrentThemeViewPath + "/Partial/TargetListComment.cshtml", list.AsEnumerable<Maticsoft.Model.SNS.Comments>()); }
public ActionResult AjaxAddComment(FormCollection Fm) { Maticsoft.BLL.SNS.Comments comments = new Maticsoft.BLL.SNS.Comments(); Maticsoft.Model.SNS.Comments comModel = new Maticsoft.Model.SNS.Comments(); int postID = Globals.SafeInt(Fm["PostId"], 0); List<Maticsoft.Model.SNS.Comments> model = new List<Maticsoft.Model.SNS.Comments>(); int num2 = 0; string source = ViewModelBase.ReplaceFace(InjectionFilter.Filter(Fm["Des"])); if (postID > 0) { base.PostsModel = base.PostsBll.GetModel(postID); comModel.CreatedDate = DateTime.Now.AddMinutes(1.0); comModel.CreatedNickName = base.currentUser.NickName; comModel.CreatedUserID = base.currentUser.UserID; comModel.Description = source; comModel.HasReferUser = source.Contains<char>('@'); comModel.IsRead = false; comModel.ReplyCount = 0; comModel.TargetId = (base.PostsModel.TargetId > 0) ? base.PostsModel.TargetId : base.PostsModel.PostID; if (base.PostsModel.Type.Value == 3) { base.PostsModel.Type = 0; } comModel.Type = base.PostsModel.Type.Value; comModel.UserIP = base.Request.UserHostAddress; num2 = comments.AddEx(comModel); if (num2 > 0) { comModel.CommentID = num2; comModel.Description = ViewModelBase.RegexNickName(comModel.Description); if (!FilterWords.ContainsModWords(comModel.Description)) { model.Add(comModel); } ((dynamic) base.ViewBag).PostId = postID; return base.View(base.CurrentThemeViewPath + "/UserProfile/postCommentList.cshtml", model); } } return base.Content("No"); }