private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { DataGridViewRow selectedRow = dgwHoteles.Rows[e.RowIndex]; if (e.ColumnIndex.Equals(0)) { abm.SetVentanaAbierta(); this.Hide(); HotelElegido hotel = new HotelElegido(); hotel.SetNombre(selectedRow.Cells[3].Value.ToString()); hotel.SetMail(selectedRow.Cells[4].Value.ToString()); hotel.SetTelefono(selectedRow.Cells[5].Value.ToString()); hotel.SetDireccion(selectedRow.Cells[6].Value.ToString()); hotel.SetCiudad(selectedRow.Cells[7].Value.ToString()); hotel.SetPais(selectedRow.Cells[8].Value.ToString()); hotel.SetEstrellas_Cant(Int32.Parse(selectedRow.Cells[9].Value.ToString())); hotel.SetEstrellas_Recargo(Int32.Parse(selectedRow.Cells[10].Value.ToString())); hotel.SetFechaCreacion(selectedRow.Cells[11].Value.ToString()); hotel.SetID(Int32.Parse(selectedRow.Cells[2].Value.ToString())); modificarDatosHotel datosHotel = new modificarDatosHotel(); datosHotel.RecibirHotel(hotel); datosHotel.Show(); this.Hide(); } else if (e.ColumnIndex.Equals(1)) { bajaHotel frmBaja = new bajaHotel(Int32.Parse(selectedRow.Cells[2].Value.ToString())); frmBaja.Show(); } }
internal void RecibirHotel(HotelElegido hotel) { this.ciudad = hotel.GetCiudad(); this.direccion = hotel.GetDireccion(); this.hotel = hotel.GetNombre(); this.mail = hotel.GetMail(); this.pais = hotel.GetPais(); this.telefono = hotel.GetTelefono().ToString(); this.idhotel = hotel.GetID(); this.CargarRegimenesHotel(this.idhotel); //if (labelTelefono.Text.Equals("")) { this.labelTelefono.Text = "(vacío)"; } //if (labelPais.Text.Equals("")) { this.labelPais.Text = "(vacío)"; } //if (labelMail.Text.Equals("")) { this.labelMail.Text = "(vacío)"; } //if (labelDireccion.Text.Equals("")) { this.labelDireccion.Text = "(vacío)"; } }