private void Btn_consultar_Click(object sender, EventArgs e) { if (presionado == false) { DeshabilitarBtn(); Btn_consultar.Enabled = true; presionado = true; } else { Frm_consultaHotel conHotel = new Frm_consultaHotel(); conHotel.ShowDialog(); if (conHotel.DialogResult == DialogResult.OK) { Txt_idHotel.Text = conHotel.Dgv_consultaHotel.Rows[conHotel.Dgv_consultaHotel.CurrentRow.Index]. Cells[0].Value.ToString(); Txt_nombre.Text = conHotel.Dgv_consultaHotel.Rows[conHotel.Dgv_consultaHotel.CurrentRow.Index]. Cells[1].Value.ToString(); Txt_direccion.Text = conHotel.Dgv_consultaHotel.Rows[conHotel.Dgv_consultaHotel.CurrentRow.Index]. Cells[2].Value.ToString(); Txt_telefono.Text = conHotel.Dgv_consultaHotel.Rows[conHotel.Dgv_consultaHotel.CurrentRow.Index]. Cells[3].Value.ToString(); Txt_correo.Text = conHotel.Dgv_consultaHotel.Rows[conHotel.Dgv_consultaHotel.CurrentRow.Index]. Cells[0].Value.ToString(); Txt_nombre.Focus(); presionado = false; HabilitarBtn(); } } }
private void Btn_consultaHotel_Click(object sender, EventArgs e) { Frm_consultaHotel consultaHotel = new Frm_consultaHotel(); consultaHotel.ShowDialog(); if (consultaHotel.DialogResult == DialogResult.OK) { Txt_lugarHotel.Text = consultaHotel.Dgv_consultaHotel.Rows[consultaHotel.Dgv_consultaHotel.CurrentRow.Index].Cells[1].Value.ToString(); } Btn_consultaHabitación.Enabled = true; }