public bool UpdateToaobProduct(TaobaoProductInfo taobaoProduct) { DbCommand sqlStringCommand = this.database.GetSqlStringCommand("DELETE FROM Taobao_Products WHERE ProductId = @ProductId;INSERT INTO Taobao_Products(Cid, StuffStatus, ProductId, ProTitle,Num, LocationState, LocationCity, FreightPayer, PostFee, ExpressFee, EMSFee, HasInvoice, HasWarranty, HasDiscount, ValidThru, ListTime, PropertyAlias,InputPids,InputStr, SkuProperties, SkuQuantities, SkuPrices, SkuOuterIds) VALUES(@Cid, @StuffStatus, @ProductId, @ProTitle,@Num, @LocationState, @LocationCity, @FreightPayer, @PostFee, @ExpressFee, @EMSFee, @HasInvoice, @HasWarranty, @HasDiscount, @ValidThru, @ListTime,@PropertyAlias,@InputPids, @InputStr, @SkuProperties, @SkuQuantities, @SkuPrices, @SkuOuterIds);"); this.database.AddInParameter(sqlStringCommand, "ProductId", DbType.Int32, taobaoProduct.ProductId); this.database.AddInParameter(sqlStringCommand, "Cid", DbType.Int64, taobaoProduct.Cid); this.database.AddInParameter(sqlStringCommand, "StuffStatus", DbType.String, taobaoProduct.StuffStatus); this.database.AddInParameter(sqlStringCommand, "ProTitle", DbType.String, taobaoProduct.ProTitle); this.database.AddInParameter(sqlStringCommand, "Num", DbType.Int64, taobaoProduct.Num); this.database.AddInParameter(sqlStringCommand, "LocationState", DbType.String, taobaoProduct.LocationState); this.database.AddInParameter(sqlStringCommand, "LocationCity", DbType.String, taobaoProduct.LocationCity); this.database.AddInParameter(sqlStringCommand, "FreightPayer", DbType.String, taobaoProduct.FreightPayer); this.database.AddInParameter(sqlStringCommand, "PostFee", DbType.Currency, taobaoProduct.PostFee); this.database.AddInParameter(sqlStringCommand, "ExpressFee", DbType.Currency, taobaoProduct.ExpressFee); this.database.AddInParameter(sqlStringCommand, "EMSFee", DbType.Currency, taobaoProduct.EMSFee); this.database.AddInParameter(sqlStringCommand, "HasInvoice", DbType.Boolean, taobaoProduct.HasInvoice); this.database.AddInParameter(sqlStringCommand, "HasWarranty", DbType.Boolean, taobaoProduct.HasWarranty); this.database.AddInParameter(sqlStringCommand, "HasDiscount", DbType.Boolean, taobaoProduct.HasDiscount); this.database.AddInParameter(sqlStringCommand, "ValidThru", DbType.Int64, taobaoProduct.ValidThru); this.database.AddInParameter(sqlStringCommand, "ListTime", DbType.DateTime, taobaoProduct.ListTime); this.database.AddInParameter(sqlStringCommand, "PropertyAlias", DbType.String, taobaoProduct.PropertyAlias); this.database.AddInParameter(sqlStringCommand, "InputPids", DbType.String, taobaoProduct.InputPids); this.database.AddInParameter(sqlStringCommand, "InputStr", DbType.String, taobaoProduct.InputStr); this.database.AddInParameter(sqlStringCommand, "SkuProperties", DbType.String, taobaoProduct.SkuProperties); this.database.AddInParameter(sqlStringCommand, "SkuQuantities", DbType.String, taobaoProduct.SkuQuantities); this.database.AddInParameter(sqlStringCommand, "SkuPrices", DbType.String, taobaoProduct.SkuPrices); this.database.AddInParameter(sqlStringCommand, "SkuOuterIds", DbType.String, taobaoProduct.SkuOuterIds); return(this.database.ExecuteNonQuery(sqlStringCommand) > 0); }
private TaobaoProductInfo GetTaobaoProduct(HttpContext context) { TaobaoProductInfo info = new TaobaoProductInfo { Cid = long.Parse(context.Request.Form["Cid"]), StuffStatus = context.Request.Form["StuffStatus"], LocationState = context.Request.Form["LocationState"], LocationCity = context.Request.Form["LocationCity"], FreightPayer = context.Request.Form["FreightPayer"] }; if (!string.IsNullOrEmpty(context.Request.Form["PostFee"])) { info.PostFee = decimal.Parse(context.Request.Form["PostFee"]); } if (!string.IsNullOrEmpty(context.Request.Form["ExpressFee"])) { info.ExpressFee = decimal.Parse(context.Request.Form["ExpressFee"]); } if (!string.IsNullOrEmpty(context.Request.Form["EMSFee"])) { info.EMSFee = decimal.Parse(context.Request.Form["EMSFee"]); } info.HasInvoice = bool.Parse(context.Request.Form["HasInvoice"]); info.HasWarranty = bool.Parse(context.Request.Form["HasWarranty"]); info.HasDiscount = false; info.ListTime = DateTime.Now; info.PropertyAlias = context.Request.Form["PropertyAlias"]; info.InputPids = context.Request.Form["InputPids"]; info.InputStr = context.Request.Form["InputStr"]; info.SkuProperties = context.Request.Form["SkuProperties"]; info.SkuQuantities = context.Request.Form["SkuQuantities"]; info.SkuPrices = context.Request.Form["SkuPrices"]; info.SkuOuterIds = context.Request.Form["SkuOuterIds"]; return(info); }
private void ProcessTaobaoProductMake(System.Web.HttpContext context) { TaobaoProductInfo taobaoProduct = this.GetTaobaoProduct(context); taobaoProduct.ProductId = int.Parse(context.Request.Form["ProductId"]); taobaoProduct.ProTitle = context.Request.Form["ProTitle"]; taobaoProduct.Num = long.Parse(context.Request.Form["Num"]); taobaoProduct.FoodAttributes = context.Request.Form["FoodAttributes"]; bool flag = ProductHelper.UpdateToaobProduct(taobaoProduct); context.Response.Write(flag.ToString()); }
private void ProcessTaobaoProductDown(HttpContext context) { long taobaoProductId = 0L; if (long.TryParse(context.Request.Form["TaobaoProductId"], out taobaoProductId) && ProductHelper.IsExitTaobaoProduct(taobaoProductId)) { return; } ProductInfo productInfo = new ProductInfo(); productInfo.AuditStatus = ProductAuditStatus.Pass; productInfo.CategoryId = 0; productInfo.BrandId = 0; productInfo.ProductName = HttpUtility.UrlDecode(context.Request.Form["ProductName"]).ToString().Replace("\\", ""); productInfo.ProductCode = context.Request.Form["ProductCode"]; productInfo.Description = HttpUtility.UrlDecode(context.Request.Form["Description"]).ToString().Replace("\\", ""); if (context.Request.Form["SaleStatus"] == "onsale") { productInfo.SaleStatus = ProductSaleStatus.OnSale; } else { productInfo.SaleStatus = ProductSaleStatus.OnStock; } productInfo.AddedDate = DateTime.Parse(context.Request.Form["AddedDate"]); productInfo.TaobaoProductId = taobaoProductId; string text = context.Request.Form["ImageUrls"]; if (!string.IsNullOrEmpty(text)) { this.DownloadImage(productInfo, text, context); } productInfo.TypeId = ProductTypeHelper.GetTypeId(context.Request.Form["TypeName"]); decimal weight = decimal.Parse(context.Request.Form["Weight"]); Dictionary <string, SKUItem> skus = this.GetSkus(productInfo, weight, context); ProductActionStatus productActionStatus = ProductHelper.AddProduct(productInfo, skus, null, null, null, true, ""); if (productActionStatus == ProductActionStatus.Success) { TaobaoProductInfo taobaoProduct = this.GetTaobaoProduct(context); taobaoProduct.ProductId = productInfo.ProductId; taobaoProduct.ProTitle = productInfo.ProductName; taobaoProduct.Num = productInfo.Stock; ProductHelper.UpdateToaobProduct(taobaoProduct); } context.Response.ContentType = "text/string"; context.Response.Write(productActionStatus.ToString()); }
private void ProcessTaobaoProductDown(System.Web.HttpContext context) { ProductInfo productInfo = new ProductInfo(); productInfo.CategoryId = 0; productInfo.BrandId = new int?(0); productInfo.ProductName = System.Web.HttpUtility.UrlDecode(context.Request.Form["ProductName"]); productInfo.ProductCode = context.Request.Form["ProductCode"]; productInfo.Description = System.Web.HttpUtility.UrlDecode(context.Request.Form["Description"]); if (context.Request.Form["SaleStatus"] == "onsale") { productInfo.SaleStatus = ProductSaleStatus.OnSale; } else { productInfo.SaleStatus = ProductSaleStatus.OnStock; } productInfo.AddedDate = System.DateTime.Parse(context.Request.Form["AddedDate"]); productInfo.TaobaoProductId = long.Parse(context.Request.Form["TaobaoProductId"]); string text = context.Request.Form["ImageUrls"]; if (!string.IsNullOrEmpty(text)) { this.DownloadImage(productInfo, text, context); } productInfo.TypeId = new int?(ProductTypeHelper.GetTypeId(context.Request.Form["TypeName"])); int weight = int.Parse(context.Request.Form["Weight"]); System.Collections.Generic.Dictionary <string, SKUItem> skus = this.GetSkus(productInfo, weight, context); productInfo.LowestSalePrice = skus.Values.First <SKUItem>().SalePrice; ProductActionStatus productActionStatus = ProductHelper.AddProduct(productInfo, skus, null, null); if (productActionStatus == ProductActionStatus.Success) { TaobaoProductInfo taobaoProduct = this.GetTaobaoProduct(context); taobaoProduct.ProductId = productInfo.ProductId; taobaoProduct.ProTitle = productInfo.ProductName; taobaoProduct.Num = (long)productInfo.Stock; if (productInfo.Stock <= 0) { taobaoProduct.Num = long.Parse(context.Request.Form["Stock"]); } ProductHelper.UpdateToaobProduct(taobaoProduct); } context.Response.Write(productActionStatus.ToString()); }
private void ProcessTaobaoProductDown(HttpContext context) { ProductInfo product = new ProductInfo { CategoryId = 0, BrandId = 0, ProductName = HttpUtility.UrlDecode(context.Request.Form["ProductName"]), ProductCode = context.Request.Form["ProductCode"], Description = HttpUtility.UrlDecode(context.Request.Form["Description"]) }; if (context.Request.Form["SaleStatus"] == "onsale") { product.SaleStatus = ProductSaleStatus.OnSale; } else { product.SaleStatus = ProductSaleStatus.OnStock; } product.AddedDate = DateTime.Parse(context.Request.Form["AddedDate"]); product.TaobaoProductId = long.Parse(context.Request.Form["TaobaoProductId"]); string str = context.Request.Form["ImageUrls"]; if (!string.IsNullOrEmpty(str)) { this.DownloadImage(product, str, context); } product.TypeId = new int?(ProductTypeHelper.GetTypeId(context.Request.Form["TypeName"])); int weight = int.Parse(context.Request.Form["Weight"]); Dictionary <string, SKUItem> skus = this.GetSkus(product, weight, context); ProductActionStatus status = ProductHelper.AddProduct(product, skus, null, null); if (status == ProductActionStatus.Success) { TaobaoProductInfo taobaoProduct = this.GetTaobaoProduct(context); taobaoProduct.ProductId = product.ProductId; taobaoProduct.ProTitle = product.ProductName; taobaoProduct.Num = product.Stock; if (product.Stock <= 0) { taobaoProduct.Num = long.Parse(context.Request.Form["Stock"]); } ProductHelper.UpdateToaobProduct(taobaoProduct); } context.Response.Write(status.ToString()); }
private void ProcessTaobaoProductMake(HttpContext context) { try { long num = 0L; long.TryParse(context.Request.Form["Num"].ToNullString(), out num); TaobaoProductInfo taobaoProduct = this.GetTaobaoProduct(context); taobaoProduct.ProductId = int.Parse(context.Request.Form["ProductId"]); taobaoProduct.ProTitle = context.Request.Form["ProTitle"]; taobaoProduct.Num = num; taobaoProduct.FoodAttributes = context.Request.Form["FoodAttributes"]; bool flag = ProductHelper.UpdateToaobProduct(taobaoProduct); context.Response.Write(flag.ToString()); } catch (Exception ex) { NameValueCollection nameValueCollection = new NameValueCollection { HttpContext.Current.Request.Form, HttpContext.Current.Request.QueryString }; nameValueCollection.Add("ErrorMessage", ex.Message); nameValueCollection.Add("StackTrace", ex.StackTrace); if (ex.InnerException != null) { nameValueCollection.Add("InnerException", ex.InnerException.ToString()); } if (ex.GetBaseException() != null) { nameValueCollection.Add("BaseException", ex.GetBaseException().Message); } if (ex.TargetSite != (MethodBase)null) { nameValueCollection.Add("TargetSite", ex.TargetSite.ToString()); } nameValueCollection.Add("ExSource", ex.Source); Globals.AppendLog(nameValueCollection, "", "", HttpContext.Current.Request.Url.ToString(), "TaobaoProduct"); } }
protected void Page_Load(object sender, System.EventArgs e) { TaobaoProductInfo taobaoProductInfo = new TaobaoProductInfo(); string s = base.Request.Form["productid"]; string stuffStatus = base.Request.Form["stuffstatus"]; string proTitle = base.Request.Form["title"]; long num = long.Parse(base.Request.Form["num"]); string locationCity = base.Request.Form["locationcity"]; string locationState = base.Request.Form["LocationState"]; string value = base.Request.Form["Cid"]; string value2 = base.Request.Form["hasinvoice"]; string value3 = base.Request.Form["HasWarranty"]; string propertyAlias = base.Request.Form["props"]; string text = base.Request.Form["inputpids"]; string text2 = base.Request.Form["inputstr"]; string text3 = base.Request.Form["skuproperties"]; string text4 = base.Request.Form["skuquantities"]; string text5 = base.Request.Form["skuprices"]; string text6 = base.Request.Form["skuouterids"]; string text7 = base.Request.Form["freightpayer"]; string text8 = base.Request.Form["FoodAttributes"]; if (text7 == "buyer") { string s2 = base.Request.Form["postfee"]; string s3 = base.Request.Form["expressfee"]; string s4 = base.Request.Form["emsfee"]; taobaoProductInfo.PostFee = decimal.Parse(s2); taobaoProductInfo.EMSFee = decimal.Parse(s4); taobaoProductInfo.ExpressFee = decimal.Parse(s3); } if (!string.IsNullOrEmpty(text8)) { taobaoProductInfo.FoodAttributes = System.Web.HttpUtility.UrlDecode(text8); } taobaoProductInfo.ProductId = int.Parse(s); taobaoProductInfo.StuffStatus = stuffStatus; taobaoProductInfo.PropertyAlias = propertyAlias; taobaoProductInfo.ProTitle = proTitle; taobaoProductInfo.Num = num; taobaoProductInfo.LocationState = locationState; taobaoProductInfo.LocationCity = locationCity; taobaoProductInfo.FreightPayer = text7; taobaoProductInfo.Cid = System.Convert.ToInt64(value); if (!string.IsNullOrEmpty(text)) { taobaoProductInfo.InputPids = text; } if (!string.IsNullOrEmpty(text2)) { taobaoProductInfo.InputStr = text2; } if (!string.IsNullOrEmpty(text3)) { taobaoProductInfo.SkuProperties = text3; } if (!string.IsNullOrEmpty(text5)) { taobaoProductInfo.SkuPrices = text5; } if (!string.IsNullOrEmpty(text6)) { taobaoProductInfo.SkuOuterIds = text6; } if (!string.IsNullOrEmpty(text4)) { taobaoProductInfo.SkuQuantities = text4; } taobaoProductInfo.HasInvoice = System.Convert.ToBoolean(value2); taobaoProductInfo.HasWarranty = System.Convert.ToBoolean(value3); taobaoProductInfo.HasDiscount = false; taobaoProductInfo.ListTime = System.DateTime.Now; if (ProductHelper.UpdateToaobProduct(taobaoProductInfo)) { this.litmsg.Text = "制作淘宝格式的商品数据成功"; return; } this.litmsg.Text = "制作淘宝格式的商品数据失败"; }
public abstract bool UpdateToaobProduct(TaobaoProductInfo taobaoProduct);
protected void Page_Load(object sender, EventArgs e) { TaobaoProductInfo taobaoProduct = new TaobaoProductInfo(); string s = base.Request.Form["productid"]; string str2 = base.Request.Form["stuffstatus"]; string str3 = base.Request.Form["title"]; long num = long.Parse(base.Request.Form["num"]); string str4 = base.Request.Form["locationcity"]; string str5 = base.Request.Form["LocationState"]; string str6 = base.Request.Form["Cid"]; string str7 = base.Request.Form["hasinvoice"]; string str8 = base.Request.Form["HasWarranty"]; string str9 = base.Request.Form["props"]; string str10 = base.Request.Form["inputpids"]; string str11 = base.Request.Form["inputstr"]; string str12 = base.Request.Form["skuproperties"]; string str13 = base.Request.Form["skuquantities"]; string str14 = base.Request.Form["skuprices"]; string str15 = base.Request.Form["skuouterids"]; string str16 = base.Request.Form["freightpayer"]; if (str16 == "buyer") { string str17 = base.Request.Form["postfee"]; string str18 = base.Request.Form["expressfee"]; string str19 = base.Request.Form["emsfee"]; taobaoProduct.PostFee = decimal.Parse(str17); taobaoProduct.EMSFee = decimal.Parse(str19); taobaoProduct.ExpressFee = decimal.Parse(str18); } taobaoProduct.ProductId = int.Parse(s); taobaoProduct.StuffStatus = str2; taobaoProduct.PropertyAlias = str9; taobaoProduct.ProTitle = str3; taobaoProduct.Num = num; taobaoProduct.LocationState = str5; taobaoProduct.LocationCity = str4; taobaoProduct.FreightPayer = str16; taobaoProduct.Cid = Convert.ToInt64(str6); if (!string.IsNullOrEmpty(str10)) { taobaoProduct.InputPids = str10; } if (!string.IsNullOrEmpty(str11)) { taobaoProduct.InputStr = str11; } if (!string.IsNullOrEmpty(str12)) { taobaoProduct.SkuProperties = str12; } if (!string.IsNullOrEmpty(str14)) { taobaoProduct.SkuPrices = str14; } if (!string.IsNullOrEmpty(str15)) { taobaoProduct.SkuOuterIds = str15; } if (!string.IsNullOrEmpty(str13)) { taobaoProduct.SkuQuantities = str13; } taobaoProduct.HasInvoice = Convert.ToBoolean(str7); taobaoProduct.HasWarranty = Convert.ToBoolean(str8); taobaoProduct.HasDiscount = false; taobaoProduct.ListTime = DateTime.Now; if (ProductHelper.UpdateToaobProduct(taobaoProduct)) { this.litmsg.Text = "制作淘宝格式的商品数据成功"; } else { this.litmsg.Text = "制作淘宝格式的商品数据失败"; } }
public static void ImportProducts(DataTable productData, int categoryId, int lineId, string brandId, ProductSaleStatus saleStatus, bool isImportFromTaobao) { if ((productData != null) && (productData.Rows.Count > 0)) { foreach (DataRow row in productData.Rows) { ProductInfo product = new ProductInfo { CategoryId = categoryId, MainCategoryPath = CatalogHelper.GetCategory(categoryId).Path + "|", ProductName = (string)row["ProductName"], ProductCode = (string)row["SKU"], BrandId = brandId }; if (row["Description"] != DBNull.Value) { product.Description = (string)row["Description"]; } product.AddedDate = DateTime.Now; product.SaleStatus = saleStatus; product.HasSKU = false; HttpContext current = HttpContext.Current; if (row["ImageUrl1"] != DBNull.Value) { product.ImageUrl1 = (string)row["ImageUrl1"]; } if (!string.IsNullOrEmpty(product.ImageUrl1) && (product.ImageUrl1.Length > 0)) { string[] strArray = ProcessImages(current, product.ImageUrl1); product.ThumbnailUrl40 = strArray[0]; product.ThumbnailUrl60 = strArray[1]; product.ThumbnailUrl100 = strArray[2]; product.ThumbnailUrl160 = strArray[3]; product.ThumbnailUrl180 = strArray[4]; product.ThumbnailUrl220 = strArray[5]; product.ThumbnailUrl310 = strArray[6]; product.ThumbnailUrl410 = strArray[7]; } if (row["ImageUrl2"] != DBNull.Value) { product.ImageUrl2 = (string)row["ImageUrl2"]; } if (!string.IsNullOrEmpty(product.ImageUrl2) && (product.ImageUrl2.Length > 0)) { ProcessImages(current, product.ImageUrl2); } if (row["ImageUrl3"] != DBNull.Value) { product.ImageUrl3 = (string)row["ImageUrl3"]; } if (!string.IsNullOrEmpty(product.ImageUrl3) && (product.ImageUrl3.Length > 0)) { ProcessImages(current, product.ImageUrl3); } if (row["ImageUrl4"] != DBNull.Value) { product.ImageUrl4 = (string)row["ImageUrl4"]; } if (!string.IsNullOrEmpty(product.ImageUrl4) && (product.ImageUrl4.Length > 0)) { ProcessImages(current, product.ImageUrl4); } if (row["ImageUrl5"] != DBNull.Value) { product.ImageUrl5 = (string)row["ImageUrl5"]; } if (!string.IsNullOrEmpty(product.ImageUrl5) && (product.ImageUrl5.Length > 0)) { ProcessImages(current, product.ImageUrl5); } SKUItem item = new SKUItem { SkuId = "0", SKU = (string)row["SKU"] }; if (row["Stock"] != DBNull.Value) { item.Stock = (int)row["Stock"]; } if (row["Weight"] != DBNull.Value) { item.Weight = (decimal)row["Weight"]; } item.SalePrice = (decimal)row["SalePrice"]; Dictionary <string, SKUItem> skus = new Dictionary <string, SKUItem>(); skus.Add(item.SkuId, item); ProductActionStatus status = AddProduct(product, skus, null, null); if (isImportFromTaobao && (status == ProductActionStatus.Success)) { TaobaoProductInfo taobaoProduct = new TaobaoProductInfo { ProductId = product.ProductId, ProTitle = product.ProductName, Cid = (long)row["Cid"] }; if (row["StuffStatus"] != DBNull.Value) { taobaoProduct.StuffStatus = (string)row["StuffStatus"]; } taobaoProduct.Num = (long)row["Num"]; taobaoProduct.LocationState = (string)row["LocationState"]; taobaoProduct.LocationCity = (string)row["LocationCity"]; taobaoProduct.FreightPayer = (string)row["FreightPayer"]; if (row["PostFee"] != DBNull.Value) { taobaoProduct.PostFee = (decimal)row["PostFee"]; } if (row["ExpressFee"] != DBNull.Value) { taobaoProduct.ExpressFee = (decimal)row["ExpressFee"]; } if (row["EMSFee"] != DBNull.Value) { taobaoProduct.EMSFee = (decimal)row["EMSFee"]; } taobaoProduct.HasInvoice = (bool)row["HasInvoice"]; taobaoProduct.HasWarranty = (bool)row["HasWarranty"]; taobaoProduct.HasDiscount = (bool)row["HasDiscount"]; taobaoProduct.ValidThru = (long)row["ValidThru"]; if (row["ListTime"] != DBNull.Value) { taobaoProduct.ListTime = (DateTime)row["ListTime"]; } else { taobaoProduct.ListTime = DateTime.Now; } if (row["PropertyAlias"] != DBNull.Value) { taobaoProduct.PropertyAlias = (string)row["PropertyAlias"]; } if (row["InputPids"] != DBNull.Value) { taobaoProduct.InputPids = (string)row["InputPids"]; } if (row["InputStr"] != DBNull.Value) { taobaoProduct.InputStr = (string)row["InputStr"]; } if (row["SkuProperties"] != DBNull.Value) { taobaoProduct.SkuProperties = (string)row["SkuProperties"]; } if (row["SkuQuantities"] != DBNull.Value) { taobaoProduct.SkuQuantities = (string)row["SkuQuantities"]; } if (row["SkuPrices"] != DBNull.Value) { taobaoProduct.SkuPrices = (string)row["SkuPrices"]; } if (row["SkuOuterIds"] != DBNull.Value) { taobaoProduct.SkuOuterIds = (string)row["SkuOuterIds"]; } UpdateToaobProduct(taobaoProduct); } } } }
public static bool UpdateToaobProduct(TaobaoProductInfo taobaoProduct) { return(new TaobaoProductDao().UpdateToaobProduct(taobaoProduct)); }
protected void Page_Load(object sender, EventArgs e) { TaobaoProductInfo taobaoProduct = new TaobaoProductInfo(); string productid = Request.Form["productid"]; string stuffstatus = Request.Form["stuffstatus"]; string title = Request.Form["title"]; long num = long.Parse(Request.Form["num"]); string locationcity = Request.Form["locationcity"]; string LocationState = Request.Form["LocationState"]; string Cid = Request.Form["Cid"]; string hasinvoice = Request.Form["hasinvoice"]; string HasWarranty = Request.Form["HasWarranty"]; string props = Request.Form["props"]; string inputpids = Request.Form["inputpids"]; string inputstr = Request.Form["inputstr"]; string skuproperties = Request.Form["skuproperties"]; string skuquantities = Request.Form["skuquantities"]; string skuprices = Request.Form["skuprices"]; string skuouterids = Request.Form["skuouterids"]; string freightpayer = Request.Form["freightpayer"]; if (freightpayer == "buyer") { string postfee = Request.Form["postfee"]; string expressfee = Request.Form["expressfee"]; string emsfee = Request.Form["emsfee"]; taobaoProduct.PostFee = decimal.Parse(postfee); taobaoProduct.EMSFee = decimal.Parse(expressfee); taobaoProduct.ExpressFee = decimal.Parse(emsfee); } taobaoProduct.ProductId = int.Parse(productid); taobaoProduct.StuffStatus = stuffstatus; taobaoProduct.PropertyAlias = props; taobaoProduct.ProTitle = title; taobaoProduct.Num = num; taobaoProduct.LocationState = LocationState; taobaoProduct.LocationCity = locationcity; taobaoProduct.FreightPayer = freightpayer; taobaoProduct.Cid = Convert.ToInt32(Cid); if (!string.IsNullOrEmpty(inputpids)) { taobaoProduct.InputPids = inputpids; } if (!string.IsNullOrEmpty(inputstr)) { taobaoProduct.InputStr = inputstr; } if (!string.IsNullOrEmpty(skuproperties)) { taobaoProduct.SkuProperties = skuproperties; } if (!string.IsNullOrEmpty(skuprices)) { taobaoProduct.SkuPrices = skuprices; } if (!string.IsNullOrEmpty(skuouterids)) { taobaoProduct.SkuOuterIds = skuouterids; } if (!string.IsNullOrEmpty(skuquantities)) { taobaoProduct.SkuQuantities = skuquantities; } taobaoProduct.HasInvoice = Convert.ToBoolean(hasinvoice); taobaoProduct.HasWarranty = Convert.ToBoolean(HasWarranty); taobaoProduct.HasDiscount = false; taobaoProduct.ListTime = DateTime.Now; if (ProductHelper.UpdateToaobProduct(taobaoProduct)) { litmsg.Text = "制作淘宝格式的商品数据成功"; } else { litmsg.Text = "制作淘宝格式的商品数据失败"; } }
public static bool UpdateToaobProduct(TaobaoProductInfo taobaoProduct) { return ProductProvider.Instance().UpdateToaobProduct(taobaoProduct); }
public override bool UpdateToaobProduct(TaobaoProductInfo taobaoProduct) { DbCommand sqlStringCommand = database.GetSqlStringCommand("DELETE FROM Taobao_Products WHERE ProductId = @ProductId;INSERT INTO Taobao_Products(Cid, StuffStatus, ProductId, ProTitle,Num, LocationState, LocationCity, FreightPayer, PostFee, ExpressFee, EMSFee, HasInvoice, HasWarranty, HasDiscount, ValidThru, ListTime, PropertyAlias,InputPids,InputStr, SkuProperties, SkuQuantities, SkuPrices, SkuOuterIds) VALUES(@Cid, @StuffStatus, @ProductId, @ProTitle,@Num, @LocationState, @LocationCity, @FreightPayer, @PostFee, @ExpressFee, @EMSFee, @HasInvoice, @HasWarranty, @HasDiscount, @ValidThru, @ListTime,@PropertyAlias,@InputPids, @InputStr, @SkuProperties, @SkuQuantities, @SkuPrices, @SkuOuterIds);update Taobao_DistroProducts set updatestatus=1 where ProductId = @ProductId"); database.AddInParameter(sqlStringCommand, "ProductId", DbType.Int32, taobaoProduct.ProductId); database.AddInParameter(sqlStringCommand, "Cid", DbType.Int32, taobaoProduct.Cid); database.AddInParameter(sqlStringCommand, "StuffStatus", DbType.String, taobaoProduct.StuffStatus); database.AddInParameter(sqlStringCommand, "ProTitle", DbType.String, taobaoProduct.ProTitle); database.AddInParameter(sqlStringCommand, "Num", DbType.Int64, taobaoProduct.Num); database.AddInParameter(sqlStringCommand, "LocationState", DbType.String, taobaoProduct.LocationState); database.AddInParameter(sqlStringCommand, "LocationCity", DbType.String, taobaoProduct.LocationCity); database.AddInParameter(sqlStringCommand, "FreightPayer", DbType.String, taobaoProduct.FreightPayer); database.AddInParameter(sqlStringCommand, "PostFee", DbType.Currency, taobaoProduct.PostFee); database.AddInParameter(sqlStringCommand, "ExpressFee", DbType.Currency, taobaoProduct.ExpressFee); database.AddInParameter(sqlStringCommand, "EMSFee", DbType.Currency, taobaoProduct.EMSFee); database.AddInParameter(sqlStringCommand, "HasInvoice", DbType.Boolean, taobaoProduct.HasInvoice); database.AddInParameter(sqlStringCommand, "HasWarranty", DbType.Boolean, taobaoProduct.HasWarranty); database.AddInParameter(sqlStringCommand, "HasDiscount", DbType.Boolean, taobaoProduct.HasDiscount); database.AddInParameter(sqlStringCommand, "ValidThru", DbType.Int32, taobaoProduct.ValidThru); database.AddInParameter(sqlStringCommand, "ListTime", DbType.DateTime, taobaoProduct.ListTime); database.AddInParameter(sqlStringCommand, "PropertyAlias", DbType.String, taobaoProduct.PropertyAlias); database.AddInParameter(sqlStringCommand, "InputPids", DbType.String, taobaoProduct.InputPids); database.AddInParameter(sqlStringCommand, "InputStr", DbType.String, taobaoProduct.InputStr); database.AddInParameter(sqlStringCommand, "SkuProperties", DbType.String, taobaoProduct.SkuProperties); database.AddInParameter(sqlStringCommand, "SkuQuantities", DbType.String, taobaoProduct.SkuQuantities); database.AddInParameter(sqlStringCommand, "SkuPrices", DbType.String, taobaoProduct.SkuPrices); database.AddInParameter(sqlStringCommand, "SkuOuterIds", DbType.String, taobaoProduct.SkuOuterIds); return (database.ExecuteNonQuery(sqlStringCommand) > 0); }
public static bool UpdateToaobProduct(TaobaoProductInfo taobaoProduct) { return(ProductProvider.Instance().UpdateToaobProduct(taobaoProduct)); }