示例#1
0
        private void btnNext_Click(object sender, System.EventArgs e)
        {
            PromotionInfo promotion = this.promotionView.Promotion;

            promotion.ActivityId = this.activityId;
            if (PromoteHelper.GetActivityProductAmount(promotion.ActivityId) > 0)
            {
                this.ShowMsg("已经添加促销商品的活动不可以修改,请先删除促销商品", false);
                return;
            }
            if (promotion.MemberGradeIds.Count <= 0)
            {
                this.ShowMsg("必须选择一个适合的客户", false);
                return;
            }
            if (promotion.StartDate.CompareTo(promotion.EndDate) > 0)
            {
                this.ShowMsg("开始日期应该小于结束日期", false);
                return;
            }
            promotion.PromoteType = (PromoteType)int.Parse(this.txtPromoteType.Text);
            if (promotion.PromoteType == PromoteType.QuantityDiscount)
            {
                this.radPromoteType.IsWholesale = true;
            }
            decimal condition     = 0m;
            decimal discountValue = 0m;

            decimal.TryParse(this.txtCondition.Text.Trim(), out condition);
            decimal.TryParse(this.txtDiscountValue.Text.Trim(), out discountValue);
            promotion.Condition     = condition;
            promotion.DiscountValue = discountValue;
            //promotion.SupplierId = HiContext.Current.User.UserId;
            int num = PromoteHelper.EditPromotion(promotion);

            if (num == -1)
            {
                this.ShowMsg("编辑促销活动失败,可能是信填写有误,请重试", false);
                return;
            }
            if (num == -2)
            {
                this.ShowMsg("编辑促销活动失败,可能是选择的会员等级已经被删除,请重试", false);
                return;
            }
            if (num == 0)
            {
                this.ShowMsg("编辑促销活动失败,请重试", false);
                return;
            }
            this.ShowMsg("编辑促销活动成功", true);
        }
示例#2
0
        private void btnSave_Click(object sender, System.EventArgs e)
        {
            PromotionInfo promotion = this.promotionView.Promotion;

            promotion.ActivityId = this.activityId;
            if (promotion.MemberGradeIds.Count <= 0)
            {
                this.ShowMsg("必须选择一个适合的客户", false);
                return;
            }
            if (promotion.StartDate.CompareTo(promotion.EndDate) > 0)
            {
                this.ShowMsg("开始日期应该小于结束日期", false);
                return;
            }
            promotion.PromoteType = (PromoteType)int.Parse(this.txtPromoteType.Text);
            if (promotion.PromoteType == PromoteType.FullQuantityDiscount || promotion.PromoteType == PromoteType.FullQuantityReduced)
            {
                this.radPromoteType.IsWholesale = true;
            }
            decimal condition     = 0m;
            decimal discountValue = 0m;

            decimal.TryParse(this.txtCondition.Text.Trim(), out condition);
            decimal.TryParse(this.txtDiscountValue.Text.Trim(), out discountValue);
            promotion.Condition     = condition;
            promotion.DiscountValue = discountValue;
            int num = PromoteHelper.EditPromotion(promotion);

            if (num == -1)
            {
                this.ShowMsg("编辑促销活动失败,可能是信填写有误,请重试", false);
                return;
            }
            if (num == -2)
            {
                this.ShowMsg("编辑促销活动失败,可能是选择的会员等级已经被删除,请重试", false);
                return;
            }
            if (num == 0)
            {
                this.ShowMsg("编辑促销活动失败,请重试", false);
                return;
            }
            this.ShowMsg("编辑促销活动成功", true);
        }
        private void btnNext_Click(object sender, EventArgs e)
        {
            PromotionInfo promotion = this.promotionView.Promotion;

            promotion.ActivityId = this.activityId;
            if (promotion.MemberGradeIds.Count <= 0)
            {
                this.ShowMsg("必须选择一个适合的客户", false);
            }
            else if (promotion.StartDate.CompareTo(promotion.EndDate) > 0)
            {
                this.ShowMsg("开始日期应该小于结束日期", false);
            }
            else
            {
                promotion.PromoteType = (PromoteType)int.Parse(this.txtPromoteType.Text);
                if (promotion.PromoteType == PromoteType.QuantityDiscount)
                {
                    this.radPromoteType.IsWholesale = true;
                }
                decimal result = 0M;
                decimal num2   = 0M;
                decimal.TryParse(this.txtCondition.Text.Trim(), out result);
                decimal.TryParse(this.txtDiscountValue.Text.Trim(), out num2);
                promotion.Condition     = result;
                promotion.DiscountValue = num2;
                switch (PromoteHelper.EditPromotion(promotion))
                {
                case -1:
                    this.ShowMsg("编辑促销活动失败,可能是信填写有误,请重试", false);
                    return;

                case -2:
                    this.ShowMsg("编辑促销活动失败,可能是选择的会员等级已经被删除,请重试", false);
                    return;

                case 0:
                    this.ShowMsg("编辑促销活动失败,请重试", false);
                    return;
                }
                this.ShowMsg("编辑促销活动成功", true);
            }
        }
