Example #1
0
        private void btnSaveChangesSeats_Click(object sender, EventArgs e)
        {
            NewSeats.Clear();

            var stringList = cklListTickets.CheckedItems.Cast <string>().ToList();

            var intList = new List <int>();

            foreach (var number in stringList)
            {
                intList.Add(Int32.Parse(number));
            }

            foreach (var indexChecked in intList)
            {
                NewSeats.Add((int)indexChecked);
            }

            List <int> oldSeats = new List <int>();

            foreach (var oldSeat in OldSeats)
            {
                oldSeats.Add(oldSeat);
            }

            HelperClass.functions.ChangeTicketsOnBooking(movieId, oldSeats, oldShowTimeId, NewSeats, showTimeId);

            MessageBox.Show("The tickets are now changed! You will now automatically go back to main menu");

            var mainMenu = new MainMenuForm();

            this.Hide();
            mainMenu.Show();
        }
        private void btnBackToMenu_Click(object sender, EventArgs e)
        {
            var mainMenuForm = new MainMenuForm();

            this.Hide();
            mainMenuForm.Show();
        }
Example #3
0
        private void btnGoToMenu_Click(object sender, EventArgs e)
        {
            this.Close();

            var mainMenuForm = new MainMenuForm();

            mainMenuForm.Show();
        }
Example #4
0
        private void btnBack_Click(object sender, EventArgs e)
        {
            BookedTickets.Clear();
            this.Close();
            var mainMenu = new MainMenuForm();

            mainMenu.Show();
        }
Example #5
0
        private void btnGoBackMaenu_Click(object sender, EventArgs e)
        {
            if (HelperClass.functions.ListOfCustomerBookings(NewCustomerForm.phoneNumber).Count() == 0)
            {
                HelperClass.functions.DeleteCustomer(NewCustomerForm.phoneNumber);
            }
            this.Close();
            var mainMenuForm = new MainMenuForm();

            mainMenuForm.Show();
        }
Example #6
0
        private void btnBook_Click(object sender, EventArgs e)
        {
            var listOfChoices = new List <int>();

            foreach (var ticket in MovieForm.BookedTickets)
            {
                listOfChoices.Add(ticket);
            }

            HelperClass.functions.BookTickets(listOfChoices, MainMenuForm.MovieChoice, MovieForm.showTime, EnterPhoneNumber.phoneNumber);

            MessageBox.Show("This is now booked!\n You will now automatically go back to main menu");

            var mainMenuForm = new MainMenuForm();

            this.Hide();
            mainMenuForm.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();
            }
        }
Example #8
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("");
            }
        }