コード例 #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");
 }
コード例 #2
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");
 }
コード例 #3
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>());
 }
コード例 #4
0
 public ActionResult AjaxAddComment(FormCollection Fm)
 {
     int num3;
     if (base.currentUser == null)
     {
         return null;
     }
     Maticsoft.Model.SNS.Comments comModel = new Maticsoft.Model.SNS.Comments();
     int num = Globals.SafeInt(Fm["TargetId"], 0);
     int num2 = 0;
     string str2 = Fm["Type"];
     if (str2 != null)
     {
         if (!(str2 == "Video"))
         {
             if (str2 == "Product")
             {
                 num2 = 2;
                 goto Label_0080;
             }
             if (str2 == "Photo")
             {
                 num2 = 1;
                 goto Label_0080;
             }
             if (str2 == "Blog")
             {
                 num2 = 4;
                 goto Label_0080;
             }
         }
         else
         {
             num2 = 0;
             goto Label_0080;
         }
     }
     num2 = 0;
 Label_0080:
     num3 = 0;
     string str = ViewModelBase.ReplaceFace(Globals.HtmlEncode(Fm["Des"]));
     comModel.CreatedDate = DateTime.Now;
     comModel.CreatedNickName = base.currentUser.NickName;
     comModel.CreatedUserID = base.currentUser.UserID;
     comModel.Description = str;
     comModel.HasReferUser = str.Contains("@");
     comModel.IsRead = false;
     comModel.ReplyCount = 0;
     comModel.TargetId = num;
     comModel.Type = num2;
     comModel.UserIP = base.Request.UserHostAddress;
     num3 = this.ComBll.AddEx(comModel);
     if (num3 <= 0)
     {
         return base.Content("No");
     }
     comModel.CommentID = num3;
     List<Maticsoft.Model.SNS.Comments> model = new List<Maticsoft.Model.SNS.Comments>();
     if (!FilterWords.ContainsModWords(comModel.Description))
     {
         model.Add(comModel);
     }
     return this.PartialView("_TargetComment", model);
 }