Exemplo n.º 1
0
        public void cargarDatos(int id, String nombre, String mail, String telefono, String calle, String nroCalle, String ciudad, String pais, String fechaCreacion, int estrellas, frmHoteles pantHoteles)
        {
            idHotel              = id;
            textBoxName.Text     = nombre;
            textBoxMail.Text     = mail;
            textBoxTE.Text       = telefono;
            textBoxCalle.Text    = calle;
            textBoxNroCalle.Text = nroCalle.ToString();
            //inicializo combobox de paises
            SqlCommand cmd = new SqlCommand("select nombrePais from [PISOS_PICADOS].Pais", Globals.conexionGlobal);


            SqlDataReader reader3 = cmd.ExecuteReader();

            while (reader3.Read())
            {
                comboBoxPais.Items.Add((reader3["nombrePais"]).ToString());
            }

            reader3.Close();

            comboBoxPais.Text = pais;
            textBoxCIU.Text   = ciudad;
            cBestrellas.Text  = estrellas.ToString();
            pantallaHoteles   = pantHoteles;
            if (fechaCreacion != "")
            {
                dateTimePickerCreacion.Text = fechaCreacion;
            }


            SqlCommand cmdBuscarRegimenesHotel = new SqlCommand("SELECT R.descripcion 'Desc' FROM [PISOS_PICADOS].Regimen R join [PISOS_PICADOS].RegimenxHotel H on (R.codigoRegimen = H.codigoRegimen) WHERE idHotel = @id", Globals.conexionGlobal);

            cmdBuscarRegimenesHotel.Parameters.AddWithValue("@id", id);
            SqlDataReader reader = cmdBuscarRegimenesHotel.ExecuteReader();

            while (reader.Read())
            {
                checkedListBoxRegimenes.Items.Add((reader["Desc"]).ToString());
            }

            reader.Close();

            SqlCommand cmdBuscarRegimenesNo = new SqlCommand("select descripcion from [PISOS_PICADOS].Regimen where descripcion not in (SELECT R.descripcion FROM [PISOS_PICADOS].Regimen R join [PISOS_PICADOS].RegimenxHotel H on (R.codigoRegimen = H.codigoRegimen) WHERE idHotel = @id)", Globals.conexionGlobal);

            cmdBuscarRegimenesNo.Parameters.AddWithValue("@id", id);
            SqlDataReader reader2 = cmdBuscarRegimenesNo.ExecuteReader();

            while (reader2.Read())
            {
                checkedListBoxRegimenesAgregar.Items.Add((reader2["descripcion"]).ToString());
            }

            reader2.Close();

            this.ShowDialog();
        }
Exemplo n.º 2
0
 public void asignarId(int id, frmHoteles pantalla)
 {
     idHotel         = id;
     pantallaHoteles = pantalla;
     this.ShowDialog();
 }
Exemplo n.º 3
0
 public void abrirPantalla(frmHoteles pantHotel)
 {
     pantallaHoteles = pantHotel;
     this.ShowDialog();
 }