private void Btn_busquedaCotizacion_Click(object sender, EventArgs e) { Frm_consultaCotizacion conCotizacion = new Frm_consultaCotizacion(); conCotizacion.ShowDialog(); if (conCotizacion.DialogResult == DialogResult.OK) { Lbl_idCotizacion.Text = conCotizacion.Dgv_consultaCotizacion.Rows[conCotizacion.Dgv_consultaCotizacion.CurrentRow.Index]. Cells[0].Value.ToString(); Lbl_nombCliente.Text = conCotizacion.Dgv_consultaCotizacion.Rows[conCotizacion.Dgv_consultaCotizacion.CurrentRow.Index]. Cells[1].Value.ToString(); Lbl_metodo.Text = conCotizacion.Dgv_consultaCotizacion.Rows[conCotizacion.Dgv_consultaCotizacion.CurrentRow.Index]. Cells[5].Value.ToString(); } Dgv_detalleFactura.Rows.Clear(); Dgv_detalleFactura.Refresh(); if (Lbl_idCotizacion.Text == "" || Lbl_metodo.Text == "") { Btn_consultarReservacion.Enabled = true; Btn_consultarVehiculo.Enabled = false; } else { Btn_consultarReservacion.Enabled = false; Btn_consultarVehiculo.Enabled = true; MostrarConsulta(); } }
private void Limpiar() { Lbl_reservacion.Text = ""; Lbl_idCotizacion.Text = ""; Lbl_nombCliente.Text = ""; Lbl_metodo.Text = ""; Lbl_vehiculo.Text = ""; Lbl_piloto.Text = ""; Dtp_FecaEntrada.Value = Dtp_FecaEntrada.Value.Date; Dtp_FecaSalida.Value = Dtp_FecaSalida.Value.Date; Dgv_detalleFactura.Rows.Clear(); Dgv_detalleFactura.Refresh(); }
private void Btn_consultarReservacion_Click(object sender, EventArgs e) { Frm_consultaReservacion conReservacion = new Frm_consultaReservacion(); conReservacion.ShowDialog(); if (conReservacion.DialogResult == DialogResult.OK) { Lbl_idCotizacion.Text = conReservacion.Dgv_consultaReservacion.Rows[conReservacion.Dgv_consultaReservacion.CurrentRow.Index]. Cells[1].Value.ToString(); Lbl_nombCliente.Text = conReservacion.Dgv_consultaReservacion.Rows[conReservacion.Dgv_consultaReservacion.CurrentRow.Index]. Cells[0].Value.ToString(); Lbl_metodo.Text = conReservacion.Dgv_consultaReservacion.Rows[conReservacion.Dgv_consultaReservacion.CurrentRow.Index]. Cells[2].Value.ToString(); Lbl_vehiculo.Text = conReservacion.Dgv_consultaReservacion.Rows[conReservacion.Dgv_consultaReservacion.CurrentRow.Index]. Cells[4].Value.ToString(); Lbl_piloto.Text = conReservacion.Dgv_consultaReservacion.Rows[conReservacion.Dgv_consultaReservacion.CurrentRow.Index]. Cells[5].Value.ToString(); Dtp_FecaEntrada.Text = conReservacion.Dgv_consultaReservacion.Rows[conReservacion.Dgv_consultaReservacion.CurrentRow.Index]. Cells[7].Value.ToString(); Dtp_FecaSalida.Text = conReservacion.Dgv_consultaReservacion.Rows[conReservacion.Dgv_consultaReservacion.CurrentRow.Index]. Cells[6].Value.ToString(); idAsignacion = conReservacion.Dgv_consultaReservacion.Rows[conReservacion.Dgv_consultaReservacion.CurrentRow.Index]. Cells[3].Value.ToString(); idReservacion = conReservacion.Dgv_consultaReservacion.Rows[conReservacion.Dgv_consultaReservacion.CurrentRow.Index]. Cells[0].Value.ToString(); } Dgv_detalleFactura.Rows.Clear(); Dgv_detalleFactura.Refresh(); if (Lbl_idCotizacion.Text == "") { } else { Btn_reservar.Enabled = false; Btn_modificar.Enabled = true; Dtp_FecaEntrada.Enabled = false; Dtp_FecaSalida.Enabled = false; boton = 1; } }
private void MostrarConsulta() { string num = Lbl_idCotizacion.Text; try { string consultaMostrar = "SELECT Fk_idTipoHabitacion, FK_idMenus, Fk_idLugarTuristico,cantidadHabitaciones FROM tbl_facturadetalle WHERE Pk_idFactura=" + num + " AND estado = 0;"; OdbcCommand comm = new OdbcCommand(consultaMostrar, Conexion.nuevaConexion()); OdbcDataReader mostrarDatos = comm.ExecuteReader(); while (mostrarDatos.Read()) { Dgv_detalleFactura.Refresh(); Dgv_detalleFactura.Rows.Add(mostrarDatos.GetString(0), mostrarDatos.GetString(1), mostrarDatos.GetString(2), mostrarDatos.GetString(3)); } comm.Connection.Close(); mostrarDatos.Close(); } catch (Exception err) { Console.Write(err.Message); } }