コード例 #1
0
        private void grdVouchers_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e)
        {
            int voucherId = (int)this.grdVouchers.DataKeys[e.RowIndex].Value;

            if (VoucherHelper.GetVoucherItemAmount(voucherId) > 0)
            {
                this.ShowMsg("现金券已经发送给用户,无法删除", true);

                return;
            }
            if (VoucherHelper.DeleteVoucher(voucherId))
            {
                this.BindVouchers();
                this.ShowMsg("成功删除了选定现金券", true);
                return;
            }
            this.ShowMsg("删除现金券失败", false);
        }