private void buttonConfirm_Click(object sender, EventArgs e)
        {
            Int32 bookingCode = bh.insertBooking(id_hotel, id_regimen, checkin, checkout, extraGuests, id_roomtype);
            if (bookingCode > 0)
            {
                if (updating)
                {
                    MessageBox.Show("Booking updated with code" + Convert.ToString(bookingCode));
                }
                else
                {

                    BookingHolder frm = new BookingHolder();
                    var result = frm.ShowDialog();
                    if (result == DialogResult.OK && frm.id_guest != 0)
                    {
                        Boolean inserted = this.addGuestToBooking(bookingCode, frm.id_guest);
                        if (inserted)
                        {
                            MessageBox.Show("Booking registered with code:" + Convert.ToString(bookingCode));
                        }
                        else
                        {
                            MessageBox.Show("Unable to set the booking holder.");
                        }
                    }
                }
              
            }else{
                MessageBox.Show("Unable to register booking");
            } 
            
        }
Exemple #2
0
        private void buttonConfirm_Click(object sender, EventArgs e)
        {
            Int32 bookingCode = bh.insertBooking(id_hotel, id_regimen, checkin, checkout, extraGuests, id_roomtype);

            if (bookingCode > 0)
            {
                if (updating)
                {
                    MessageBox.Show("Booking updated with code" + Convert.ToString(bookingCode));
                }
                else
                {
                    BookingHolder frm    = new BookingHolder();
                    var           result = frm.ShowDialog();
                    if (result == DialogResult.OK && frm.id_guest != 0)
                    {
                        Boolean inserted = this.addGuestToBooking(bookingCode, frm.id_guest);
                        if (inserted)
                        {
                            MessageBox.Show("Booking registered with code:" + Convert.ToString(bookingCode));
                        }
                        else
                        {
                            MessageBox.Show("Unable to set the booking holder.");
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("Unable to register booking");
            }
        }