Exemplo n.º 1
0
        private void DeleteBooking()
        {
            //Try to...
            try
            {
                //Call the DeleteBooking method from the Bookings Class and pass across the data.
                int rowsAffected = Bookings.DeleteBooking(txtBookingID.Text);

                if (rowsAffected > 0)
                {
                    //If the Booking has been deleted successfully, displaythe message below.
                    MessageBox.Show("Booking deleted successfully.");
                    //Call the reset method.
                    Reset();
                }
            }
            //Catch any exception which may occur and display an error message.
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }