Example #1
0
        private void btnDelete_Click(object sender, System.EventArgs e)
        {
            string text = base.Request.Form["CheckBoxGroup"];

            if (string.IsNullOrEmpty(text))
            {
                this.ShowMsg("请先选择要删除的商品", false);
                return;
            }
            System.Collections.Generic.List <int> list = new System.Collections.Generic.List <int>();
            string[] array = text.Split(new char[]
            {
                ','
            });
            for (int i = 0; i < array.Length; i++)
            {
                string value = array[i];
                list.Add(System.Convert.ToInt32(value));
            }
            SendMessageHelper.SendMessageToDistributors(text, 3);
            if (ProductHelper.CanclePenetrationProducts(text) >= 1)
            {
                int num = ProductHelper.RemoveProduct(text);
                if (num > 0)
                {
                    this.ShowMsg("成功删除了选择的商品", true);
                    this.BindProducts();
                    return;
                }
                this.ShowMsg("删除商品失败,未知错误", false);
            }
        }
Example #2
0
        private void btnUpdateLine_Click(object sender, System.EventArgs e)
        {
            int    num  = 0;
            string text = base.Request.Form["CheckBoxGroup"];

            if (string.IsNullOrEmpty(text))
            {
                this.ShowMsg("请先选择要转移的商品", false);
                return;
            }
            SendMessageHelper.SendMessageToDistributors(text + "|" + this.dropProductLines.SelectedItem.Text, 6);
            string[] array = text.Split(new char[]
            {
                ','
            });
            string[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                string s = array2[i];
                if (ProductLineHelper.UpdateProductLine(System.Convert.ToInt32(this.hdProductLine.Value), int.Parse(s)))
                {
                    num++;
                }
            }
            if (num > 0)
            {
                this.BindProducts();
                this.ShowMsg(string.Format("成功转移了{0}件商品", num), true);
                return;
            }
            this.ShowMsg("转移商品失败", false);
        }
Example #3
0
        private void btnInStock_Click(object sender, System.EventArgs e)
        {
            string text = base.Request.Form["CheckBoxGroup"];

            if (string.IsNullOrEmpty(text))
            {
                this.ShowMsg("请先选择要入库的商品", false);
                return;
            }
            if (this.hdPenetrationStatus.Value.Equals("1"))
            {
                SendMessageHelper.SendMessageToDistributors(text, 2);
                if (ProductHelper.CanclePenetrationProducts(text) == 0)
                {
                    this.ShowMsg("取消铺货失败!", false);
                    return;
                }
            }
            int num = ProductHelper.InStock(text);

            if (num > 0)
            {
                this.ShowMsg("成功入库选择的商品,您可以在仓库区的商品里面找到入库以后的商品", true);
                this.BindProducts();
                return;
            }
            this.ShowMsg("入库商品失败,未知错误", false);
        }
Example #4
0
        private void btnUpdateLine_Click(object sender, EventArgs e)
        {
            int    num = 0;
            string str = base.Request.Form["CheckBoxGroup"];

            if (string.IsNullOrEmpty(str))
            {
                this.ShowMsg("请先选择要转移的商品", false);
            }
            else
            {
                SendMessageHelper.SendMessageToDistributors(str + "|" + this.dropProductLines.SelectedItem.Text, 6);
                foreach (string str2 in str.Split(new char[] { ',' }))
                {
                    if (ProductLineHelper.UpdateProductLine(Convert.ToInt32(this.hdProductLine.Value), int.Parse(str2)))
                    {
                        num++;
                    }
                }
                if (num > 0)
                {
                    this.BindProducts();
                    this.ShowMsg(string.Format("成功转移了{0}件商品", num), true);
                }
                else
                {
                    this.ShowMsg("转移商品失败", false);
                }
            }
        }
