Exemplo n.º 1
0
        protected void btnEditUser_Click(object sender, System.EventArgs e)
        {
            decimal num = 0.0m;
            decimal firstCommissionRise  = 0.0m;
            decimal secondCommissionRise = 0.0m;
            decimal thirdCommissionRise  = 0.0m;
            DistributorGradeInfo distributorGradeInfo = new DistributorGradeInfo();

            if (this.GradeId > 0)
            {
                distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(this.GradeId);
            }
            distributorGradeInfo.Name = this.txtName.Text.Trim();
            decimal.TryParse(this.txtCommissionsLimit.Text.Trim(), out num);
            decimal.TryParse(this.txtFirstCommissionRise.Text.Trim(), out firstCommissionRise);
            decimal.TryParse(this.txtSecondCommissionRise.Text.Trim(), out secondCommissionRise);
            decimal.TryParse(this.txtThirdCommissionRise.Text.Trim(), out thirdCommissionRise);
            distributorGradeInfo.CommissionsLimit     = num;
            distributorGradeInfo.FirstCommissionRise  = firstCommissionRise;
            distributorGradeInfo.SecondCommissionRise = secondCommissionRise;
            distributorGradeInfo.ThirdCommissionRise  = thirdCommissionRise;
            distributorGradeInfo.IsDefault            = (this.rbtnlIsDefault.SelectedIndex == 0);
            distributorGradeInfo.Description          = this.txtDescription.Text.Trim();
            distributorGradeInfo.Ico = this.uploader1.UploadedImageUrl;
            if (DistributorGradeBrower.IsExistsMinAmount(this.GradeId, num))
            {
                this.ShowMsg("已存在相同佣金的分销商等级", false);
                return;
            }
            if (this.GradeId > 0)
            {
                if (DistributorGradeBrower.UpdateDistributor(distributorGradeInfo))
                {
                    if (base.Request.QueryString["reurl"] != null)
                    {
                        this.ReUrl = base.Request.QueryString["reurl"].ToString();
                    }
                    if (string.IsNullOrEmpty(this.ReUrl))
                    {
                        this.ReUrl = "distributorgradelist.aspx";
                    }
                    this.ShowMsgAndReUrl("成功修改了分销商等级", true, this.ReUrl);
                    return;
                }
                this.ShowMsg("分销商等级修改失败", false);
                return;
            }
            else
            {
                if (DistributorGradeBrower.CreateDistributorGrade(distributorGradeInfo))
                {
                    this.ShowMsgAndReUrl("成功新增了分销商等级", true, this.ReUrl);
                    return;
                }
                this.ShowMsg("分销商等级新增失败", false);
                return;
            }
        }
Exemplo n.º 2
0
        protected void btnEditUser_Click(object sender, EventArgs e)
        {
            decimal result = 0.0M;
            decimal num2   = 0.0M;
            decimal num3   = 0.0M;
            decimal num4   = 0.0M;
            DistributorGradeInfo distributorgrade = new DistributorGradeInfo();

            if (this.GradeId > 0)
            {
                distributorgrade = DistributorGradeBrower.GetDistributorGradeInfo(this.GradeId);
            }
            distributorgrade.Name = this.txtName.Text.Trim();
            decimal.TryParse(this.txtCommissionsLimit.Text.Trim(), out result);
            decimal.TryParse(this.txtFirstCommissionRise.Text.Trim(), out num2);
            decimal.TryParse(this.txtSecondCommissionRise.Text.Trim(), out num3);
            decimal.TryParse(this.txtThirdCommissionRise.Text.Trim(), out num4);
            distributorgrade.CommissionsLimit     = result;
            distributorgrade.FirstCommissionRise  = num2;
            distributorgrade.SecondCommissionRise = num3;
            distributorgrade.ThirdCommissionRise  = num4;
            distributorgrade.IsDefault            = this.rbtnlIsDefault.SelectedIndex == 0;
            distributorgrade.Description          = this.txtDescription.Text.Trim();
            distributorgrade.Ico = this.uploader1.UploadedImageUrl;
            if (DistributorGradeBrower.IsExistsMinAmount(this.GradeId, result))
            {
                this.ShowMsg("已存在相同佣金的分销商等级", false);
            }
            else if (this.GradeId > 0)
            {
                if (DistributorGradeBrower.UpdateDistributor(distributorgrade))
                {
                    if (base.Request.QueryString["reurl"] != null)
                    {
                        this.ReUrl = base.Request.QueryString["reurl"].ToString();
                    }
                    if (string.IsNullOrEmpty(this.ReUrl))
                    {
                        this.ReUrl = "distributorgradelist.aspx";
                    }
                    this.ShowMsgAndReUrl("成功修改了分销商等级", true, this.ReUrl);
                }
                else
                {
                    this.ShowMsg("分销商等级修改失败", false);
                }
            }
            else if (DistributorGradeBrower.CreateDistributorGrade(distributorgrade))
            {
                this.ShowMsgAndReUrl("成功新增了分销商等级", true, this.ReUrl);
            }
            else
            {
                this.ShowMsg("分销商等级新增失败", false);
            }
        }
