Example #1
0
        protected void btnaddtag_Click(object sender, System.EventArgs e)
        {
            ManagerHelper.CheckPrivilege(Privilege.TaxRateAdd);
            string text            = Globals.HtmlEncode(this.txtaddtagname.Text.Trim());
            string code            = Globals.HtmlEncode(this.txtaddcode.Text.Trim());
            string CodeDescription = Globals.HtmlEncode(this.txtAddCodeDescription.Text.Trim());

            if (string.IsNullOrEmpty(text))
            {
                this.ShowMsg("税率不允许为空!", false);
                return;
            }
            if (string.IsNullOrEmpty(code))
            {
                this.ShowMsg("行邮编码不允许为空", false);
                return;
            }
            decimal taxRate = decimal.Parse(text);

            if (CatalogHelper.AddTaxRate(taxRate, code, CodeDescription) > 0)
            {
                this.ShowMsg("添加成功!", true);
                this.TaxRateBind();
                return;
            }
            else
            {
                this.ShowMsg("添加失败,请确认是否存在相同数值", false);
            }
        }