Exemple #1
0
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            UserGradeInfo userGrade = new UserGradeInfo();

            userGrade.ID       = RequestHelper.GetQueryString <int>("ID");
            userGrade.Name     = this.Name.Text;
            userGrade.MinMoney = Convert.ToDecimal(this.MinMoney.Text);
            userGrade.MaxMoney = Convert.ToDecimal(this.MaxMoney.Text);
            userGrade.Discount = Convert.ToDecimal(this.Discount.Text);
            string alertMessage = ShopLanguage.ReadLanguage("AddOK");

            if (userGrade.ID == -2147483648)
            {
                base.CheckAdminPower("AddUserGrade", PowerCheckType.Single);
                int id = UserGradeBLL.AddUserGrade(userGrade);
                AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("UserGrade"), id);
            }
            else
            {
                base.CheckAdminPower("UpdateUserGrade", PowerCheckType.Single);
                UserGradeBLL.UpdateUserGrade(userGrade);
                AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("UserGrade"), userGrade.ID);
                alertMessage = ShopLanguage.ReadLanguage("UpdateOK");
            }
            AdminBasePage.Alert(alertMessage, RequestHelper.RawUrl);
        }