public List<string> FillReservationInfo()
 {
     
     var selectedCustomerID = GetSelectedCustomerID();
     var dbm = new DBmanager();
     var reservationList = dbm.GetCustomerReservationInformationToFill(selectedCustomerID);
     return reservationList;
 }
        private void btnDeleteReservation_Click(object sender, EventArgs e)
        {
            var customerID = mainForm.GetSelectedCustomerID();
            var dbm        = new DBmanager();

            dbm.DeleteReservation(customerID);
            MessageBox.Show("Reservation is now annulled");
            this.Close();
        }
        private void btnChangeReservation_Click(object sender, EventArgs e)
        {
            var customerID = mainForm.GetSelectedCustomerID();
            var dbm        = new DBmanager();

            dbm.DeleteReservation(customerID);
            using (var subform = new BookARoomForm(mainForm))
            {
                subform.ShowDialog();
            }
            this.Close();
        }
        private void btnSearchCustomers_Click(object sender, EventArgs e)
        {
            listBoxSearchedCustomers.Items.Clear();
            var dbm = new DBmanager();
            var searchedCustomer = dbm.SearchForCustomer(tBoxSearchCustomers.Text); 
            
            foreach (var customer in searchedCustomer)
            {
                listBoxSearchedCustomers.Items.Add($"{customer.CustomerID} {customer.FirstName} {customer.LastName}");
            }

        }      
        public void FillInformation()
        {
            var selectedcustomerID = mainForm.GetSelectedCustomerID();
            var dbm = new DBmanager();
            var selectedCustomer = dbm.GetCustomerInformation(selectedcustomerID);

            tBoxFirstName.Text  = selectedCustomer.FirstName.ToString();
            tBoxLastName.Text   = selectedCustomer.LastName.ToString();
            tBoxAddress.Text    = selectedCustomer.Address.ToString();
            tBoxPostalCode.Text = selectedCustomer.PostalCode.ToString();
            tBoxCity.Text       = selectedCustomer.City.ToString();
            tBoxCountry.Text    = selectedCustomer.Country.ToString();
            tBoxPhone.Text      = selectedCustomer.Phone.ToString();
        }
 private void btnPay_Click(object sender, EventArgs e)
 {
     if (listBoxSearchedCustomers.SelectedIndex > -1)
     {
         var customerID = GetSelectedCustomerID();
         var dbm = new DBmanager();
         dbm.UpdatePaymentCustomer(customerID);
     }
     else
     {
         MessageBox.Show("You need to choose customer first");
     }
     
 }
        private void btnAddNewCustomer_Click(object sender, EventArgs e)
        {
            if (tBoxFirstName.Text.Length >= 1 && tBoxLastName.Text.Length >= 1 && tBoxAddress.Text.Length >= 1 &&
                tBoxPostalCode.Text.Length >= 1 && tBoxCity.Text.Length >= 1 && tBoxCountry.Text.Length >= 1 && tBoxPhone.Text.Length >= 1)
            {
                var dbm = new DBmanager();
                dbm.AddNewCustomer(tBoxFirstName.Text, tBoxLastName.Text, tBoxAddress.Text, tBoxPostalCode.Text, tBoxCity.Text, tBoxCountry.Text, tBoxPhone.Text);

                this.Close();
            }
            else
            {
                MessageBox.Show("You need to put information into every textbox");
            }
        }
        private void btnUpdateCustomerInformation_Click(object sender, EventArgs e)
        {
            var customerID = mainForm.GetSelectedCustomerID();
            var dbm        = new DBmanager();

            if (tBoxFirstName.Text.Length >= 1 && tBoxLastName.Text.Length >= 1 && tBoxAddress.Text.Length >= 1 &&
                tBoxPostalCode.Text.Length >= 1 && tBoxCity.Text.Length >= 1 && tBoxCountry.Text.Length >= 1 && tBoxPhone.Text.Length >= 1)
            {
                dbm.UpdateCustomerInformation(customerID, tBoxFirstName.Text, tBoxLastName.Text, tBoxAddress.Text,
                                              tBoxPostalCode.Text, tBoxCity.Text, tBoxCountry.Text, tBoxPhone.Text);
                this.Close();
            }
            else
            {
                MessageBox.Show("You need to put information into every textbox");
            }
        }
 public MainMenuForm()
 {
     InitializeComponent();
     var dbm = new DBmanager();
     dbm.RemoveAllBookingsWichIsntPayedIn10Days();
 }