示例#1
0
 public Maticsoft.Model.SNS.Posts AddBlogPost(Maticsoft.Model.SNS.Posts Post, Maticsoft.Model.SNS.UserBlog blogModel, bool CreatePost = true)
 {
     Post.Type = 4;
     string valueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("chk_check_word");
     if (!string.IsNullOrEmpty(valueByCache))
     {
         Post.Status = (valueByCache == "0") ? 1 : 0;
     }
     else
     {
         Post.Status = 1;
     }
     Post.Description = "<a target='_blank' style='color: #FF7CAE' href='{BlogUrl} '>" + Post.Description + "</a>";
     if (FilterWords.ContainsModWords(Post.Description))
     {
         Post.Status = 0;
     }
     else
     {
         Post.Description = FilterWords.ReplaceWords(Post.Description);
     }
     Maticsoft.Model.SNS.Posts posts = this.dal.AddBlogPost(Post, blogModel, CreatePost);
     Maticsoft.BLL.SNS.ReferUsers users = new Maticsoft.BLL.SNS.ReferUsers();
     if (posts != null)
     {
         users.AddEx(Post.Description, EnumHelper.ReferType.Post, posts.PostID, "");
     }
     return posts;
 }
示例#2
0
 public int AddForwardPost(Maticsoft.Model.SNS.Posts model)
 {
     int targetId = 0;
     Maticsoft.BLL.SNS.ReferUsers users = new Maticsoft.BLL.SNS.ReferUsers();
     if (FilterWords.ContainsModWords(model.Description))
     {
         model.Status = 0;
     }
     else
     {
         model.Description = FilterWords.ReplaceWords(model.Description);
     }
     targetId = this.dal.AddForwardPost(model);
     users.AddEx(model.Description, EnumHelper.ReferType.Post, targetId, model.CreatedNickName);
     return targetId;
 }
示例#3
0
 public Maticsoft.Model.SNS.Posts AddNormalPost(Maticsoft.Model.SNS.Posts Post)
 {
     Post.Type = 0;
     string valueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("chk_check_word");
     if (!string.IsNullOrEmpty(valueByCache))
     {
         Post.Status = (valueByCache == "0") ? 1 : 0;
     }
     else
     {
         Post.Status = 1;
     }
     if (FilterWords.ContainsModWords(Post.Description))
     {
         Post.Status = 0;
     }
     else
     {
         Post.Description = FilterWords.ReplaceWords(Post.Description);
     }
     int num = this.dal.Add(Post);
     Post.PostID = num;
     Maticsoft.Model.SNS.Posts posts = Post;
     Maticsoft.BLL.SNS.ReferUsers users = new Maticsoft.BLL.SNS.ReferUsers();
     if (posts != null)
     {
         users.AddEx(Post.Description, EnumHelper.ReferType.Post, posts.PostID, "");
     }
     return posts;
 }
示例#4
0
 public int PostForWard(string PostContent, int Origid, int ForWardid, int OrigUserId, string OrigNickName, int CurrentUserID, string CurrentNickName, string UserIp)
 {
     new Users();
     Maticsoft.BLL.SNS.ReferUsers users = new Maticsoft.BLL.SNS.ReferUsers();
     Maticsoft.Model.SNS.ReferUsers model = new Maticsoft.Model.SNS.ReferUsers();
     Maticsoft.Model.SNS.Posts posts = new Maticsoft.Model.SNS.Posts {
         CreatedDate = DateTime.Now,
         Description = PostContent,
         CreatedNickName = CurrentNickName,
         CreatedUserID = CurrentUserID,
         ForwardedID = new int?(ForWardid),
         HasReferUsers = PostContent.Contains<char>('@') ? true : false,
         OriginalID = (Origid == 0) ? ForWardid : Origid,
         UserIP = UserIp,
         Status = 1
     };
     int targetId = this.AddForwardPost(posts);
     users.AddEx(PostContent, EnumHelper.ReferType.Post, targetId, "");
     model.CreatedDate = DateTime.Now;
     model.IsRead = false;
     model.ReferUserID = OrigUserId;
     model.ReferNickName = OrigNickName;
     model.Type = 0;
     model.TagetID = targetId;
     users.Add(model);
     return targetId;
 }
