Exemplo n.º 1
0
 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");
 }
Exemplo n.º 2
0
 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>());
 }
Exemplo n.º 3
0
 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");
 }