private void Btn_vender_Click(object sender, EventArgs e) { try { if (Dgv_factura.Rows.Count - 1 > 0 && bcliente == true) { logicaConsulta.agregarCotizacionE(Txt_correlativo.Text, listaClientes.ElementAt(Cbo_clientes.SelectedIndex).ToString(), Dtp_actual.Value.Date, Dtp_final.Value.Date ); for (int i = 0; i < Dgv_factura.Rows.Count - 1; i++) { logicaConsulta.agregarCotizacionD( Dgv_factura.Rows[i].Cells[0].Value.ToString(), Txt_correlativo.Text, Dgv_factura.Rows[i].Cells[1].Value.ToString(), Dgv_factura.Rows[i].Cells[4].Value.ToString() ); } MessageBox.Show("Cotizacion Registrada Correctamente!", "Cotizacion", MessageBoxButtons.OK, MessageBoxIcon.Information); Txt_nombres.Text = ""; Txt_apellidos.Text = ""; Txt_nit.Text = ""; Txt_nombreProducto.Text = ""; Txt_descProducto.Text = ""; Txt_subtotal.Text = "0.00"; Txt_subtotalGeneral.Text = "Q. 0.00"; Txt_total.Text = "Q. 0.00"; Txt_registros.Text = "0"; bcliente = false; bproducto = false; Nup_cantidad.Value = 1; Dgv_factura.Rows.Clear(); logicaConsulta.obtenerIdCotizacion(Txt_correlativo); } } catch { MessageBox.Show("Fallo al Registrar Cotizacion!", "Cotizacion", MessageBoxButtons.OK, MessageBoxIcon.Error); } }