示例#5
0
 public Maticsoft.Model.SNS.Posts AddPost(Maticsoft.Model.SNS.Posts Post, int AblumId, long Pid, int PhotoCateId, string PhotoAddress = "", string MapLng = "", string MapLat = "", bool CreatePost = true)
 {
     Maticsoft.Model.SNS.Products pModel = new Maticsoft.Model.SNS.Products();
     Maticsoft.BLL.SNS.Tags tags = new Maticsoft.BLL.SNS.Tags();
     if (Post.Type == 2)
     {
         ITopClient topClient = TaoBaoConfig.GetTopClient();
         TaobaokeItemsDetailGetRequest request = new TaobaokeItemsDetailGetRequest {
             Fields = "num_iid,title,price,num_iid,title,cid,nick,desc,price,post_fee,express_fee,ems_fee,item_img.url,click_url,shop_click_url,num,props_name,detail_url,pic_url",
             NumIids = Pid.ToString()
         };
         TaobaokeItemsDetailGetResponse response = topClient.Execute<TaobaokeItemsDetailGetResponse>(request);
         Maticsoft.BLL.SNS.CategorySource source = new Maticsoft.BLL.SNS.CategorySource();
         Item item = new Item();
         item = (response.TaobaokeItemDetails.Count > 0) ? response.TaobaokeItemDetails[0].Item : null;
         pModel.ProductUrl = (response.TaobaokeItemDetails.Count > 0) ? response.TaobaokeItemDetails[0].ClickUrl : "";
         if (response.TaobaokeItemDetails.Count < 1)
         {
             ItemGetRequest request2 = new ItemGetRequest {
                 Fields = "num_iid,title,price,num_iid,title,cid,nick,desc,price,item_img.url,click_url,shop_click_url,num,props_name,detail_url,pic_url",
                 NumIid = new long?(Pid)
             };
             item = topClient.Execute<ItemGetResponse>(request2).Item;
             pModel.ProductUrl = item.DetailUrl;
         }
         Maticsoft.Model.SNS.CategorySource model = source.GetModel(3, Convert.ToInt32(item.Cid));
         pModel.CategoryID = (model != null) ? model.SnsCategoryId : 0;
         pModel.NormalImageUrl = item.PicUrl;
         pModel.ThumbImageUrl = item.PicUrl + "_300x300.jpg";
         pModel.Price = new decimal?(Globals.SafeDecimal(item.Price, (decimal) 0M));
         pModel.ProductID = Pid;
         pModel.ProductName = item.Title;
         Post.ProductName = pModel.ProductName;
         pModel.ProductSourceID = 3;
         pModel.CreatedDate = DateTime.Now;
         pModel.CreatedNickName = Post.CreatedNickName;
         pModel.CreateUserID = Post.CreatedUserID;
         string str = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("SNS_check_product");
         if (!string.IsNullOrEmpty(str))
         {
             pModel.Status = (str == "0") ? 1 : 0;
             Post.Status = (str == "0") ? 1 : 0;
         }
         else
         {
             pModel.Status = 1;
             Post.Status = 1;
         }
         if (FilterWords.ContainsModWords(Post.Description))
         {
             pModel.Status = 0;
             Post.Status = 0;
         }
         else
         {
             Post.Description = FilterWords.ReplaceWords(Post.Description);
         }
         pModel.ShareDescription = Post.Description;
         ItemGetRequest request3 = new ItemGetRequest {
             Fields = "props_name",
             NumIid = new long?(Pid)
         };
         string propsName = topClient.Execute<ItemGetResponse>(request3).Item.PropsName;
         pModel.Tags = tags.GetTagStr(propsName);
         Post.ProductName = pModel.ProductName;
         if (!string.IsNullOrEmpty(Post.Description))
         {
             Post.Description = Post.Description + "</br><a target='_blank' style='color: #FF7CAE' href='{ProductUrl} '>" + Post.ProductName + "</a>";
         }
         else
         {
             Post.Description = "<a target='_blank' style='color: #FF7CAE' href='{ProductUrl} '>" + Post.ProductName + "</a>";
         }
     }
     else if (Post.Type == 0)
     {
         string str3;
         if (!string.IsNullOrEmpty(Post.ImageUrl))
         {
             str3 = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("SNS_check_photo");
             if (!string.IsNullOrEmpty(str3))
             {
                 Post.Status = (str3 == "0") ? 1 : 0;
             }
             else
             {
                 Post.Status = 1;
             }
         }
         else if (!string.IsNullOrEmpty(Post.VideoUrl) && (Post.VideoUrl.Length > 5))
         {
             Post.Type = 3;
             str3 = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("SNS_check_video");
             if (!string.IsNullOrEmpty(str3))
             {
                 Post.Status = (str3 == "0") ? 1 : 0;
             }
             else
             {
                 Post.Status = 1;
             }
         }
         else if (!string.IsNullOrEmpty(Post.AudioUrl))
         {
             str3 = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("SNS_check_audio");
             if (!string.IsNullOrEmpty(str3))
             {
                 Post.Status = (str3 == "0") ? 1 : 0;
             }
             else
             {
                 Post.Status = 1;
             }
         }
         else
         {
             str3 = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("chk_check_word");
             if (!string.IsNullOrEmpty(str3))
             {
                 Post.Status = (str3 == "0") ? 1 : 0;
             }
             else
             {
                 Post.Status = 1;
             }
         }
     }
     else if ((Post.Type == 1) && !string.IsNullOrEmpty(Post.ImageUrl))
     {
         string str4 = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("SNS_check_picture");
         if (!string.IsNullOrEmpty(str4))
         {
             Post.Status = (str4 == "0") ? 1 : 0;
         }
         else
         {
             Post.Status = 1;
         }
     }
     string valueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("SNS_ProductAndPhotoRecommandState");
     int recommandStateInt = (valueByCache != null) ? Globals.SafeInt(valueByCache, 0) : 0;
     if (FilterWords.ContainsModWords(Post.Description))
     {
         Post.Status = 0;
     }
     else
     {
         Post.Description = FilterWords.ReplaceWords(Post.Description);
     }
     Maticsoft.Model.SNS.Posts posts = this.dal.AddPost(Post, AblumId, Pid, PhotoCateId, pModel, recommandStateInt, PhotoAddress, MapLng, MapLat, CreatePost);
     Maticsoft.BLL.SNS.ReferUsers users = new Maticsoft.BLL.SNS.ReferUsers();
     if (posts != null)
     {
         users.AddEx(Post.Description, EnumHelper.ReferType.Post, posts.PostID, "");
     }
     return posts;
 }