Exemplo n.º 1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();

            masterSettings.IsOpenRechargeGift = this.ooOpen.SelectedValue;
            if (this.ooOpen.SelectedValue)
            {
                masterSettings.EnableBulkPaymentAdvance = false;
                string value = this.hidJson.Value;
                if (string.IsNullOrEmpty(value))
                {
                    this.ShowMsg("充值赠送项不能为空!", false);
                    return;
                }
                List <RechargeGiftInfo> list = JsonHelper.ParseFormJson <List <RechargeGiftInfo> >(value);
                if (list.Any())
                {
                    PromoteHelper.DeleteRechargeGift();
                    foreach (RechargeGiftInfo item in list)
                    {
                        PromoteHelper.AddRechargeGift(item);
                    }
                }
            }
            else
            {
                PromoteHelper.DeleteRechargeGift();
            }
            SettingsManager.Save(masterSettings);
            this.hidIsLoading.Value = "false";
            this.ShowMsg("保存成功", true);
            this.BindRechargeList();
        }