/// <summary>
        /// Close Form Event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmbLoyalLoyaltyTender_FormClosing(object sender, FormClosingEventArgs e)
        {
            try
            {
                this.Hide();

                if (!string.IsNullOrWhiteSpace(_transactionCode) && _applyAmount > 0)
                {
                    var cartLineHelper = new CartLineHelper();

                    var lines = cartLineHelper.GetCartLines(_currentTicket);

                    AsyncHelper.RunSync(() => _services.AddGiftCardPaymentTransactionAsync(_transactionCode, _applyAmount, string.Empty, _currentOpenTicketId.ToString(), lines));
                }
                _transactionCode = string.Empty;
                _applyAmount     = 0;
            }
            catch (Exception ex)
            {
                _logger.WriteLogError(ex, "frmbLoyalLoyaltyTender_FormClosing");
            }
        }
        /// <summary>
        /// Apply Load GiftCard Item
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void applyBtn_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrWhiteSpace(txtGiftCardNumber.Text))
                {
                    lblEmptyCardNumberError.Visible = true;
                    lblEmptyCardNumberError.Text    = "Please enter gift card number.";
                }
                else
                {
                    try
                    {
                        FinancialCard financialCardHelper = new FinancialCard(txtGiftCardNumber.Text);
                        txtGiftCardNumber.Text = financialCardHelper.CardNumber;
                    }
                    catch (Exception ex)
                    {
                        _logger.WriteLogError(ex, "FinancialCard for swap Load GiftCard");
                    }

                    lblEmptyCardNumberError.Visible = false;
                    if (!string.IsNullOrWhiteSpace(txtGiftCardNumber.Text))
                    {
                        CalculateTransactionHelper transaction = new CalculateTransactionHelper();

                        string checkLoadGiftCrad = transaction.CheckLoadGiftCard(txtGiftCardNumber.Text);

                        if (!string.IsNullOrWhiteSpace(checkLoadGiftCrad))
                        {
                            this.Hide();
                            frmLoadGiftCardWarning loadGiftCardWarning = new frmLoadGiftCardWarning(checkLoadGiftCrad);
                            loadGiftCardWarning.ShowDialog();
                            this.Show();
                        }
                        else
                        {
                            CalculateCartCommand request = null;
                            if (_calculatedCart != null && _calculatedCart.Cart != null && _calculatedCart.Cart.Lines != null && _calculatedCart.Cart.Lines.Any())
                            {
                                var line = _calculatedCart.Cart.Lines.ToList().Find(t => t.ProductName.Equals(_loadGiftItem, StringComparison.InvariantCultureIgnoreCase) && t.ProductExternalId.Equals(_loadMenuItem.TIID));
                                if (line != null)
                                {
                                    line.GiftCardNumber = txtGiftCardNumber.Text;
                                    _giftCardNumber     = txtGiftCardNumber.Text;
                                }
                                else
                                {
                                    var newline = new CartLine {
                                        ProductName = _loadMenuItem.ItemName, ProductCode = _loadMenuItem.ID, GiftCardNumber = txtGiftCardNumber.Text, Price = _loadMenuItem.Price / _loadMenuItem.Quantity, Quantity = _loadMenuItem.Quantity, ExternalId = _loadMenuItem.ID, ProductExternalId = _loadMenuItem.TIID
                                    };
                                    _calculatedCart.Cart.Lines.Add(newline);
                                }
                                request = new CalculateCartCommand()
                                {
                                    Cart = _calculatedCart.Cart,
                                    Uid  = _calculatedCart.Cart.Uid
                                };
                            }
                            else
                            {
                                var cart = new Cart {
                                    Lines = new List <CartLine>(), SourceExternalId = _currentOpenTicketId.ToString()
                                };
                                var cartLineHelper = new CartLineHelper();

                                var lines = cartLineHelper.GetCartLines(_ticket);

                                if (lines != null && lines.Any())
                                {
                                    var line = lines.ToList().Find(t => t.ProductName.Equals(_loadGiftItem, StringComparison.InvariantCultureIgnoreCase) && t.ProductExternalId.Equals(_loadMenuItem.TIID));
                                    if (line != null)
                                    {
                                        line.GiftCardNumber = txtGiftCardNumber.Text;
                                        _giftCardNumber     = txtGiftCardNumber.Text;
                                    }
                                    cart.Lines = lines;
                                    request    = new CalculateCartCommand()
                                    {
                                        Cart = cart
                                    };
                                }
                            }

                            if (request != null)
                            {
                                _services.CalculateCart(request);
                            }

                            this.Close();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                _logger.WriteLogError(ex, "bLoyal Load GiftCard applyBtn_Click");
            }
        }