Exemple #1
0
        private void btnBack_Click(object sender, EventArgs e)
        {
            this.Close();
            var overviewForm = new BookingOverviewForm();

            overviewForm.Show();
        }
        private void btnShowBookings_Click(object sender, EventArgs e)
        {
            try
            {
                phoneNumberBookings = HelperClass.StringWashPhone(txtPhoneNumberBookings.Text);

                var showBookingsForm = new BookingOverviewForm();
                this.Hide();
                showBookingsForm.Show();
            }
            catch (Exception)
            {
                MessageBox.Show("It appears that you do not have any bookings registered on this phone number" +
                                " You will now enter the main menu");

                var mainMenu = new MainMenuForm();
                this.Hide();
                mainMenu.Show();
            }
        }
Exemple #3
0
        private void btnDeleteBooking_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult dialogResult = MessageBox.Show("Are you sure you want to delete this booking?", "Delete booking", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    var stringList = cklBookingList.CheckedItems.Cast <string>().ToList();

                    TicketList.Clear();

                    var bookingNumberList = new List <int>();

                    foreach (var number in stringList)
                    {
                        bookingNumberList.Add(Int32.Parse(number));
                    }
                    foreach (var bookingId in bookingNumberList)
                    {
                        HelperClass.functions.DeleteBooking(bookingId);
                    }

                    MessageBox.Show("The booking is now deleted, you will automatically go back to main menu");
                    var mainMenuForm = new MainMenuForm();
                    this.Hide();
                    mainMenuForm.Show();
                }
                else if (dialogResult == DialogResult.No)
                {
                    var changeBookingForm = new BookingOverviewForm();
                    this.Hide();
                    changeBookingForm.Show();
                }
            }
            catch (Exception)
            {
                MessageBox.Show("");
            }
        }