protected void btnDeleteCoupon_Click(object sender, EventArgs e) { ViewState["discount"] = 0; calculateCart(); CartBL cartBL = new CartBL(); cartBL.SaveCartCoupon(Session["cartID"].ToString(), -1); btnDeleteCoupon.Visible = false; }
protected void btnAddCoupon_Click(object sender, EventArgs e) { CouponBL couponBL = new CouponBL(); Coupon coupon = couponBL.GetCoupon(txtCoupon.Text); if (coupon != null) { ViewState["discount"] = coupon.Discount; CartBL cartBL = new CartBL(); cartBL.SaveCartCoupon(Session["cartID"].ToString(), coupon.CouponID); calculateCart(); btnDeleteCoupon.Visible = true; } }