//event of card form closing
        void card_FormClosed(object sender, FormClosedEventArgs e)
        {
            FrmCreditCardOfCustomers form = sender as FrmCreditCardOfCustomers;

            if (form != null)
            {
                if (form.ClosingOption == 1 || form.ClosingOption == 3)
                {
                    this.Close();
                }
                else
                {
                    this.Enabled = true;
                }
            }
        }
 private void btnEnter_Click(object sender, EventArgs e)
 {
     if (pnlShoppingCart.Controls.Count == 0)
     {
         MessageBox.Show("סל הקניות ריק");
     }
     else
     {
         //יצירת הזמנה חדשה
         Orders order = new Orders(CurrentCustomerId, DateTime.Today);
         //קריאה לטופס פרטי תשלום ומילוי הפרטים להעברה לטופס זה
         FrmCreditCardOfCustomers card = new FrmCreditCardOfCustomers();
         card.OrderToAdd            = order;
         card.ShoppingCartListItems = shoppingCartListItems;
         card.SumToPay            = int.Parse(lblSumPrice.Text);
         card.CurrentCustomerId   = CurrentCustomerId;
         card.CurrentCustomerName = CurrentCustomerName;
         card.FormClosed         += new FormClosedEventHandler(card_FormClosed);
         this.Enabled             = false;
         //הצגת הטופס
         card.Show();
     }
 }