/// <summary> /// Handles the Click event of the btnCoupon control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param> protected void btnCoupon_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtCouponCode.Text)) { CouponService couponService = new CouponService(); couponService.ApplyCoupon(txtCouponCode.Text, order); lblCouponInformationDisplay.Text = StoreUtility.GetFormattedAmount(order.DiscountAmount, true); ReloadOrder(); } else { foreach (OrderItem orderItem in order.OrderItemCollection) { orderItem.DiscountAmount = 0.00M; orderItem.Save("CouponService"); } lblCouponInformationDisplay.Text = StoreUtility.GetFormattedAmount(0.00M, true); } //re-calculate the tax OrderController.CalculateTax(WebUtility.GetUserName()); //reload the order orderSummary.Order = new OrderController().FetchOrder(WebUtility.GetUserName()); orderSummary.LoadOrder(); acCheckout.SelectedIndex = acCheckout.SelectedIndex + 1; SetProcessOrderEnablement(); }