private void newBtn_Click(object sender, EventArgs e) { AltaHotelForm newForm = new AltaHotelForm(); newForm.ShowDialog(); this.Dispose(); this.Close(); }
private void updateBtn_Click(object sender, EventArgs e) { if (dataGridHoteles.DataSource != null && dataGridHoteles.SelectedRows.Count > 0) { foreach (DataGridViewRow row in dataGridHoteles.SelectedRows) { Hotel hotel = (Hotel)row.DataBoundItem; AltaHotelForm editForm = new AltaHotelForm(hotel); editForm.ShowDialog(); } this.Dispose(); this.Close(); } else { MessageBox.Show("No se seleccionó hotel para modificar. Seleccione una fila de la tabla"); } }