Example #5
0
        private void btnUnSale_Click(object sender, EventArgs e)
        {
            string str = base.Request.Form["CheckBoxGroup"];

            if (string.IsNullOrEmpty(str))
            {
                this.ShowMsg("请先选择要下架的商品", false);
            }
            else
            {
                if (this.hdPenetrationStatus.Value.Equals("1"))
                {
                    SendMessageHelper.SendMessageToDistributors(str, 1);
                    if (ProductHelper.CanclePenetrationProducts(str) == 0)
                    {
                        this.ShowMsg("取消铺货失败!", false);
                        return;
                    }
                }
                if (ProductHelper.OffShelf(str) > 0)
                {
                    this.ShowMsg("成功下架了选择的商品,您可以在下架区的商品里面找到下架以后的商品", true);
                    this.BindProducts();
                }
                else
                {
                    this.ShowMsg("下架商品失败,未知错误", false);
                }
            }
        }
Example #6
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            string str = base.Request.Form["CheckBoxGroup"];

            if (string.IsNullOrEmpty(str))
            {
                this.ShowMsg("请先选择要删除的商品", false);
            }
            else
            {
                List <int> list = new List <int>();
                foreach (string str2 in str.Split(new char[] { ',' }))
                {
                    list.Add(Convert.ToInt32(str2));
                }
                SendMessageHelper.SendMessageToDistributors(str, 3);
                if (ProductHelper.RemoveProduct(str) > 0)
                {
                    this.ShowMsg("成功删除了选择的商品", true);
                    this.BindProducts();
                }
                else
                {
                    this.ShowMsg("删除商品失败,未知错误", false);
                }
                if (this.hdPenetrationStatus.Value.Equals("1"))
                {
                    ProductHelper.CanclePenetrationProducts(str);
                }
            }
        }
 protected void btnSaveCategory_Click(object sender, EventArgs e)
 {
     if (!this.dropProductLineFrom.SelectedValue.HasValue || !this.dropProductLineFromTo.SelectedValue.HasValue)
     {
         this.ShowMsg("请选择需要替换的产品线或需要替换至的产品线", false);
     }
     else if (this.dropProductLineFrom.SelectedValue.Value == this.dropProductLineFromTo.SelectedValue.Value)
     {
         this.ShowMsg("请选择不同的产品进行替换", false);
     }
     else
     {
         string text = this.dropProductLineFrom.SelectedItem.Text;
         string str2 = this.dropProductLineFromTo.SelectedItem.Text;
         string str3 = this.dropProductLineFrom.SelectedValue.ToString();
         SendMessageHelper.SendMessageToDistributors(str3 + "|" + text + "|" + str2, 4);
         if (!ProductLineHelper.ReplaceProductLine(Convert.ToInt32(str3), Convert.ToInt32(this.dropProductLineFromTo.SelectedValue)))
         {
             this.ShowMsg("产品线批量转移商品失败", false);
         }
         else
         {
             this.ShowMsg("产品线批量转移商品成功", true);
         }
     }
 }
Example #8
0
        protected void btnSaveCategory_Click(object sender, System.EventArgs e)
        {
            if (!this.dropProductLineFrom.SelectedValue.HasValue || !this.dropProductLineFromTo.SelectedValue.HasValue)
            {
                this.ShowMsg("请选择需要替换的产品线或需要替换至的产品线", false);
                return;
            }
            if (this.dropProductLineFrom.SelectedValue.Value == this.dropProductLineFromTo.SelectedValue.Value)
            {
                this.ShowMsg("请选择不同的产品进行替换", false);
                return;
            }
            string text  = this.dropProductLineFrom.SelectedItem.Text;
            string text2 = this.dropProductLineFromTo.SelectedItem.Text;
            string text3 = this.dropProductLineFrom.SelectedValue.ToString();

            SendMessageHelper.SendMessageToDistributors(string.Concat(new string[]
            {
                text3,
                "|",
                text,
                "|",
                text2
            }), 4);
            if (!ProductLineHelper.ReplaceProductLine(System.Convert.ToInt32(text3), System.Convert.ToInt32(this.dropProductLineFromTo.SelectedValue)))
            {
                this.ShowMsg("产品线批量转移商品失败", false);
                return;
            }
            this.ShowMsg("产品线批量转移商品成功", true);
        }
