Esempio n. 1
0
 private void CU_Pedido_Load(object sender, EventArgs e)
 {
     logicaConsulta.obtenerIdPedido(Txt_correlativo);
     logicaConsulta.cargarCotizaciones(Cbo_codCot, listaCot);
     logicaConsulta.cargarClientes(Cbo_cliente, listaClientes);
     logicaConsulta.cargarProductos(Cbo_codProducto, listaProductos);
     Cbo_opcion.SelectedIndex = 0;
     //Cbo_codCot.SelectedIndex = 0;
     Cbo_codProducto.SelectedIndex = 0;
 }
Esempio n. 2
0
 private void CU_Pedido_Load(object sender, EventArgs e)
 {
     try {
         logicaConsulta.obtenerIdPedido(Txt_correlativo);
         logicaConsulta.cargarCotizaciones(Cbo_codCot, listaCot);
         logicaConsulta.cargarClientes(Cbo_cliente, listaClientes);
         logicaConsulta.cargarProductos(Cbo_codProducto, listaProductos);
         Cbo_opcion.SelectedIndex = 0;
         //Cbo_codCot.SelectedIndex = 0;
         Cbo_codProducto.SelectedIndex = 0;
     }
     catch
     {
         MessageBox.Show("Error Desconocido!", "Pedido", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 3
0
        private void Btn_vender_Click(object sender, EventArgs e)
        {
            try
            {
                if (Dgv_factura.Rows.Count - 1 > 0 && bcliente == true)
                {
                    string[] separados;
                    separados = Txt_correlativo.Text.Split('-');
                    DateTime dataTime  = DateTime.Now;
                    int      iimpuesto = Cbo_serie.SelectedIndex + 1;
                    int      imoneda   = Cbo_moneda.SelectedIndex + 1;
                    logicaConsulta.agregarFacturaE(separados[1],
                                                   listaClientes.ElementAt(Cbo_cliente.SelectedIndex).ToString(),
                                                   iddCotizacion,
                                                   iddPedido,
                                                   "NULL",
                                                   dataTime,
                                                   "Factura" + Cbo_serie.SelectedItem.ToString(),
                                                   listaserie.ElementAt(Cbo_serie.SelectedIndex).ToString(),
                                                   iimpuesto.ToString(),
                                                   imoneda.ToString(),
                                                   "NULL",
                                                   impuestoGeneral.ToString(),
                                                   subtotal.ToString()
                                                   );


                    for (int i = 0; i < Dgv_factura.Rows.Count - 1; i++)
                    {
                        logicaConsulta.agregarFacturaD(
                            Dgv_factura.Rows[i].Cells[0].Value.ToString(),
                            separados[1],
                            Dgv_factura.Rows[i].Cells[1].Value.ToString(),
                            Dgv_factura.Rows[i].Cells[4].Value.ToString(),
                            listaserie.ElementAt(Cbo_serie.SelectedIndex).ToString()
                            );
                    }
                    MessageBox.Show("Factura Registrada Correctamente!", "Facturacion", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    iddPedido                = "";
                    iddCotizacion            = "";
                    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";
                    impuestoGeneral          = 0;

                    bcliente  = false;
                    bproducto = false;

                    Nup_cantidad.Value = 1;
                    Dgv_factura.Rows.Clear();
                    logicaConsulta.obtenerIdPedido(Txt_correlativo);
                }
            }
            catch
            {
                MessageBox.Show("Fallo al Registrar Factura!", "Facturacion", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }