private void btnModificar_Click(object sender, EventArgs e) { foreach (DataGridViewRow row in dgvReservas.Rows) { if (Convert.ToBoolean(row.Cells[0].Value)) { if (Convert.ToInt32(row.Cells[0].Value) >= 1) { //TODO: MUESTRO FORM PARA MODIFICAR RESERVA Reserva res = new Reserva(); res.fecha_desde = Convert.ToDateTime(row.Cells[3].Value); res.fecha_hasta = Convert.ToDateTime(row.Cells[4].Value); res.codigo = Convert.ToInt32(row.Cells[1].Value); res.hotel_id = Convert.ToInt32(row.Cells[7].Value); res.regimen_id = Convert.ToInt32(row.Cells[8].Value); res.cliente_id = Convert.ToInt32(row.Cells[10].Value); res.id = Convert.ToInt32(row.Cells[11].Value); int tipohabitacion_id = Convert.ToInt32(row.Cells[9].Value); FormSeleccionarHabitaciones form = new FormSeleccionarHabitaciones(res, tipohabitacion_id); form.Owner = this; form.Show(); } else { System.Windows.Forms.MessageBox.Show("No es posible modificar su reserva a menos de un día de que comience. "); } } } }
private void btnBuscarHabitaciones_Click(object sender, EventArgs e) { FormSeleccionarHabitaciones f2 = null; for (int i = 0; i < Application.OpenForms.Count; i++) { if (Application.OpenForms[i] is FormSeleccionarHabitaciones) { f2 = (FormSeleccionarHabitaciones)Application.OpenForms[i]; break; } } if (f2 == null) { f2 = new FormSeleccionarHabitaciones(); } f2.Owner = this; f2.Show(); }