示例#4
0
        private void btnNext_Click(object sender, EventArgs e)
        {
            PromotionInfo promotion = this.promotionView.Promotion;

            promotion.ActivityId  = this.activityId;
            promotion.PromoteType = (PromoteType)int.Parse(this.txtPromoteType.Text);
            if (promotion.PromoteType == PromoteType.MobileExclusive)
            {
                this.radPromoteType.IsMobileExclusive = true;
            }
            else if (promotion.MemberGradeIds.Count <= 0)
            {
                this.ShowMsg("必须选择一个适合的客户", false);
                return;
            }
            if (promotion.StartDate.CompareTo(promotion.EndDate) > 0)
            {
                this.ShowMsg("开始日期应该小于结束日期", false);
            }
            else
            {
                if (promotion.PromoteType == PromoteType.QuantityDiscount)
                {
                    this.radPromoteType.IsWholesale = true;
                }
                decimal num           = default(decimal);
                decimal discountValue = default(decimal);
                decimal.TryParse(this.txtCondition.Text.Trim(), out num);
                decimal.TryParse(this.txtDiscountValue.Text.Trim(), out discountValue);
                promotion.Condition     = num;
                promotion.DiscountValue = discountValue;
                promotion.GiftIds       = this.hidSelectGiftId.Value;
                promotion.StoreIds      = "";
                if (promotion.PromoteType == PromoteType.QuantityDiscount && num < decimal.One)
                {
                    this.ShowMsg("单品批发的数量必须大于1", false);
                }
                else
                {
                    switch (PromoteHelper.EditPromotion(promotion, promotion.PromoteType == PromoteType.MobileExclusive))
                    {
                    case -1:
                        this.ShowMsg("编辑促销活动失败,可能是信填写有误,请重试", false);
                        break;

                    case -2:
                        this.ShowMsg("编辑促销活动失败,可能是选择的会员等级已经被删除,请重试", false);
                        break;

                    case 0:
                        this.ShowMsg("编辑促销活动失败,请重试", false);
                        break;

                    default:
                        this.BindPromotionGifts(promotion);
                        this.ShowMsg("编辑促销活动成功", true);
                        break;
                    }
                }
            }
        }
示例#5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            PromotionInfo promotion = this.promotionView.Promotion;

            promotion.ActivityId = this.activityId;
            if (promotion.MemberGradeIds.Count <= 0)
            {
                this.ShowMsg("必须选择一个适合的客户", false);
            }
            else if (promotion.StartDate.CompareTo(promotion.EndDate) > 0)
            {
                this.ShowMsg("开始日期应该小于结束日期", false);
            }
            else
            {
                promotion.PromoteType = (PromoteType)int.Parse(this.txtPromoteType.Text);
                if (promotion.PromoteType == PromoteType.FullQuantityDiscount || promotion.PromoteType == PromoteType.FullQuantityReduced)
                {
                    this.radPromoteType.IsWholesale = true;
                }
                decimal condition     = default(decimal);
                decimal discountValue = default(decimal);
                decimal.TryParse(this.txtCondition.Text.Trim(), out condition);
                decimal.TryParse(this.txtDiscountValue.Text.Trim(), out discountValue);
                promotion.Condition     = condition;
                promotion.DiscountValue = discountValue;
                promotion.GiftIds       = this.hidSelectGiftId.Value;
                if (SettingsManager.GetMasterSettings().OpenMultStore&& string.IsNullOrEmpty(base.Request.QueryString["isWholesale"]))
                {
                    if (string.IsNullOrEmpty(this.hidStoreIds.Value))
                    {
                        this.ShowMsg("请选择门店范围", false);
                        return;
                    }
                    promotion.StoreType = 2;
                    promotion.StoreIds  = this.hidStoreIds.Value;
                }
                else
                {
                    promotion.StoreIds  = "";
                    promotion.StoreType = 0;
                }
                switch (PromoteHelper.EditPromotion(promotion, false))
                {
                case -1:
                    this.ShowMsg("编辑促销活动失败,可能是信填写有误,请重试", false);
                    break;

                case -2:
                    this.ShowMsg("编辑促销活动失败,可能是选择的会员等级已经被删除,请重试", false);
                    break;

                case 0:
                    this.ShowMsg("编辑促销活动失败,请重试", false);
                    break;

                default:
                    this.BindPromotionGifts(promotion);
                    this.ShowMsg("编辑促销活动成功", true, "EditOrderPromotion?activityId=" + this.activityId);
                    break;
                }
            }
        }