Пример #1
0
        private void buttonSearch_Click(object sender, EventArgs e)
        {
            Boolean isValid = true;

            if (VarGlobal.usuario.hotel == 0 || VarGlobal.usuario.id == "guest")
            {
                isValid = Validaciones.validAndRequiredInt32(textBoxBookingId.Text, "El numero de reserva debe ser numerico");
            }

            if (isValid)
            {
                Int32 bookingId;
                if (textBoxBookingId.Text != String.Empty)
                {
                    bookingId = Convert.ToInt32(textBoxBookingId.Text);
                }
                else
                {
                    bookingId = 0;
                }
                CancelationBookingHelper.search(bookingId, textBoxLastname.Text, dgvCancellationBooking);
            }
            else
            {
                return;
            }
        }
Пример #2
0
 private void buttonCancel_Click(object sender, EventArgs e)
 {
     if (dgvCancellationBooking.CurrentRow != null)
     {
         if (textBoxMotive.Text != String.Empty)
         {
             CancelationBookingHelper.cancel(Convert.ToInt32(dgvCancellationBooking.CurrentRow.Cells[0].Value), textBoxMotive.Text);
             buttonSearch.PerformClick();
         }
         else
         {
             MessageBox.Show("Debe escribir un motivo para la cancelacion de la reserva");
         }
     }
     else
     {
         MessageBox.Show("Debe seleccionar una reserva a cancelar");
     }
 }