コード例 #1
0
        private void btnOperationOK_Click(object sender, System.EventArgs e)
        {
            if (string.IsNullOrEmpty(this.productIds))
            {
                this.ShowMsgToTarget("没有要修改的商品", false, "parent");
                return;
            }
            if (!this.ddlMemberPrice2.SelectedValue.HasValue)
            {
                this.ShowMsgToTarget("请选择要修改的价格", false, "parent");
                return;
            }
            if ((this.ddlMemberPrice2.SelectedValue.Value == -2 || this.ddlMemberPrice2.SelectedValue.Value == -3) && this.ddlSalePrice.SelectedValue.Value != -2 && this.ddlSalePrice.SelectedValue.Value != -3)
            {
                this.ShowMsgToTarget("一口价或成本价不能用会员等级价作为标准来按公式计算", false, "parent");
                return;
            }
            decimal num = 0m;

            if (!decimal.TryParse(this.txtOperationPrice.Text.Trim(), out num))
            {
                this.ShowMsgToTarget("请输入正确的价格", false, "parent");
                return;
            }
            if (this.ddlOperation.SelectedValue == "*" && num <= 0m)
            {
                this.ShowMsgToTarget("必须乘以一个正数", false, "parent");
                return;
            }
            if (this.ddlOperation.SelectedValue == "+" && num < 0m)
            {
                decimal checkPrice = -num;
                if (ProductHelper.CheckPrice(this.productIds, this.ddlSalePrice.SelectedValue.Value, checkPrice, true))
                {
                    this.ShowMsgToTarget("加了一个太小的负数,导致价格中有负数的情况", false, "parent");
                    return;
                }
            }
            if (!this.ddlMemberPrice2.SelectedValue.HasValue || (this.ddlMemberPrice2.SelectedValue.HasValue && this.ddlMemberPrice2.SelectedValue.Value <= 0))
            {
                this.ShowMsgToTarget("请先选择目标价格!", false, "parent");
                return;
            }
            if (this.ddlSalePrice.SelectedValue.HasValue && this.ddlSalePrice.SelectedValue.Value > 0 && !ProductHelper.GetSKUMemberPrice(this.productIds, this.ddlSalePrice.SelectedValue.Value))
            {
                this.ShowMsgToTarget("请先设置" + this.ddlSalePrice.SelectedItem.Text, false, "parent");
                return;
            }
            if (ProductHelper.UpdateSkuMemberPrices(this.productIds, this.ddlMemberPrice2.SelectedValue.Value, this.ddlSalePrice.SelectedValue.Value, this.ddlOperation.SelectedValue, num))
            {
                this.ShowMsgToTarget("修改商品的价格成功", true, "parent");
            }
        }
コード例 #2
0
 private void btnOperationOK_Click(object sender, System.EventArgs e)
 {
     if (string.IsNullOrEmpty(this.productIds))
     {
         this.ShowMsg("没有要修改的商品", false);
     }
     else
     {
         if (!this.ddlMemberPrice2.SelectedValue.HasValue)
         {
             this.ShowMsg("请选择要修改的价格", false);
         }
         else
         {
             if ((this.ddlMemberPrice2.SelectedValue.Value == -2 || this.ddlMemberPrice2.SelectedValue.Value == -3) && this.ddlSalePrice.SelectedValue.Value != -2 && this.ddlSalePrice.SelectedValue.Value != -3)
             {
                 this.ShowMsg("一口价或成本价不能用会员等级价作为标准来按公式计算", false);
             }
             else
             {
                 decimal result = 0m;
                 if (!decimal.TryParse(this.txtOperationPrice.Text.Trim(), out result))
                 {
                     this.ShowMsg("请输入正确的价格", false);
                 }
                 else
                 {
                     if (this.ddlOperation.SelectedValue == "*" && result <= 0m)
                     {
                         this.ShowMsg("必须乘以一个正数", false);
                     }
                     else
                     {
                         if (this.ddlOperation.SelectedValue == "+" && result < 0m)
                         {
                             decimal checkPrice = -result;
                             if (ProductHelper.CheckPrice(this.productIds, this.ddlSalePrice.SelectedValue.Value, checkPrice, true))
                             {
                                 this.ShowMsg("加了一个太小的负数,导致价格中有负数的情况", false);
                                 return;
                             }
                         }
                         if (ProductHelper.UpdateSkuMemberPrices(this.productIds, this.ddlMemberPrice2.SelectedValue.Value, this.ddlSalePrice.SelectedValue.Value, this.ddlOperation.SelectedValue, result))
                         {
                             this.ShowMsg("修改商品的价格成功", true);
                         }
                     }
                 }
             }
         }
     }
 }
