Esempio n. 1
0
        // Boton Guardar
        private void btn_Guardar_Click(object sender, EventArgs e)
        {
            // renglon = 0;
            try
            {
                string rpta = "";
                if (this.txtB_Proveedor.Text == string.Empty || this.txtB_NumFactura.Text == string.Empty ||
                    this.txtB_importetotal.Text == string.Empty)
                {
                    MensajeError("Falta ingresar alguno de los datos remarcados");

                    error_Icono.SetError(txtB_Proveedor, "Ingrese un Valor");
                    error_Icono.SetError(txtB_NumFactura, "Ingrese un Valor");
                    error_Icono.SetError(txtB_importetotal, "Ingrese un Valor");
                }
                else
                {
                    if (this.IsNuevo)
                    {
                        rpta = NNotaCompra.Insertar(this.txtB_NumFactura.Text.Trim().ToUpper(), dt_Fecha.Value, this.txtB_Proveedor.Text.Trim().ToUpper(), Convert.ToDecimal(this.txtB_importetotal.Text), dtDetalle);
                        NArticulo.Editar(codigo, descripcion, compra, venta, stockact);
                    }
                    if (rpta.Equals("OK"))
                    {
                        if (this.IsNuevo)
                        {
                            this.MensajeOk("Se Insertó de forma correcta");
                        }
                    }
                    else
                    {
                        this.MensajeError(rpta);
                    }
                    this.IsNuevo = false;
                    this.Botones();
                    this.Limpiar();
                    this.limpiarDetalle();
                    this.Mostrar();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
Esempio n. 2
0
 // Método BuscarFechas
 private void BuscarFechas()
 {
     this.dtGV_Listado.DataSource = NNotaCompra.BuscarFechas(this.dtFechaInicio.Value.ToString("dd/MM/yyyy"), this.dtFechaFin.Value.ToString("dd/MM/yyyy"));
     this.OcultarColumnas();
     lbl_TotalList.Text = "Total de Registros: " + Convert.ToString(dtGV_Listado.Rows.Count);
 }
Esempio n. 3
0
 // Metodo Mostar Detalle
 private void MostrarDetalle()
 {
     this.dtGV_ListadoDetalle.DataSource = NNotaCompra.MostrarDetalle(Convert.ToInt32(this.txtB_NumComprobante.Text));
 }
Esempio n. 4
0
 // Método Mostrar
 private void Mostrar()
 {
     this.dtGV_Listado.DataSource = NNotaCompra.Mostrar();
     this.OcultarColumnas();
     lbl_TotalList.Text = "Total de Registros: " + Convert.ToString(dtGV_Listado.Rows.Count);
 }