Example #9
0
        private void grdProducts_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e)
        {
            System.Collections.Generic.List <int> list = new System.Collections.Generic.List <int>();
            string text = this.grdProducts.DataKeys[e.RowIndex].Value.ToString();

            if (text != "")
            {
                list.Add(System.Convert.ToInt32(text));
            }
            SendMessageHelper.SendMessageToDistributors(text, 3);
            if (this.hdPenetrationStatus.Value.Equals("1"))
            {
                ProductHelper.CanclePenetrationProducts(text);
            }
            if (ProductHelper.RemoveProduct(text) > 0)
            {
                this.ShowMsg("删除商品成功", true);
                this.BindProducts();
            }
        }
Example #10
0
        private void btnCancle_Click(object sender, System.EventArgs e)
        {
            string text = base.Request.Form["CheckBoxGroup"];

            if (string.IsNullOrEmpty(text))
            {
                this.ShowMsg("请先选择要下架的商品", false);
                return;
            }
            SendMessageHelper.SendMessageToDistributors(text, 5);
            int num = ProductHelper.CanclePenetrationProducts(text);

            if (num > 0)
            {
                this.ShowMsg("取消铺货成功", true);
                this.BindProducts();
                return;
            }
            this.ShowMsg("取消铺货失败,未知错误", false);
        }
Example #11
0
        private void grdProducts_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            List <int> list = new List <int>();
            string     str  = this.grdProducts.DataKeys[e.RowIndex].Value.ToString();

            if (str != "")
            {
                list.Add(Convert.ToInt32(str));
            }
            SendMessageHelper.SendMessageToDistributors(str, 3);
            if (this.hdPenetrationStatus.Value.Equals("1"))
            {
                ProductHelper.CanclePenetrationProducts(str);
            }
            if (ProductHelper.RemoveProduct(str) > 0)
            {
                this.ShowMsg("删除商品成功", true);
                this.ReloadProductOnSales(false);
            }
        }
Example #12
0
        private void btnCancle_Click(object sender, EventArgs e)
        {
            string str = base.Request.Form["CheckBoxGroup"];

            if (string.IsNullOrEmpty(str))
            {
                this.ShowMsg("请先选择要下架的商品", false);
            }
            else
            {
                SendMessageHelper.SendMessageToDistributors(str, 5);
                if (ProductHelper.CanclePenetrationProducts(str) > 0)
                {
                    this.ShowMsg("取消铺货成功", true);
                    this.BindProducts();
                }
                else
                {
                    this.ShowMsg("取消铺货失败,未知错误", false);
                }
            }
        }
