public List<Maticsoft.Model.Shop.Products.ProductImage> DataTableToList(DataTable dt) { List<Maticsoft.Model.Shop.Products.ProductImage> list = new List<Maticsoft.Model.Shop.Products.ProductImage>(); int count = dt.Rows.Count; if (count > 0) { for (int i = 0; i < count; i++) { Maticsoft.Model.Shop.Products.ProductImage item = new Maticsoft.Model.Shop.Products.ProductImage(); if ((dt.Rows[i]["ProductImageId"] != null) && (dt.Rows[i]["ProductImageId"].ToString() != "")) { item.ProductImageId = int.Parse(dt.Rows[i]["ProductImageId"].ToString()); } if ((dt.Rows[i]["ProductId"] != null) && (dt.Rows[i]["ProductId"].ToString() != "")) { item.ProductId = long.Parse(dt.Rows[i]["ProductId"].ToString()); } if ((dt.Rows[i]["ImageUrl"] != null) && (dt.Rows[i]["ImageUrl"].ToString() != "")) { item.ImageUrl = dt.Rows[i]["ImageUrl"].ToString(); } if ((dt.Rows[i]["ThumbnailUrl1"] != null) && (dt.Rows[i]["ThumbnailUrl1"].ToString() != "")) { item.ThumbnailUrl1 = dt.Rows[i]["ThumbnailUrl1"].ToString(); } if ((dt.Rows[i]["ThumbnailUrl2"] != null) && (dt.Rows[i]["ThumbnailUrl2"].ToString() != "")) { item.ThumbnailUrl2 = dt.Rows[i]["ThumbnailUrl2"].ToString(); } if ((dt.Rows[i]["ThumbnailUrl3"] != null) && (dt.Rows[i]["ThumbnailUrl3"].ToString() != "")) { item.ThumbnailUrl3 = dt.Rows[i]["ThumbnailUrl3"].ToString(); } if ((dt.Rows[i]["ThumbnailUrl4"] != null) && (dt.Rows[i]["ThumbnailUrl4"].ToString() != "")) { item.ThumbnailUrl4 = dt.Rows[i]["ThumbnailUrl4"].ToString(); } if ((dt.Rows[i]["ThumbnailUrl5"] != null) && (dt.Rows[i]["ThumbnailUrl5"].ToString() != "")) { item.ThumbnailUrl5 = dt.Rows[i]["ThumbnailUrl5"].ToString(); } if ((dt.Rows[i]["ThumbnailUrl6"] != null) && (dt.Rows[i]["ThumbnailUrl6"].ToString() != "")) { item.ThumbnailUrl6 = dt.Rows[i]["ThumbnailUrl6"].ToString(); } if ((dt.Rows[i]["ThumbnailUrl7"] != null) && (dt.Rows[i]["ThumbnailUrl7"].ToString() != "")) { item.ThumbnailUrl7 = dt.Rows[i]["ThumbnailUrl7"].ToString(); } if ((dt.Rows[i]["ThumbnailUrl8"] != null) && (dt.Rows[i]["ThumbnailUrl8"].ToString() != "")) { item.ThumbnailUrl8 = dt.Rows[i]["ThumbnailUrl8"].ToString(); } list.Add(item); } } return list; }
public Maticsoft.Model.Shop.Products.ProductImage GetModel(int ProductImageId) { StringBuilder builder = new StringBuilder(); builder.Append("SELECT TOP 1 ProductImageId,ProductId,ImageUrl,ThumbnailUrl1,ThumbnailUrl2,ThumbnailUrl3,ThumbnailUrl4,ThumbnailUrl5,ThumbnailUrl6,ThumbnailUrl7,ThumbnailUrl8 FROM Shop_ProductImages "); builder.Append(" WHERE ProductImageId=@ProductImageId"); SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@ProductImageId", SqlDbType.Int, 4) }; cmdParms[0].Value = ProductImageId; Maticsoft.Model.Shop.Products.ProductImage image = new Maticsoft.Model.Shop.Products.ProductImage(); DataSet set = DbHelperSQL.Query(builder.ToString(), cmdParms); if (set.Tables[0].Rows.Count <= 0) { return null; } if ((set.Tables[0].Rows[0]["ProductImageId"] != null) && (set.Tables[0].Rows[0]["ProductImageId"].ToString() != "")) { image.ProductImageId = int.Parse(set.Tables[0].Rows[0]["ProductImageId"].ToString()); } if ((set.Tables[0].Rows[0]["ProductId"] != null) && (set.Tables[0].Rows[0]["ProductId"].ToString() != "")) { image.ProductId = long.Parse(set.Tables[0].Rows[0]["ProductId"].ToString()); } if ((set.Tables[0].Rows[0]["ImageUrl"] != null) && (set.Tables[0].Rows[0]["ImageUrl"].ToString() != "")) { image.ImageUrl = set.Tables[0].Rows[0]["ImageUrl"].ToString(); } if ((set.Tables[0].Rows[0]["ThumbnailUrl1"] != null) && (set.Tables[0].Rows[0]["ThumbnailUrl1"].ToString() != "")) { image.ThumbnailUrl1 = set.Tables[0].Rows[0]["ThumbnailUrl1"].ToString(); } if ((set.Tables[0].Rows[0]["ThumbnailUrl2"] != null) && (set.Tables[0].Rows[0]["ThumbnailUrl2"].ToString() != "")) { image.ThumbnailUrl2 = set.Tables[0].Rows[0]["ThumbnailUrl2"].ToString(); } if ((set.Tables[0].Rows[0]["ThumbnailUrl3"] != null) && (set.Tables[0].Rows[0]["ThumbnailUrl3"].ToString() != "")) { image.ThumbnailUrl3 = set.Tables[0].Rows[0]["ThumbnailUrl3"].ToString(); } if ((set.Tables[0].Rows[0]["ThumbnailUrl4"] != null) && (set.Tables[0].Rows[0]["ThumbnailUrl4"].ToString() != "")) { image.ThumbnailUrl4 = set.Tables[0].Rows[0]["ThumbnailUrl4"].ToString(); } if ((set.Tables[0].Rows[0]["ThumbnailUrl5"] != null) && (set.Tables[0].Rows[0]["ThumbnailUrl5"].ToString() != "")) { image.ThumbnailUrl5 = set.Tables[0].Rows[0]["ThumbnailUrl5"].ToString(); } if ((set.Tables[0].Rows[0]["ThumbnailUrl6"] != null) && (set.Tables[0].Rows[0]["ThumbnailUrl6"].ToString() != "")) { image.ThumbnailUrl6 = set.Tables[0].Rows[0]["ThumbnailUrl6"].ToString(); } if ((set.Tables[0].Rows[0]["ThumbnailUrl7"] != null) && (set.Tables[0].Rows[0]["ThumbnailUrl7"].ToString() != "")) { image.ThumbnailUrl7 = set.Tables[0].Rows[0]["ThumbnailUrl7"].ToString(); } if ((set.Tables[0].Rows[0]["ThumbnailUrl8"] != null) && (set.Tables[0].Rows[0]["ThumbnailUrl8"].ToString() != "")) { image.ThumbnailUrl8 = set.Tables[0].Rows[0]["ThumbnailUrl8"].ToString(); } return image; }
private void SaveProductInfo() { if (string.IsNullOrWhiteSpace(this.Hidden_SelectValue.Value)) { MessageBox.ShowFailTip(this, "请选择产品分类!"); } else { string text = this.txtProductName.Text; int num = Globals.SafeInt(this.hfCurrentProductType.Value, -1); int num2 = Globals.SafeInt(this.hfCurrentProductBrand.Value, -1); int supplierId = base.SupplierId; int? nullable = new int?(Globals.SafeInt(this.ajaxRegion.SelectedValue, -1)); string str2 = this.txtUnit.Text; decimal? nullable2 = new decimal?(Globals.SafeDecimal(this.txtMarketPrice.Text, (decimal) -1M)); int num4 = Globals.SafeInt(this.txtDisplaySequence.Text, -1); string str3 = this.txtShortDescription.Text; string str4 = this.txtDescription.Text; string str5 = this.hfProductImages.Value; string str6 = this.hfCurrentAttributes.Value; string str7 = this.hfCurrentBaseProductSKUs.Value; string str8 = this.hfCurrentProductSKUs.Value; bool flag = false; string[] strArray = new string[0]; if (!string.IsNullOrWhiteSpace(str3)) { str3 = Globals.HtmlEncodeForSpaceWrap(str3); } if (!string.IsNullOrWhiteSpace(str5)) { strArray = str5.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries); } if (string.IsNullOrWhiteSpace(str6)) { MessageBox.Show(this, "属性信息不存在,请检查已填数据是否正确!"); } else { List<Maticsoft.Model.Shop.Products.AttributeInfo> list = this.GetAttributeInfo4Json(JsonMapper.ToObject(str6)); if (string.IsNullOrWhiteSpace(str7)) { MessageBox.Show(this, "基础SKU信息不存在,请检查已填数据是否正确!"); } else { List<Maticsoft.Model.Shop.Products.SKUInfo> list2 = null; decimal? nullable3 = 0M; flag = !string.IsNullOrWhiteSpace(str8); if (flag) { list2 = this.GetSKUInfo4Json(JsonMapper.ToObject(str8)); if (this.salePriceList.Count > 0) { this.salePriceList.Sort(); nullable3 = new decimal?(Convert.ToDecimal(this.salePriceList[0])); } } else { list2 = this.GetSKUInfo4Json(JsonMapper.ToObject(str7)); nullable3 = new decimal?(Globals.SafeDecimal(this.txtSalePrice.Text, (decimal) -1M)); } Maticsoft.Model.Shop.Products.ProductInfo productInfo = new Maticsoft.Model.Shop.Products.ProductInfo(); string[] strArray2 = this.Hidden_SelectValue.Value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); productInfo.Product_Categories = strArray2; productInfo.ProductName = text; productInfo.CategoryId = 0; productInfo.TypeId = new int?(num); productInfo.BrandId = num2; if (supplierId > 0) { productInfo.SupplierId = supplierId; } else { productInfo.SupplierId = -1; } productInfo.RegionId = (nullable == -1) ? null : nullable; productInfo.Unit = str2; productInfo.MarketPrice = (nullable2 == -1M) ? 0 : nullable2; productInfo.LowestSalePrice = nullable3.Value; productInfo.DisplaySequence = num4; productInfo.ProductCode = this.txtProductSKU.Text; productInfo.AddedDate = DateTime.Now; productInfo.SaleStatus = -1; productInfo.ShortDescription = str3; productInfo.Description = str4; productInfo.Tags = ""; if (strArray.Length == 0) { productInfo.ImageUrl = productInfo.ThumbnailUrl1 = productInfo.ThumbnailUrl2 = "/Content/themes/base/Shop/images/none.png"; } string newValue = string.Format("/Upload/Shop/Images/Product/{0}/", DateTime.Now.ToString("yyyyMMdd")); string str10 = "/Upload/Shop/Images/ProductThumbs/" + DateTime.Now.ToString("yyyyMMdd") + "/"; ArrayList list3 = new ArrayList(); for (int i = 0; i < strArray.Length; i++) { if (i == 0) { string str11 = string.Format(strArray[i], ""); string str12 = strArray[i]; productInfo.ImageUrl = str11.Replace(this.tempFile, newValue); productInfo.ThumbnailUrl1 = str12.Replace(this.tempFile, str10); list3.Add(str11.Replace(this.tempFile, "")); list3.Add(str12.Replace(this.tempFile, "")); } else { string str13 = string.Format(strArray[i], ""); string str14 = strArray[i]; Maticsoft.Model.Shop.Products.ProductImage item = new Maticsoft.Model.Shop.Products.ProductImage { ImageUrl = str13.Replace(this.tempFile, newValue), ThumbnailUrl1 = str14.Replace(this.tempFile, str10) }; productInfo.ProductImages.Add(item); list3.Add(str13.Replace(this.tempFile, "")); list3.Add(str14.Replace(this.tempFile, "")); } Maticsoft.BLL.Shop.Products.ProductImage.MoveImage(strArray[i], newValue, str10); } productInfo.AttributeInfos = list; productInfo.HasSKU = flag; productInfo.SkuInfos = list2; productInfo.isRec = this.chbRec.Checked; productInfo.isNow = this.chbNew.Checked; productInfo.isHot = this.chbHot.Checked; productInfo.isLowPrice = this.chbLowPrice.Checked; if (!string.IsNullOrEmpty(this.Hidden_SelectPackage.Value)) { Maticsoft.BLL.Shop.Package.Package package = new Maticsoft.BLL.Shop.Package.Package(); List<int> list4 = new List<int>(); string[] strArray3 = this.Hidden_SelectPackage.Value.Split(new char[] { ',' }); int packageId = 0; foreach (string str15 in strArray3) { packageId = Globals.SafeInt(str15, 0); if (package.Exists(packageId)) { list4.Add(packageId); } } productInfo.PackageId = list4; } long productId = 0L; if (ProductManage.AddProduct(productInfo, out productId)) { if (this.skuImageList.Count > 0) { FileManage.MoveFile(base.Server.MapPath(this.tempFile), base.Server.MapPath(this.skuImageFile), this.skuImageList); } string str16 = ""; str16 = this.chkSina.Checked ? "3" : ""; if (this.chkQQ.Checked) { str16 = str16 + (string.IsNullOrWhiteSpace(str16) ? "13" : ",13"); } UserBind bind = new UserBind(); string url = string.Concat(new object[] { "http://", Globals.DomainFullName, "/Product/Detail/", productId }); bind.SendWeiBo(-1, str16, productInfo.ProductName, url, productInfo.ImageUrl); base.Response.Redirect(string.Format("InStock.aspx?SaleStatus=-1", new object[0])); } else { MessageBox.Show(this, "保存失败! 请重试."); } } } } }
private void SaveProductInfo() { if (string.IsNullOrWhiteSpace(this.Hidden_SelectValue.Value)) { MessageBox.ShowFailTip(this, "请选择产品分类!"); } else { string text = this.txtProductName.Text; int num = Globals.SafeInt(this.hfCurrentProductType.Value, -1); int num2 = Globals.SafeInt(this.hfCurrentProductBrand.Value, -1); int? nullable = new int?(Globals.SafeInt(this.ajaxRegion.SelectedValue, -1)); string str2 = this.txtUnit.Text; decimal? nullable2 = new decimal?(Globals.SafeDecimal(this.txtMarketPrice.Text, (decimal) -1M)); int num3 = Globals.SafeInt(this.txtDisplaySequence.Text, -1); string str3 = this.txtShortDescription.Text; string str4 = this.txtDescription.Text; string str5 = this.hfProductImages.Value; string str6 = this.hfCurrentAttributes.Value; string str7 = this.hfCurrentBaseProductSKUs.Value; string str8 = this.hfCurrentProductSKUs.Value; bool flag = false; string[] strArray = new string[0]; if (!string.IsNullOrWhiteSpace(str3)) { str3 = Globals.HtmlEncodeForSpaceWrap(str3); } if (!string.IsNullOrWhiteSpace(str5)) { strArray = str5.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries); } if (string.IsNullOrWhiteSpace(str6)) { MessageBox.Show(this, "属性信息不存在,请检查已填数据是否正确!"); } else { List<Maticsoft.Model.Shop.Products.AttributeInfo> list = this.GetAttributeInfo4Json(JsonMapper.ToObject(str6)); if (string.IsNullOrWhiteSpace(str7)) { MessageBox.Show(this, "基础SKU信息不存在,请检查已填数据是否正确!"); } else { List<Maticsoft.Model.Shop.Products.SKUInfo> list2 = null; decimal? nullable3 = 0M; flag = !string.IsNullOrWhiteSpace(str8); if (flag) { list2 = this.GetSKUInfo4Json(JsonMapper.ToObject(str8)); if (this.salePriceList.Count > 0) { this.salePriceList.Sort(); nullable3 = new decimal?(Convert.ToDecimal(this.salePriceList[0])); } } else { list2 = this.GetSKUInfo4Json(JsonMapper.ToObject(str7)); nullable3 = new decimal?(Globals.SafeDecimal(this.txtSalePrice.Text, (decimal) -1M)); } Maticsoft.Model.Shop.Products.ProductInfo model = new Maticsoft.BLL.Shop.Products.ProductInfo().GetModel(this.ProductId); string[] strArray2 = this.Hidden_SelectValue.Value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); model.Product_Categories = strArray2; model.ProductName = text; model.CategoryId = 0; model.TypeId = new int?(num); model.BrandId = num2; model.RegionId = (nullable == -1) ? null : nullable; model.Unit = str2; model.MarketPrice = (nullable2 == -1M) ? null : nullable2; model.LowestSalePrice = nullable3.Value; model.DisplaySequence = num3; model.ProductCode = this.txtProductSKU.Text; model.SaleStatus = -1; model.ShortDescription = str3; model.Description = str4; model.Tags = ""; if (strArray.Length == 0) { model.ImageUrl = model.ThumbnailUrl1 = model.ThumbnailUrl2 = "/Content/themes/base/Shop/images/none.png"; } string newValue = string.Format("/Upload/Shop/Images/Product/{0}/", DateTime.Now.ToString("yyyyMMdd")); string str10 = "/Upload/Shop/Images/ProductThumbs/" + DateTime.Now.ToString("yyyyMMdd") + "/"; ArrayList list3 = new ArrayList(); for (int i = 0; i < strArray.Length; i++) { if (i == 0) { if (strArray[i].Contains(this.tempFile)) { string str11 = string.Format(strArray[i], ""); string str12 = strArray[i]; model.ImageUrl = str11.Replace(this.tempFile, newValue); model.ThumbnailUrl1 = str12.Replace(this.tempFile, str10); list3.Add(str11.Replace(this.tempFile, "")); list3.Add(str12.Replace(this.tempFile, "")); Maticsoft.BLL.Shop.Products.ProductImage.MoveImage(strArray[i], newValue, str10); } } else { string str13 = string.Format(strArray[i], ""); string str14 = strArray[i]; Maticsoft.Model.Shop.Products.ProductImage item = new Maticsoft.Model.Shop.Products.ProductImage { ImageUrl = str13.Replace(this.tempFile, newValue), ThumbnailUrl1 = str14.Replace(this.tempFile, str10) }; model.ProductImages.Add(item); list3.Add(str13.Replace(this.tempFile, "")); list3.Add(str14.Replace(this.tempFile, "")); Maticsoft.BLL.Shop.Products.ProductImage.MoveImage(strArray[i], newValue, str10); } } model.AttributeInfos = list; model.HasSKU = flag; model.SkuInfos = list2; if (ProductManage.ModifyProduct(model)) { try { int count = list3.Count; if (this.skuImageList.Count > 0) { FileManage.MoveFile(base.Server.MapPath(this.tempFile), base.Server.MapPath(this.skuImageFile), this.skuImageList); } } catch (Exception) { } base.Response.Redirect(string.Format("InStock.aspx?SaleStatus={0}", model.SaleStatus)); } else { MessageBox.Show(this, "保存失败! 请重试."); } } } } }
private void SaveProductInfo() { if (string.IsNullOrWhiteSpace(this.Hidden_SelectValue.Value)) { MessageBox.ShowFailTip(this, "请选择产品分类!"); } else { string text = this.txtProductName.Text; int num = Globals.SafeInt(this.hfCurrentProductType.Value, -1); int num2 = Globals.SafeInt(this.hfCurrentProductBrand.Value, -1); int num3 = Globals.SafeInt(this.drpSupplier.SelectedValue, -1); int? nullable = new int?(Globals.SafeInt(this.ajaxRegion.SelectedValue, -1)); string str2 = this.txtUnit.Text; decimal? nullable2 = new decimal?(Globals.SafeDecimal(this.txtMarketPrice.Text, (decimal) -1M)); int num4 = Globals.SafeInt(this.txtDisplaySequence.Text, -1); string str3 = this.txtShortDescription.Text; string str4 = this.txtDescription.Text; string str5 = this.txtUrlRule.Text; string str6 = this.txtMeta_Title.Text; string str7 = this.txtMeta_Description.Text; string str8 = this.txtMeta_Keywords.Text; string str9 = this.txtSeoImageAlt.Text; string str10 = this.txtSeoImageTitle.Text; string str11 = this.hfProductImages.Value; string str12 = this.hfCurrentAttributes.Value; string str13 = this.hfCurrentBaseProductSKUs.Value; string str14 = this.hfCurrentProductSKUs.Value; bool flag = false; string str15 = this.hfSelectedAccessories.Value; string str16 = this.HiddenField_RelatedProductInfo.Value; string[] strArray = new string[0]; if (!string.IsNullOrWhiteSpace(str3)) { str3 = Globals.HtmlEncodeForSpaceWrap(str3); } if (!string.IsNullOrWhiteSpace(str11)) { strArray = str11.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries); } if (string.IsNullOrWhiteSpace(str12)) { MessageBox.Show(this, "属性信息不存在,请检查已填数据是否正确!"); } else { List<Maticsoft.Model.Shop.Products.AttributeInfo> list = this.GetAttributeInfo4Json(JsonMapper.ToObject(str12)); if (string.IsNullOrWhiteSpace(str13)) { MessageBox.Show(this, "基础SKU信息不存在,请检查已填数据是否正确!"); } else { List<Maticsoft.Model.Shop.Products.SKUInfo> list2 = null; decimal? nullable3 = 0M; flag = !string.IsNullOrWhiteSpace(str14); if (flag) { list2 = this.GetSKUInfo4Json(JsonMapper.ToObject(str14)); if (this.salePriceList.Count > 0) { this.salePriceList.Sort(); nullable3 = new decimal?(Convert.ToDecimal(this.salePriceList[0])); } } else { list2 = this.GetSKUInfo4Json(JsonMapper.ToObject(str13)); nullable3 = new decimal?(Globals.SafeDecimal(this.txtSalePrice.Text, (decimal) -1M)); } Maticsoft.Model.Shop.Products.ProductInfo model = new Maticsoft.BLL.Shop.Products.ProductInfo().GetModel(this.ProductId); string[] strArray2 = this.Hidden_SelectValue.Value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); model.Product_Categories = strArray2; model.ProductName = text; model.CategoryId = 0; model.TypeId = new int?(num); model.BrandId = num2; if (num3 > 0) { model.SupplierId = num3; } else { model.SupplierId = -1; } model.RegionId = (nullable == -1) ? null : nullable; model.Unit = str2; model.MarketPrice = (nullable2 == -1M) ? null : nullable2; model.LowestSalePrice = nullable3.Value; model.DisplaySequence = num4; model.ProductCode = this.txtProductSKU.Text; model.AddedDate = DateTime.Now; model.SaleStatus = Globals.SafeInt(this.rblUpselling.SelectedValue, 0); model.ShortDescription = str3; model.Description = str4; model.SeoUrl = str5; model.Meta_Title = str6; model.Meta_Description = str7; model.Meta_Keywords = str8; model.SeoImageAlt = str9; model.SeoImageTitle = str10; model.Tags = ""; if (strArray.Length == 0) { model.ImageUrl = model.ThumbnailUrl1 = model.ThumbnailUrl2 = "/Content/themes/base/Shop/images/none.png"; } string newValue = string.Format("/Upload/Shop/Images/Product/{0}/", DateTime.Now.ToString("yyyyMMdd")); string str18 = "/Upload/Shop/Images/ProductThumbs/" + DateTime.Now.ToString("yyyyMMdd") + "/"; ArrayList list3 = new ArrayList(); for (int i = 0; i < strArray.Length; i++) { if (i == 0) { if (strArray[i].Contains(this.tempFile)) { string str19 = string.Format(strArray[i], ""); string str20 = strArray[i]; model.ImageUrl = str19.Replace(this.tempFile, newValue); model.ThumbnailUrl1 = str20.Replace(this.tempFile, str18); list3.Add(str19.Replace(this.tempFile, "")); list3.Add(str20.Replace(this.tempFile, "")); Maticsoft.BLL.Shop.Products.ProductImage.MoveImage(strArray[i], newValue, str18); } } else { string str21 = string.Format(strArray[i], ""); string str22 = strArray[i]; Maticsoft.Model.Shop.Products.ProductImage item = new Maticsoft.Model.Shop.Products.ProductImage { ImageUrl = str21.Replace(this.tempFile, newValue), ThumbnailUrl1 = str22.Replace(this.tempFile, str18) }; model.ProductImages.Add(item); list3.Add(str21.Replace(this.tempFile, "")); list3.Add(str22.Replace(this.tempFile, "")); Maticsoft.BLL.Shop.Products.ProductImage.MoveImage(strArray[i], newValue, str18); } } model.AttributeInfos = list; model.HasSKU = flag; model.SkuInfos = list2; string[] strArray3 = str15.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); List<Maticsoft.Model.Shop.Products.ProductAccessorie> list4 = new List<Maticsoft.Model.Shop.Products.ProductAccessorie>(); foreach (string str23 in strArray3) { Maticsoft.Model.Shop.Products.ProductAccessorie accessorie = new Maticsoft.Model.Shop.Products.ProductAccessorie { AccessoriesName = this.txtAccessorieName.Text, DiscountAmount = new decimal?(Globals.SafeDecimal(this.txtDiscountAmount.Text, (decimal) 0M)), DiscountType = new int?(this.rdoDiscountType4D.Checked ? 0 : 1), MaxQuantity = new int?(Globals.SafeInt(this.txtMaxQuantity.Text, 1)), MinQuantity = new int?(Globals.SafeInt(this.txtMinQuantity.Text, 1)), SkuId = str23 }; list4.Add(accessorie); } model.ProductAccessories = list4; string[] strArray4 = str16.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); model.RelatedProductId = strArray4; model.ProductId = this.ProductId; if (ProductManage.ModifyProduct(model)) { try { int count = list3.Count; if (this.skuImageList.Count > 0) { FileManage.MoveFile(base.Server.MapPath(this.tempFile), base.Server.MapPath(this.skuImageFile), this.skuImageList); } } catch (Exception) { } base.Response.Redirect(string.Format("ProductsInStock.aspx?SaleStatus={0}", model.SaleStatus)); } else { MessageBox.Show(this, "保存失败! 请重试."); } } } } }