Ejemplo n.º 1
0
        private void botonGuardar_Click(object sender, EventArgs e)
        {
            if (dateTimeInicio.Value.CompareTo(dateTimeFin.Value) >= 0)
            {
                MessageBox.Show("Rango de Fechas inválido. Intente nuevamente.",
                "Error Grave", MessageBoxButtons.OK);
                return;
            }
            Inhabilitacion inhab = new Inhabilitacion();

            int respuesta = DAOHotel.estaVacio(hotel, dateTimeInicio.Value, dateTimeFin.Value);
            if (respuesta > 0)
            {
                inhab.Hotel = hotel;
                inhab.Fecha_Inicio_struct = dateTimeInicio.Value;
                inhab.Fecha_Fin_struct = dateTimeFin.Value;
                inhab.Motivo = (textMotivo.Text != null) ? textMotivo.Text : "";

                DAOHotel.borrar(inhab);

                ((HotelBajaMod)Globals.VentanaAnterior).updateGrid();
                this.Close();
            }
            else
            {
                if (respuesta == -1)
                {
                    MessageBox.Show("Error al conectar con la Base de Datos.",
                    "Error Grave", MessageBoxButtons.OK);
                    return;
                }
                MessageBox.Show("Hotel con reservas o huespedes alojados para esas fechas. No es posible dar la baja.",
                "", MessageBoxButtons.OK);
            }            
        }
Ejemplo n.º 2
0
 public static bool borrar(Inhabilitacion inhab)
 {
     string codHotel = inhab.Hotel.ToString();
     string motivo = inhab.Motivo;
     string inicio = inhab.Fecha_Inicio;
     string fin = inhab.Fecha_Fin;
     return executeProcedure("deleteHotel", codHotel, inicio, fin, motivo);
 }
Ejemplo n.º 3
0
 private void BajaHotel(Inhabilitacion bajaInhab)
 {
     DAOHotel.borrar(bajaInhab);
     updateGrid();
 }