コード例 #3
0
 private void btnOperationOK_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(this.productIds))
     {
         this.ShowMsgToTarget("没有要修改的商品", false, "parent");
     }
     else if (!this.ddlMemberPrice2.SelectedValue.HasValue)
     {
         this.ShowMsgToTarget("请选择要修改的价格", false, "parent");
     }
     else if (((this.ddlMemberPrice2.SelectedValue.Value == -2) || (this.ddlMemberPrice2.SelectedValue.Value == -3)) && ((this.ddlSalePrice.SelectedValue.Value != -2) && (this.ddlSalePrice.SelectedValue.Value != -3)))
     {
         this.ShowMsgToTarget("一口价或成本价不能用会员等级价作为标准来按公式计算", false, "parent");
     }
     else
     {
         decimal result = 0M;
         if (!decimal.TryParse(this.txtOperationPrice.Text.Trim(), out result))
         {
             this.ShowMsgToTarget("请输入正确的价格", false, "parent");
         }
         else if ((this.ddlOperation.SelectedValue == "*") && (result <= 0M))
         {
             this.ShowMsgToTarget("必须乘以一个正数", false, "parent");
         }
         else
         {
             if ((this.ddlOperation.SelectedValue == "+") && (result < 0M))
             {
                 decimal checkPrice = -result;
                 if (ProductHelper.CheckPrice(this.productIds, this.ddlSalePrice.SelectedValue.Value, checkPrice, true))
                 {
                     this.ShowMsgToTarget("加了一个太小的负数,导致价格中有负数的情况", false, "parent");
                     return;
                 }
             }
             if ((this.ddlMemberPrice2.SelectedValue.HasValue && (this.ddlMemberPrice2.SelectedValue.Value > 0)) && !ProductHelper.GetSKUMemberPrice(this.productIds, this.ddlMemberPrice2.SelectedValue.Value))
             {
                 this.ShowMsgToTarget("请先设置" + this.ddlMemberPrice2.SelectedItem.Text, false, "parent");
             }
             else if (ProductHelper.UpdateSkuMemberPrices(this.productIds, this.ddlMemberPrice2.SelectedValue.Value, this.ddlSalePrice.SelectedValue.Value, this.ddlOperation.SelectedValue, result))
             {
                 this.ShowMsgToTarget("修改商品的价格成功", true, "parent");
             }
         }
     }
 }
コード例 #4
0
 private void btnOperationOK_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(productIds))
     {
         ShowMsg("没有要修改的商品", false);
     }
     else if (!ddlMemberPrice.SelectedValue.HasValue)
     {
         ShowMsg("请选择要修改的价格", false);
     }
     else if (!ddlMemberPrice2.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 (ProductHelper.CheckPrice(productIds, ddlSalePrice.SelectedValue, checkPrice))
                 {
                     ShowMsg("加了一个太小的负数,导致价格中有负数的情况", false);
                     return;
                 }
             }
             if (ProductHelper.UpdateSkuMemberPrices(productIds, ddlMemberPrice2.SelectedValue.Value, ddlSalePrice.SelectedValue, ddlOperation.SelectedValue, result))
             {
                 ShowMsg("修改商品的价格成功", true);
             }
         }
     }
 }
コード例 #5
0
        private void btnOperationOK_Click(object sender, System.EventArgs e)
        {
            if (string.IsNullOrEmpty(this.productIds))
            {
                this.ShowMsg("没有要修改的商品", false);
                return;
            }
            if (!this.ddlDistributorPrice2.SelectedValue.HasValue)
            {
                this.ShowMsg("请选择要修改的价格", false);
                return;
            }
            if ((this.ddlDistributorPrice2.SelectedValue.Value == -2 || this.ddlDistributorPrice2.SelectedValue.Value == -4) && this.ddlPurchasePrice.SelectedValue.Value != -2 && this.ddlPurchasePrice.SelectedValue.Value != -4)
            {
                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 (ProductHelper.CheckPrice(this.productIds, this.ddlPurchasePrice.SelectedValue.Value, checkPrice, false))
                {
                    this.ShowMsg("加了一个太小的负数,导致价格中有负数的情况", false);
                    return;
                }
            }
            if (ProductHelper.UpdateSkuDistributorPrices(this.productIds, this.ddlDistributorPrice2.SelectedValue.Value, this.ddlPurchasePrice.SelectedValue.Value, this.ddlOperation.SelectedValue, num))
            {
                this.ShowMsg("修改商品的价格成功", true);
            }
        }
コード例 #6
0
 private void btnOperationOK_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(this.productIds))
     {
         this.ShowMsg("没有要修改的商品", false);
     }
     else if (!this.ddlDistributorPrice2.SelectedValue.HasValue)
     {
         this.ShowMsg("请选择要修改的价格", false);
     }
     else if (((this.ddlDistributorPrice2.SelectedValue.Value == -2) || (this.ddlDistributorPrice2.SelectedValue.Value == -4)) && ((this.ddlPurchasePrice.SelectedValue.Value != -2) && (this.ddlPurchasePrice.SelectedValue.Value != -4)))
     {
         this.ShowMsg("采购价或成本价不能用分销等级价作为标准来按公式计算", false);
     }
     else
     {
         decimal result = 0M;
         if (!decimal.TryParse(this.txtOperationPrice.Text.Trim(), out result))
         {
             this.ShowMsg("请输入正确的价格", false);
         }
         else if ((this.ddlOperation.SelectedValue == "*") && (result <= 0M))
         {
             this.ShowMsg("必须乘以一个正数", false);
         }
         else
         {
             if ((this.ddlOperation.SelectedValue == "+") && (result < 0M))
             {
                 decimal checkPrice = -result;
                 if (ProductHelper.CheckPrice(this.productIds, this.ddlPurchasePrice.SelectedValue.Value, checkPrice, false))
                 {
                     this.ShowMsg("加了一个太小的负数,导致价格中有负数的情况", false);
                     return;
                 }
             }
             if (ProductHelper.UpdateSkuDistributorPrices(this.productIds, this.ddlDistributorPrice2.SelectedValue.Value, this.ddlPurchasePrice.SelectedValue.Value, this.ddlOperation.SelectedValue, result))
             {
                 this.ShowMsg("修改商品的价格成功", true);
             }
         }
     }
 }