private void BindColor() { int num = Globals.SafeInt(this.Id, 0); Maticsoft.BLL.SNS.Products products = new Maticsoft.BLL.SNS.Products(); Maticsoft.Model.SNS.Products model = new Maticsoft.Model.SNS.Products(); model = products.GetModel((long) num); if (model != null) { this.hidValue.Value = model.Color; } }
protected void btnSave_Click(object sender, EventArgs e) { int num = Globals.SafeInt(this.Id, 0); Maticsoft.BLL.SNS.Products products = new Maticsoft.BLL.SNS.Products(); Maticsoft.Model.SNS.Products model = new Maticsoft.Model.SNS.Products(); model = products.GetModel((long) num); if (model != null) { model.Color = this.hidValue.Value; products.Update(model); this.lblTip.Visible = true; LogHelp.AddUserLog(base.CurrentUser.UserName, base.CurrentUser.UserType, "更新商品(ProductId=" + num + ")的颜色成功", this); } this.BindColor(); }
public int AddEx(Maticsoft.Model.SNS.GroupTopicReply TModel, long Pid) { Maticsoft.Model.SNS.Products pModel = new Maticsoft.Model.SNS.Products(); Maticsoft.BLL.SNS.Products products2 = new Maticsoft.BLL.SNS.Products(); if (Pid > 0L) { pModel.ProductID = Pid; pModel.CreateUserID = TModel.ReplyUserID; pModel.CreatedNickName = TModel.ReplyNickName; pModel.CreatedDate = DateTime.Now; pModel = products2.GetProductModel(pModel); } if (FilterWords.ContainsModWords(TModel.Description)) { pModel.Status = 0; TModel.Status = 0; } else { TModel.Description = FilterWords.ReplaceWords(TModel.Description); } return this.dal.AddEx(TModel, pModel); }
public int AddEx(Maticsoft.Model.SNS.GroupTopics TModel, long Pid) { Maticsoft.Model.SNS.Products pModel = new Maticsoft.Model.SNS.Products(); Maticsoft.BLL.SNS.Products products2 = new Maticsoft.BLL.SNS.Products(); if (Pid > 0L) { pModel.ProductID = Pid; pModel.CreateUserID = TModel.CreatedUserID; pModel.CreatedNickName = TModel.CreatedNickName; pModel.CreatedDate = DateTime.Now; pModel = products2.GetProductModel(pModel); } string valueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("SNS_check_product"); pModel.Status = (valueByCache == "0") ? 1 : 0; bool boolValueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetBoolValueByCache("SNS_Check_GroupTopic"); TModel.Status = boolValueByCache ? 0 : 1; bool contains = false; if (FilterWords.ContainsModWords(TModel.Description)) { pModel.Status = 0; TModel.Status = 0; contains = true; } else { TModel.Description = FilterWords.ReplaceWords(TModel.Description, out contains); } if (contains && BanUserCheck(TModel.CreatedUserID)) { return -2; } Maticsoft.BLL.SNS.Groups groups = new Maticsoft.BLL.SNS.Groups(); Maticsoft.Model.SNS.Groups model = new Maticsoft.Model.SNS.Groups(); model = groups.GetModel(TModel.GroupID); TModel.GroupName = model.GroupName; return this.dal.AddEx(TModel, pModel); }
public Maticsoft.Model.SNS.Products DataRowToModel(DataRow row) { Maticsoft.Model.SNS.Products products = new Maticsoft.Model.SNS.Products(); if (row != null) { if ((row["ProductID"] != null) && (row["ProductID"].ToString() != "")) { products.ProductID = long.Parse(row["ProductID"].ToString()); } if (row["ProductName"] != null) { products.ProductName = row["ProductName"].ToString(); } if (row["ProductDescription"] != null) { products.ProductDescription = row["ProductDescription"].ToString(); } if ((row["Price"] != null) && (row["Price"].ToString() != "")) { products.Price = new decimal?(decimal.Parse(row["Price"].ToString())); } if ((row["ProductSourceID"] != null) && (row["ProductSourceID"].ToString() != "")) { products.ProductSourceID = new int?(int.Parse(row["ProductSourceID"].ToString())); } if ((row["CategoryID"] != null) && (row["CategoryID"].ToString() != "")) { products.CategoryID = new int?(int.Parse(row["CategoryID"].ToString())); } if (row["ProductUrl"] != null) { products.ProductUrl = row["ProductUrl"].ToString(); } if ((row["FavouriteCount"] != null) && (row["FavouriteCount"].ToString() != "")) { products.FavouriteCount = int.Parse(row["FavouriteCount"].ToString()); } if ((row["GroupBuyCount"] != null) && (row["GroupBuyCount"].ToString() != "")) { products.GroupBuyCount = new int?(int.Parse(row["GroupBuyCount"].ToString())); } if ((row["CreateUserID"] != null) && (row["CreateUserID"].ToString() != "")) { products.CreateUserID = int.Parse(row["CreateUserID"].ToString()); } if (row["CreatedNickName"] != null) { products.CreatedNickName = row["CreatedNickName"].ToString(); } if (row["ThumbImageUrl"] != null) { products.ThumbImageUrl = row["ThumbImageUrl"].ToString(); } if (row["NormalImageUrl"] != null) { products.NormalImageUrl = row["NormalImageUrl"].ToString(); } if ((row["PVCount"] != null) && (row["PVCount"].ToString() != "")) { products.PVCount = int.Parse(row["PVCount"].ToString()); } if ((row["IsRecomend"] != null) && (row["IsRecomend"].ToString() != "")) { products.IsRecomend = int.Parse(row["IsRecomend"].ToString()); } if ((row["Status"] != null) && (row["Status"].ToString() != "")) { products.Status = int.Parse(row["Status"].ToString()); } if ((row["Sequence"] != null) && (row["Sequence"].ToString() != "")) { products.Sequence = int.Parse(row["Sequence"].ToString()); } if (row["TopCommentsId"] != null) { products.TopCommentsId = row["TopCommentsId"].ToString(); } if ((row["CommentCount"] != null) && (row["CommentCount"].ToString() != "")) { products.CommentCount = int.Parse(row["CommentCount"].ToString()); } if ((row["ForwardedCount"] != null) && (row["ForwardedCount"].ToString() != "")) { products.ForwardedCount = new int?(int.Parse(row["ForwardedCount"].ToString())); } if (row["ShareDescription"] != null) { products.ShareDescription = row["ShareDescription"].ToString(); } if ((row["SkipCount"] != null) && (row["SkipCount"].ToString() != "")) { products.SkipCount = int.Parse(row["SkipCount"].ToString()); } if ((row["OwnerProductId"] != null) && (row["OwnerProductId"].ToString() != "")) { products.OwnerProductId = new int?(int.Parse(row["OwnerProductId"].ToString())); } if (row["Tags"] != null) { products.Tags = row["Tags"].ToString(); } if ((row["CreatedDate"] != null) && (row["CreatedDate"].ToString() != "")) { products.CreatedDate = DateTime.Parse(row["CreatedDate"].ToString()); } if (row["Color"] != null) { products.Color = row["Color"].ToString(); } if ((row["OriginalID"] != null) && (row["OriginalID"].ToString() != "")) { products.OriginalID = new long?(long.Parse(row["OriginalID"].ToString())); } if ((row["SourceType"] != null) && (row["SourceType"].ToString() != "")) { products.SourceType = new int?(int.Parse(row["SourceType"].ToString())); } if (row["StaticUrl"] != null) { products.StaticUrl = row["StaticUrl"].ToString(); } } return products; }
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; }