Example #13
0
        private void btnOK_Click(object sender, System.EventArgs e)
        {
            string text = base.Request.Form["CheckBoxGroup"];

            if (string.IsNullOrEmpty(text))
            {
                this.ShowMsg("请先选择要下架的商品", false);
                return;
            }
            if (this.hdPenetrationStatus.Value.Equals("1"))
            {
                System.Collections.Generic.List <int> list = new System.Collections.Generic.List <int>();
                string[] array = text.Split(new char[]
                {
                    ','
                });
                for (int i = 0; i < array.Length; i++)
                {
                    string value = array[i];
                    list.Add(System.Convert.ToInt32(value));
                }
                SendMessageHelper.SendMessageToDistributors(text, 1);
                if (ProductHelper.CanclePenetrationProducts(text) == 0)
                {
                    this.ShowMsg("取消铺货失败!", false);
                    return;
                }
            }
            int num = ProductHelper.OffShelf(text);

            if (num > 0)
            {
                this.ShowMsg("成功下架了选择的商品,您可以在下架区的商品里面找到下架以后的商品", true);
                this.BindProducts();
                return;
            }
            this.ShowMsg("下架商品失败,未知错误", false);
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            int     num;
            int     num2;
            int     num3;
            decimal num4;
            decimal num5;
            decimal num6;
            decimal?nullable;
            decimal?nullable2;
            decimal?nullable3;

            if (this.categoryId == 0)
            {
                this.categoryId = (int)this.ViewState["ProductCategoryId"];
            }
            if (this.ValidateConverts(this.chkSkuEnabled.Checked, out num, out num4, out num5, out num6, out nullable, out nullable2, out num2, out num3, out nullable3))
            {
                if (!this.chkSkuEnabled.Checked)
                {
                    if (num6 <= 0M)
                    {
                        this.ShowMsg("商品一口价必须大于0", false);
                        return;
                    }
                    if (nullable.HasValue && (nullable.Value >= num6))
                    {
                        this.ShowMsg("商品成本价必须小于商品一口价", false);
                        return;
                    }
                    if (num4 > num5)
                    {
                        this.ShowMsg("分销商采购价必须要小于等于其最低零售价", false);
                        return;
                    }
                }
                string text = this.fckDescription.Text;
                if (this.ckbIsDownPic.Checked)
                {
                    text = base.DownRemotePic(text);
                }
                ProductInfo info3 = new ProductInfo();
                info3.ProductId         = this.productId;
                info3.CategoryId        = this.categoryId;
                info3.TypeId            = this.dropProductTypes.SelectedValue;
                info3.ProductName       = this.txtProductName.Text;
                info3.ProductCode       = this.txtProductCode.Text;
                info3.DisplaySequence   = num;
                info3.LineId            = this.dropProductLines.SelectedValue.Value;
                info3.LowestSalePrice   = num5;
                info3.MarketPrice       = nullable2;
                info3.Unit              = this.txtUnit.Text;
                info3.ImageUrl1         = this.uploader1.UploadedImageUrl;
                info3.ImageUrl2         = this.uploader2.UploadedImageUrl;
                info3.ImageUrl3         = this.uploader3.UploadedImageUrl;
                info3.ImageUrl4         = this.uploader4.UploadedImageUrl;
                info3.ImageUrl5         = this.uploader5.UploadedImageUrl;
                info3.ThumbnailUrl40    = this.uploader1.ThumbnailUrl40;
                info3.ThumbnailUrl60    = this.uploader1.ThumbnailUrl60;
                info3.ThumbnailUrl100   = this.uploader1.ThumbnailUrl100;
                info3.ThumbnailUrl160   = this.uploader1.ThumbnailUrl160;
                info3.ThumbnailUrl180   = this.uploader1.ThumbnailUrl180;
                info3.ThumbnailUrl220   = this.uploader1.ThumbnailUrl220;
                info3.ThumbnailUrl310   = this.uploader1.ThumbnailUrl310;
                info3.ThumbnailUrl410   = this.uploader1.ThumbnailUrl410;
                info3.ShortDescription  = this.txtShortDescription.Text;
                info3.Description       = (!string.IsNullOrEmpty(text) && (text.Length > 0)) ? text : null;
                info3.PenetrationStatus = this.chkPenetration.Checked ? PenetrationStatus.Already : PenetrationStatus.Notyet;
                info3.Title             = this.txtTitle.Text;
                info3.MetaDescription   = this.txtMetaDescription.Text;
                info3.MetaKeywords      = this.txtMetaKeywords.Text;
                info3.AddedDate         = DateTime.Now;
                info3.BrandId           = this.dropBrandCategories.SelectedValue;
                ProductInfo       target = info3;
                ProductSaleStatus onSale = ProductSaleStatus.OnSale;
                if (this.radInStock.Checked)
                {
                    onSale = ProductSaleStatus.OnStock;
                }
                if (this.radUnSales.Checked)
                {
                    onSale = ProductSaleStatus.UnSale;
                }
                if (this.radOnSales.Checked)
                {
                    onSale = ProductSaleStatus.OnSale;
                }
                target.SaleStatus = onSale;
                CategoryInfo category = CatalogHelper.GetCategory(this.categoryId);
                if (category != null)
                {
                    target.MainCategoryPath = category.Path + "|";
                }
                Dictionary <string, SKUItem>   skus  = null;
                Dictionary <int, IList <int> > attrs = null;
                if (this.chkSkuEnabled.Checked)
                {
                    target.HasSKU = true;
                    skus          = base.GetSkus(this.txtSkus.Text);
                }
                else
                {
                    Dictionary <string, SKUItem> dictionary3 = new Dictionary <string, SKUItem>();
                    SKUItem item = new SKUItem();
                    item.SkuId         = "0";
                    item.SKU           = this.txtSku.Text;
                    item.SalePrice     = num6;
                    item.CostPrice     = nullable.HasValue ? nullable.Value : 0M;
                    item.PurchasePrice = num4;
                    item.Stock         = num2;
                    item.AlertStock    = num3;
                    item.Weight        = nullable3.HasValue ? nullable3.Value : 0M;
                    dictionary3.Add("0", item);
                    skus = dictionary3;
                    if (this.txtMemberPrices.Text.Length > 0)
                    {
                        base.GetMemberPrices(skus["0"], this.txtMemberPrices.Text);
                    }
                    if (this.txtDistributorPrices.Text.Length > 0)
                    {
                        base.GetDistributorPrices(skus["0"], this.txtDistributorPrices.Text);
                    }
                }
                if (!string.IsNullOrEmpty(this.txtAttributes.Text) && (this.txtAttributes.Text.Length > 0))
                {
                    attrs = base.GetAttributes(this.txtAttributes.Text);
                }
                ValidationResults validateResults = Hishop.Components.Validation.Validation.Validate <ProductInfo>(target);
                if (!validateResults.IsValid)
                {
                    this.ShowMsg(validateResults);
                }
                else
                {
                    if (this.ViewState["distributorUserIds"] == null)
                    {
                        this.ViewState["distributorUserIds"] = new List <int>();
                    }
                    int type = 0;
                    if (((target.LineId > 0) && (int.Parse(this.hdlineId.Value) > 0)) && (target.LineId != int.Parse(this.hdlineId.Value)))
                    {
                        type = 6;
                    }
                    if (!this.chkPenetration.Checked)
                    {
                        type = 5;
                    }
                    if (type == 5)
                    {
                        SendMessageHelper.SendMessageToDistributors(target.ProductId.ToString(), type);
                        ProductHelper.CanclePenetrationProducts(this.productId.ToString());
                    }
                    else if (type == 6)
                    {
                        this.toline = this.dropProductLines.SelectedItem.Text;
                        SendMessageHelper.SendMessageToDistributors(this.hdlineId.Value + "|" + this.toline, type);
                    }
                    IList <int> tagIds = new List <int>();
                    if (!string.IsNullOrEmpty(this.txtProductTag.Text.Trim()))
                    {
                        string   str2     = this.txtProductTag.Text.Trim();
                        string[] strArray = null;
                        if (str2.Contains(","))
                        {
                            strArray = str2.Split(new char[] { ',' });
                        }
                        else
                        {
                            strArray = new string[] { str2 };
                        }
                        foreach (string str3 in strArray)
                        {
                            tagIds.Add(Convert.ToInt32(str3));
                        }
                    }
                    switch (ProductHelper.UpdateProduct(target, skus, attrs, (IList <int>) this.ViewState["distributorUserIds"], tagIds))
                    {
                    case ProductActionStatus.Success:
                        this.litralProductTag.SelectedValue = tagIds;
                        this.ShowMsg("修改商品成功", true);
                        return;

                    case ProductActionStatus.AttributeError:
                        this.ShowMsg("修改商品失败,保存商品属性时出错", false);
                        return;

                    case ProductActionStatus.DuplicateName:
                        this.ShowMsg("修改商品失败,商品名称不能重复", false);
                        return;

                    case ProductActionStatus.DuplicateSKU:
                        this.ShowMsg("修改商品失败,商家编码不能重复", false);
                        return;

                    case ProductActionStatus.SKUError:
                        this.ShowMsg("修改商品失败,商家编码不能重复", false);
                        return;

                    case ProductActionStatus.OffShelfError:
                        this.ShowMsg("修改商品失败, 子站没在零售价范围内的商品无法下架", false);
                        return;

                    case ProductActionStatus.ProductTagEroor:
                        this.ShowMsg("修改商品失败,保存商品标签时出错", false);
                        return;
                    }
                    this.ShowMsg("修改商品失败,未知错误", false);
                }
            }
        }
		private void btnSave_Click(object sender, System.EventArgs e)
		{
			if (this.categoryId == 0)
			{
				this.categoryId = (int)this.ViewState["ProductCategoryId"];
			}
			int displaySequence;
			decimal num;
			decimal num2;
			decimal num3;
			decimal? num4;
			decimal? marketPrice;
			int stock;
			int alertStock;
			decimal? num5;
			if (!this.ValidateConverts(this.chkSkuEnabled.Checked, out displaySequence, out num, out num2, out num3, out num4, out marketPrice, out stock, out alertStock, out num5))
			{
				return;
			}
			decimal d = 0m;
			decimal.TryParse(this.txtCostPrice.Text, out d);
			if (d == 0m)
			{
				this.ShowMsg("供货价必填", false);
				return;
			}
			if (!this.chkSkuEnabled.Checked)
			{
				if (num3 <= 0m)
				{
					this.ShowMsg("商品一口价必须大于0", false);
					return;
				}
				if (num4.HasValue && num4.Value >= num3)
				{
					this.ShowMsg("商品成本价必须小于商品一口价", false);
					return;
				}
				if (!(num <= num2))
				{
					this.ShowMsg("分销商采购价必须要小于等于其最低零售价", false);
					return;
				}
			}
			string text = this.fckDescription.Text;
			if (this.ckbIsDownPic.Checked)
			{
				text = base.DownRemotePic(text);
			}
			ProductInfo productInfo = new ProductInfo
			{
				ProductId = this.productId,
				CategoryId = this.categoryId,
				TypeId = this.dropProductTypes.SelectedValue,
				ProductName = this.txtProductName.Text,
				ProductCode = this.txtProductCode.Text,
				DisplaySequence = displaySequence,
				LineId = this.dropProductLines.SelectedValue.Value,
				LowestSalePrice = num2,
				MarketPrice = marketPrice,
				Unit = this.txtUnit.Text,
				ImageUrl1 = this.uploader1.UploadedImageUrl,
				ImageUrl2 = this.uploader2.UploadedImageUrl,
				ImageUrl3 = this.uploader3.UploadedImageUrl,
				ImageUrl4 = this.uploader4.UploadedImageUrl,
				ImageUrl5 = this.uploader5.UploadedImageUrl,
				ThumbnailUrl40 = this.uploader1.ThumbnailUrl40,
				ThumbnailUrl60 = this.uploader1.ThumbnailUrl60,
				ThumbnailUrl100 = this.uploader1.ThumbnailUrl100,
				ThumbnailUrl160 = this.uploader1.ThumbnailUrl160,
				ThumbnailUrl180 = this.uploader1.ThumbnailUrl180,
				ThumbnailUrl220 = this.uploader1.ThumbnailUrl220,
				ThumbnailUrl310 = this.uploader1.ThumbnailUrl310,
				ThumbnailUrl410 = this.uploader1.ThumbnailUrl410,
				ShortDescription = this.txtShortDescription.Text,
				Description = (string.IsNullOrEmpty(text) || text.Length <= 0) ? null : text,
				PenetrationStatus = this.chkPenetration.Checked ? PenetrationStatus.Already : PenetrationStatus.Notyet,
				Title = this.txtTitle.Text,
				MetaDescription = this.txtMetaDescription.Text,
				MetaKeywords = this.txtMetaKeywords.Text,
				AddedDate = System.DateTime.Now,
				BrandId = this.dropBrandCategories.SelectedValue
			};
			ProductSaleStatus saleStatus = ProductSaleStatus.OnSale;
			if (this.radInStock.Checked)
			{
				saleStatus = ProductSaleStatus.OnStock;
			}
			if (this.radUnSales.Checked)
			{
				saleStatus = ProductSaleStatus.UnSale;
			}
			if (this.radOnSales.Checked)
			{
				saleStatus = ProductSaleStatus.OnSale;
			}
			productInfo.SaleStatus = saleStatus;
			CategoryInfo category = CatalogHelper.GetCategory(this.categoryId);
			if (category != null)
			{
				productInfo.MainCategoryPath = category.Path + "|";
			}
			System.Collections.Generic.Dictionary<int, System.Collections.Generic.IList<int>> attrs = null;
			System.Collections.Generic.Dictionary<string, SKUItem> dictionary;
			if (this.chkSkuEnabled.Checked)
			{
				productInfo.HasSKU = true;
				dictionary = base.GetSkus(this.txtSkus.Text);
			}
			else
			{
				dictionary = new System.Collections.Generic.Dictionary<string, SKUItem>
				{

					{
						"0",
						new SKUItem
						{
							SkuId = "0",
							SKU = this.txtSku.Text,
							SalePrice = num3,
							CostPrice = num4.HasValue ? num4.Value : 0m,
							PurchasePrice = num,
							Stock = stock,
							AlertStock = alertStock,
							Weight = num5.HasValue ? num5.Value : 0m
						}
					}
				};
				if (this.txtMemberPrices.Text.Length > 0)
				{
					base.GetMemberPrices(dictionary["0"], this.txtMemberPrices.Text);
				}
				if (this.txtDistributorPrices.Text.Length > 0)
				{
					base.GetDistributorPrices(dictionary["0"], this.txtDistributorPrices.Text);
				}
			}
			if (!string.IsNullOrEmpty(this.txtAttributes.Text) && this.txtAttributes.Text.Length > 0)
			{
				attrs = base.GetAttributes(this.txtAttributes.Text);
			}
			ValidationResults validationResults = Validation.Validate<ProductInfo>(productInfo);
			if (!validationResults.IsValid)
			{
				this.ShowMsg(validationResults);
				return;
			}
			if (this.ViewState["distributorUserIds"] == null)
			{
				this.ViewState["distributorUserIds"] = new System.Collections.Generic.List<int>();
			}
			int num6 = 0;
			if (productInfo.LineId > 0 && int.Parse(this.hdlineId.Value) > 0 && productInfo.LineId != int.Parse(this.hdlineId.Value))
			{
				num6 = 6;
			}
			if (!this.chkPenetration.Checked)
			{
				num6 = 5;
			}
			if (num6 == 5)
			{
				SendMessageHelper.SendMessageToDistributors(productInfo.ProductId.ToString(), num6);
			}
			else
			{
				if (num6 == 6)
				{
					this.toline = this.dropProductLines.SelectedItem.Text;
					SendMessageHelper.SendMessageToDistributors(this.hdlineId.Value + "|" + this.toline, num6);
				}
			}
			System.Collections.Generic.IList<int> list = new System.Collections.Generic.List<int>();
			if (!string.IsNullOrEmpty(this.txtProductTag.Text.Trim()))
			{
				string text2 = this.txtProductTag.Text.Trim();
				string[] array;
				if (text2.Contains(","))
				{
					array = text2.Split(new char[]
					{
						','
					});
				}
				else
				{
					array = new string[]
					{
						text2
					};
				}
				string[] array2 = array;
				for (int i = 0; i < array2.Length; i++)
				{
					string value = array2[i];
					list.Add(System.Convert.ToInt32(value));
				}
			}
			ProductActionStatus productActionStatus = ProductHelper.UpdateProduct(productInfo, dictionary, attrs, (System.Collections.Generic.IList<int>)this.ViewState["distributorUserIds"], list);
			if (productActionStatus == ProductActionStatus.Success)
			{
				this.litralProductTag.SelectedValue = list;
				this.ShowMsg("修改商品成功", true);
				return;
			}
			if (productActionStatus == ProductActionStatus.AttributeError)
			{
				this.ShowMsg("修改商品失败,保存商品属性时出错", false);
				return;
			}
			if (productActionStatus == ProductActionStatus.DuplicateName)
			{
				this.ShowMsg("修改商品失败,商品名称不能重复", false);
				return;
			}
			if (productActionStatus == ProductActionStatus.DuplicateSKU)
			{
				this.ShowMsg("修改商品失败,商家编码不能重复", false);
				return;
			}
			if (productActionStatus == ProductActionStatus.SKUError)
			{
				this.ShowMsg("修改商品失败,商家编码不能重复", false);
				return;
			}
			if (productActionStatus == ProductActionStatus.OffShelfError)
			{
				this.ShowMsg("修改商品失败, 子站没在零售价范围内的商品无法下架", false);
				return;
			}
			if (productActionStatus == ProductActionStatus.ProductTagEroor)
			{
				this.ShowMsg("修改商品失败,保存商品标签时出错", false);
				return;
			}
			this.ShowMsg("修改商品失败,未知错误", false);
		}