Exemplo n.º 3
0
        //private bool ABdcZUiWNfsGNbV(oArVIo9LHFJa(MemberInfo memberInfo)
        //{
        //    string[] strArrays = new string[] { "ValMember" };
        //    ValidationResults validationResults = Validation.Validate<MemberInfo>(memberInfo, strArrays);
        //    string empty = string.Empty;
        //    if (!validationResults.IsValid)
        //    {
        //        foreach (ValidationResult validationResult in (IEnumerable<ValidationResult>)validationResults)
        //        {
        //            empty = string.Concat(empty, Formatter.FormatErrorMessage(validationResult.Message));
        //        }
        //        this.ShowMsg(empty, false);
        //    }
        //    return validationResults.IsValid;
        //}

        protected void btnEditUser_Click(object sender, EventArgs e)
        {
            decimal num  = new decimal(0, 0, 0, false, 1);
            decimal num1 = new decimal(0, 0, 0, false, 1);
            decimal num2 = new decimal(0, 0, 0, false, 1);
            decimal num3 = new decimal(0, 0, 0, false, 1);
            DistributorGradeInfo distributorGradeInfo = new DistributorGradeInfo();

            if (this.m_GradeId > 0)
            {
                distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(this.m_GradeId);
            }
            distributorGradeInfo.Name = this.txtName.Text.Trim();
            decimal.TryParse(this.txtCommissionsLimit.Text.Trim(), out num);
            decimal.TryParse(this.txtFirstCommissionRise.Text.Trim(), out num1);
            decimal.TryParse(this.txtSecondCommissionRise.Text.Trim(), out num2);
            decimal.TryParse(this.txtThirdCommissionRise.Text.Trim(), out num3);
            distributorGradeInfo.CommissionsLimit     = num;
            distributorGradeInfo.FirstCommissionRise  = num1;
            distributorGradeInfo.SecondCommissionRise = num2;
            distributorGradeInfo.ThirdCommissionRise  = num3;
            distributorGradeInfo.IsDefault            = (this.rbtnlIsDefault.SelectedIndex == 0 ? true : false);
            distributorGradeInfo.Description          = this.txtDescription.Text.Trim();
            distributorGradeInfo.Ico = this.uploader1.UploadedImageUrl;
            if (DistributorGradeBrower.IsExistsMinAmount(this.m_GradeId, num))
            {
                this.ShowMsg("已存在相同佣金的分销商等级", false);
                return;
            }
            if (this.m_GradeId <= 0)
            {
                if (!DistributorGradeBrower.CreateDistributorGrade(distributorGradeInfo))
                {
                    this.ShowMsg("分销商等级新增失败", false);
                    return;
                }
                this.ShowMsgAndReUrl("成功新增了分销商等级", true, this.ReUrl);
                return;
            }
            if (!DistributorGradeBrower.UpdateDistributor(distributorGradeInfo))
            {
                this.ShowMsg("分销商等级修改失败", false);
                return;
            }
            if (base.Request.QueryString["reurl"] != null)
            {
                this.ReUrl = base.Request.QueryString["reurl"].ToString();
            }
            this.ShowMsgAndReUrl("成功修改了分销商等级", true, this.ReUrl);
        }