Ejemplo n.º 1
0
 private void btnTargetOK_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(this.productIds))
     {
         this.ShowMsg("没有要修改的商品", false);
     }
     else if (!this.ddlUnderlingPrice.SelectedValue.HasValue)
     {
         this.ShowMsg("请选择要修改的价格", false);
     }
     else
     {
         decimal result = 0M;
         if (!decimal.TryParse(this.txtTargetPrice.Text.Trim(), out result))
         {
             this.ShowMsg("请输入正确的价格", false);
         }
         else if (result <= 0M)
         {
             this.ShowMsg("直接调价必须输入正数", false);
         }
         else if (result > 10000000M)
         {
             this.ShowMsg("直接调价超出了系统表示范围", false);
         }
         else if (SubSiteProducthelper.UpdateSkuUnderlingPrices(this.productIds, this.ddlUnderlingPrice.SelectedValue.Value, result))
         {
             this.ShowMsg("修改商品的价格成功", true);
         }
     }
 }
Ejemplo n.º 2
0
        private void btnTargetOK_Click(object sender, System.EventArgs e)
        {
            if (string.IsNullOrEmpty(this.productIds))
            {
                this.ShowMsg("没有要修改的商品", false);
                return;
            }
            if (!this.ddlUnderlingPrice.SelectedValue.HasValue)
            {
                this.ShowMsg("请选择要修改的价格", false);
                return;
            }
            decimal num = 0m;

            if (!decimal.TryParse(this.txtTargetPrice.Text.Trim(), out num))
            {
                this.ShowMsg("请输入正确的价格", false);
                return;
            }
            if (num <= 0m)
            {
                this.ShowMsg("直接调价必须输入正数", false);
                return;
            }
            if (num > 10000000m)
            {
                this.ShowMsg("直接调价超出了系统表示范围", false);
                return;
            }
            if (SubSiteProducthelper.UpdateSkuUnderlingPrices(this.productIds, this.ddlUnderlingPrice.SelectedValue.Value, num))
            {
                this.ShowMsg("修改商品的价格成功", true);
            }
        }
Ejemplo n.º 3
0
        private void btnSavePrice_Click(object sender, EventArgs e)
        {
            string  skuIds    = string.Empty;
            DataSet skuPrices = this.GetSkuPrices(out skuIds);

            if (string.IsNullOrEmpty(skuIds))
            {
                this.ShowMsg("没有任何要修改的项", false);
            }
            else if (SubSiteProducthelper.UpdateSkuUnderlingPrices(skuPrices, skuIds))
            {
                this.ShowMsg("修改商品的价格成功", true);
            }
        }
Ejemplo n.º 4
0
        private void btnSavePrice_Click(object sender, System.EventArgs e)
        {
            string empty = string.Empty;

            System.Data.DataSet skuPrices = this.GetSkuPrices(out empty);
            if (string.IsNullOrEmpty(empty))
            {
                this.ShowMsg("没有任何要修改的项", false);
                return;
            }
            if (SubSiteProducthelper.UpdateSkuUnderlingPrices(skuPrices, empty))
            {
                this.ShowMsg("修改商品的价格成功", true);
            }
        }
Ejemplo n.º 5
0
        private void btnOperationOK_Click(object sender, System.EventArgs e)
        {
            if (string.IsNullOrEmpty(this.productIds))
            {
                this.ShowMsg("没有要修改的商品", false);
                return;
            }
            if (!this.ddlUnderlingPrice.SelectedValue.HasValue)
            {
                this.ShowMsg("请选择要修改的价格", false);
                return;
            }
            if (!this.ddlUnderlingPrice2.SelectedValue.HasValue)
            {
                this.ShowMsg("请选择要修改的价格", false);
                return;
            }
            decimal num = 0m;

            if (!decimal.TryParse(this.txtOperationPrice.Text.Trim(), out num))
            {
                this.ShowMsg("请输入正确的价格", false);
                return;
            }
            if (this.ddlOperation.SelectedValue == "*" && num <= 0m)
            {
                this.ShowMsg("必须乘以一个正数", false);
                return;
            }
            if (this.ddlOperation.SelectedValue == "+" && num < 0m)
            {
                decimal checkPrice = -num;
                if (SubSiteProducthelper.CheckPrice(this.productIds, this.ddlSalePrice.SelectedValue, checkPrice))
                {
                    this.ShowMsg("加了一个太小的负数,导致价格中有负数的情况", false);
                    return;
                }
            }
            if (SubSiteProducthelper.CheckPrice(this.productIds, this.ddlSalePrice.SelectedValue, num, this.ddlOperation.SelectedValue))
            {
                this.ShowMsg("公式调价的计算结果导致价格超出了系统表示范围", false);
                return;
            }
            if (SubSiteProducthelper.UpdateSkuUnderlingPrices(this.productIds, this.ddlUnderlingPrice2.SelectedValue.Value, this.ddlSalePrice.SelectedValue, this.ddlOperation.SelectedValue, num))
            {
                this.ShowMsg("修改商品的价格成功", true);
            }
        }
Ejemplo n.º 6
0
 private void btnOperationOK_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(productIds))
     {
         ShowMsg("没有要修改的商品", false);
     }
     else if (!ddlUnderlingPrice.SelectedValue.HasValue)
     {
         ShowMsg("请选择要修改的价格", false);
     }
     else if (!ddlUnderlingPrice2.SelectedValue.HasValue)
     {
         ShowMsg("请选择要修改的价格", false);
     }
     else
     {
         decimal result = 0M;
         if (!decimal.TryParse(txtOperationPrice.Text.Trim(), out result))
         {
             ShowMsg("请输入正确的价格", false);
         }
         else if ((ddlOperation.SelectedValue == "*") && (result <= 0M))
         {
             ShowMsg("必须乘以一个正数", false);
         }
         else
         {
             if ((ddlOperation.SelectedValue == "+") && (result < 0M))
             {
                 decimal checkPrice = -result;
                 if (SubSiteProducthelper.CheckPrice(productIds, ddlSalePrice.SelectedValue, checkPrice))
                 {
                     ShowMsg("加了一个太小的负数,导致价格中有负数的情况", false);
                     return;
                 }
             }
             if (SubSiteProducthelper.UpdateSkuUnderlingPrices(productIds, ddlUnderlingPrice2.SelectedValue.Value, ddlSalePrice.SelectedValue, ddlOperation.SelectedValue, result))
             {
                 ShowMsg("修改商品的价格成功", true);
             }
         }
     }
 }