public UHotel informacion_del_hotel(UHotel hotel) { hotel = new DAOhotel().infohotel(hotel); hotel.Zona = (new DAOhotel().zona(hotel)).Nombre; hotel.Municipio = (new DAOhotel().municipio(hotel)).Nombre; return(hotel); }
//Confirmar reserva public UHotel confirmarReserva(UHotel infoHotel, UReserva infoReserva) { UHotel hotel = new UHotel(); hotel = new DAOhotel().infohotel(infoHotel); var fechasreservadas = new DAOReserva().fechasdisponibles(infoReserva); int cantReservas = new DAOReserva().verificarreserva(infoReserva); string fechaLlegada = (infoReserva.Fecha_llegada).ToString(); string fechaSalida = (infoReserva.Fecha_salida).ToString(); if (fechasreservadas == 1) { //cm.RegisterClientScriptBlock(this.GetType(), "", "<script type='text/javascript'>alert('No hay disponibilidad entre estas fechas');</script>"); hotel.Mensaje2 = "No hay disponibilidad entre estas fechas"; hotel.Mensaje = null; } else if (fechasreservadas == 0) { if (cantReservas == 0) { if (infoReserva.Idusuario != 0) { new DAOReserva().insertReserva(infoReserva); hotel.Mensaje = "La reserva ha sido exitosa"; hotel.Mensaje2 = null; //cm.RegisterClientScriptBlock(this.GetType(), "", "<script type='text/javascript'>alert('La reserva ha sido exitosa');</script>"); new Mail().mailconfirmarreserva(infoReserva); //correo de confirmacion } else { new DAOReserva().insertReserva(infoReserva); new Mail().mailconfirmarreserva(infoReserva); hotel.Mensaje = "La reserva ha sido exitosa"; hotel.Mensaje2 = "ESTA RESERVA SE ENCUENTRA OCUPADA"; //cm.RegisterClientScriptBlock(this.GetType(), "", "<script type='text/javascript'>alert('La reserva ha sido exitosa');</script>"); } } else { hotel.Mensaje2 = "ESTA RESERVA SE ENCUENTRA OCUPADA";//, REVISE SU CORREO PARA MÁS DETALLES hotel.Mensaje = null; //cm.RegisterClientScriptBlock(this.GetType(), "", "<script type='text/javascript'>alert('ESTA RESERVA SE ENCUENTRA OCUPADA');</script>"); } } return(hotel); }
public UHotel info_hotel(UHotel session) { UHotel hotel = new UHotel(); if (session != null) { hotel.Idhotel = session.Idhotel; hotel = new DAOhotel().infohotel(hotel); return(hotel); } else { hotel.Url = "index.aspx"; return(hotel); } }
public UHabitacion agregarHabitacion(int idtipo, UHabitacion habitacion) { UHabitacion mensaje = new UHabitacion(); if (habitacion.Tipo != "--Seleccionar--") { UHotel infohotel = new UHotel(); infohotel.Idhotel = habitacion.Idhotel; infohotel = new DAOhotel().infohotel(infohotel); if (idtipo == 1)//basica { habitacion.Precio = infohotel.Precionoche; } if (idtipo == 2)//doble { habitacion.Precio = infohotel.PrecioNocheDoble; } if (idtipo == 3)//premium { habitacion.Precio = infohotel.PrecioNochePremium; } int cantHabitaciones = new DAOHabitacion().cantidadHabitaciones(habitacion); if (cantHabitaciones == 150) { mensaje.Mensaje = " Limite de habitaciones alcanzado"; } else { new DAOHabitacion().insertHabitacion(habitacion); new DAOhotel().actualizarhabiatacion(habitacion); mensaje.Mensaje = " Habitacion añadida con exito"; mensaje.Tb_NumPersonas = ""; mensaje.Tb_NumBanio = ""; mensaje.Tb_NumeroDeCamas = ""; } } else { mensaje.Mensaje = "Seleccione una opción"; } return(mensaje); }
public List <UHotel> listaMisHoteles(URegistro session) { List <UHotel> listaMisHoteles = new DAOhotel().obtenerhoteles(session); return(listaMisHoteles); }