Esempio n. 1
0
    public static List <Hotel> Listado()
    {
        List <Hotel> listado = new List <Hotel>();
        List <Hotel> hoteles = DatosHotel.Listado();

        listado.AddRange(hoteles);
        return(listado);
    }
Esempio n. 2
0
 private void HotelesForm_Load(object sender, EventArgs e)
 {
     this.misDatos = DatosHotel.AbrirDatosHotel();
     this.editarLinkLabel.Enabled      = false;
     this.inhabilitarLinkLabel.Enabled = false;
     this.habilitarCheckBox.Visible    = false;
     this.CargaListaEnGrillaDeDatos();
     this.estadoGrabacion = TipoGrabacion.None;
     this.ActivarListado();
 }
Esempio n. 3
0
        private void TourForm_Load(object sender, EventArgs e)
        {
            DatosHotel misDatosHotel = DatosHotel.AbrirDatosHotel();

            this.hotelComboBox.DataSource    = misDatosHotel.ObtenerListadoDeHotel();
            this.hotelComboBox.DisplayMember = "Nombre";
            this.hotelComboBox.ValueMember   = "Id";
            DatosTransporte datosTransporte = DatosTransporte.AbrirDatosTransporte();

            this.transporteComboBox.DataSource    = datosTransporte.ObtenerListadoDeTransporte();
            this.transporteComboBox.DisplayMember = "Transporte";
            this.transporteComboBox.ValueMember   = "ID";
            this.misDatos = DatosTour.AbrirDatosTour();
            this.editarLinkLabel.Enabled      = false;
            this.inhabilitarLinkLabel.Enabled = false;
            this.habilitarCheckBox.Visible    = false;
            this.CargaListaEnGrillaDeDatos();
            this.estadoGrabacion = TipoGrabacion.None;
            this.ActivarListado();
        }
Esempio n. 4
0
    public static List <Promociones> listarVigentes()
    {
        SqlConnection cnn      = new SqlConnection(Conexion.STR);
        string        consulta = "promocionesVigentes";
        SqlCommand    comando  = new SqlCommand(consulta, cnn);

        comando.CommandType = CommandType.StoredProcedure;
        try
        {
            cnn.Open();
            SqlDataReader      lector = comando.ExecuteReader();
            List <Promociones> lista  = new List <Promociones>();
            while (lector.Read())
            {
                int         nro         = (int)lector["nro"];
                DateTime    fechaInicio = (DateTime)lector["fechaInicio"];
                DateTime    fechaFin    = (DateTime)lector["fechaFin"];
                int         dias        = (int)lector["dias"];
                int         pasajeros   = (int)lector["pasajeros"];
                string      titulo      = (string)lector["titulo"];
                string      comentario  = (string)lector["comentario"];
                double      precio      = (double)lector["precio"];
                long        rut         = (long)lector["rut"];
                Hotel       h           = DatosHotel.Buscar(rut);
                int         codigo      = (int)lector["codigo"];
                Tipos       t           = DatosTipo.Buscar(codigo);
                Promociones p           = new Promociones(nro, fechaInicio, fechaFin, dias, pasajeros, titulo, comentario, precio, h, t);
                lista.Add(p);
            }
            return(lista);
        }
        catch (Exception es)
        {
            throw new Exception("Problemas con la base de datos !!!!! " + es.Message);
        }
        finally
        {
            cnn.Close();
        }
    }
    public static List <Habitacion> Lista(long rut)
    {
        SqlConnection cnn      = new SqlConnection(Conexion.STR);
        string        consulta = "ListarHabitacionesDeHotel";
        SqlCommand    comando  = new SqlCommand(consulta, cnn);

        comando.CommandType = CommandType.StoredProcedure;
        comando.Parameters.AddWithValue("@rut", rut);
        try
        {
            Hotel h = DatosHotel.Buscar(rut);
            cnn.Open();
            SqlDataReader     lector = comando.ExecuteReader();
            List <Habitacion> lista  = new List <Habitacion>();
            while (lector.Read())
            {
                int        numero     = (int)lector["numero"];
                int        piso       = (int)lector["piso"];
                bool       balcon     = (bool)lector["balcon"];
                int        codigo     = (int)lector["codigo"];
                double     precio     = (double)lector["precio"];
                bool       disponible = (bool)lector["disponible"];
                Tipos      t          = DatosTipo.Buscar(codigo);
                Habitacion hab        = new Habitacion(numero, piso, balcon, precio, h, t, disponible);
                lista.Add(hab);
            }
            return(lista);
        }
        catch (Exception es)
        {
            throw new Exception("Problemas con la base de datos !!!!! " + es.Message);
        }
        finally
        {
            cnn.Close();
        }
    }
Esempio n. 6
0
    public static List <long> ListadoDeTelefonos(long pRut)
    {
        List <long> telefonos = DatosHotel.ListadoDeTelefonos(pRut);

        return(telefonos);
    }
Esempio n. 7
0
    public static List <string> ListadoDeImganes(long pRut)
    {
        List <string> imagenes = DatosHotel.ListadoDeImganes(pRut);

        return(imagenes);
    }
Esempio n. 8
0
 public static Hotel buscar(long rut)
 {
     return(DatosHotel.Buscar(rut));
 }
Esempio n. 9
0
 public static bool Alta(Hotel h)
 {
     return(DatosHotel.Alta(h) > 0);
 }