示例#1
0
 public void cargarDatos(ComprasBL comprasBL, ProveedoresBL proveedoresBL, ProductosBL productosBL)
 {
     _comprasBL = comprasBL;
     listadeComprasBindingSource.DataSource     = comprasBL.ListadeCompras;
     listadeProveedoresBindingSource.DataSource = proveedoresBL.ListadeProveedores;
     listadeProductosBindingSource.DataSource   = productosBL.listadeProductos;
 }
示例#2
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime FechaDesde = dtpFechaDesde.Value;
                DateTime FechaHasta = dtpFechaHasta.Value;

                ComprasBL ObjetoCompra = new ComprasBL();

                Int32 Codigo;
                if (cbCliente.SelectedValue != null)
                {
                    if (Int32.TryParse(cbCliente.SelectedValue.ToString(), out Codigo))
                    {
                        ProveedorID = Convert.ToInt32(cbCliente.SelectedValue.ToString());
                    }
                }

                List <cReporteFactura> Listado = ObjetoCompra.ResumenNCF(FechaDesde, FechaHasta, ProveedorID);
                if (Listado.Count > 0)
                {
                    frmrptResumenNCF ResumenFactura = new frmrptResumenNCF(Listado);
                    ResumenFactura.ShowDialog(this);
                }
                else
                {
                    MessageBox.Show("La busqueda no ha arrojado ningun resultado", "Busqueda sin resultado", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            catch (Exception Ex)
            {
            }
        }
示例#3
0
        private void CargarCompras()
        {
            ComprasBL ObjetoCompras = new ComprasBL();

            dgvCompras.AutoGenerateColumns = false;
            dgvCompras.DataSource          = ObjetoCompras.Listar("D");
        }
示例#4
0
        public void CargarDatos(ComprasBL comprasBL, ProveedoresBL proveedoresBL)
        {
            var bindingSource = new BindingSource();

            bindingSource.DataSource =
                from o in comprasBL.ListadeCompras
                select new
            {
                Id          = o.Id,
                Fecha       = o.Fecha,
                Proveedores = proveedoresBL
                              .ListadeProveedores
                              .FirstOrDefault(r => r.Id == o.ProveedoresId)
                              .Nombre,
                Subtotal = o.Subtotal,
                Impuesto = o.Impuesto,
                Total    = o.Total,
                Activo   = o.Activo,
            };

            var reporte = new ReportedeCompras();

            reporte.SetDataSource(bindingSource);

            crystalReportViewer1.ReportSource = reporte;
            crystalReportViewer1.RefreshReport();
        }
示例#5
0
        private void CargarCompras()
        {
            //Cargamos todas las recepciones
            ComprasBL ObjetoCompras = new ComprasBL();

            dgvCompras.AutoGenerateColumns = false;
            dgvCompras.DataSource          = ObjetoCompras.Listar("R");
        }
示例#6
0
文件: Menu.cs 项目: janorybu/ventas
 public Menu()
 {
     InitializeComponent();
     _productosBL   = new ProductosBL();
     _categoriasBL  = new CategoriaBL();
     _clientesBL    = new ClientesBL();
     _ciudadesBL    = new CiudadBL();
     _facturaBL     = new FacturaBL();
     _comprasBL     = new ComprasBL();
     _proveedoresBL = new ProveedoresBL();
     _usuariosBL    = new UsuariosBL();
 }
示例#7
0
        public FormCompras()
        {
            InitializeComponent();
            _comprasBL = new ComprasBL();
            listaComprasBindingSource.DataSource = _comprasBL.ObtenerCompras();

            _proveedoresBL = new ProveedoresBL();
            listaProveedoresBindingSource.DataSource = _proveedoresBL.ObtenerProveedores();

            _productosBL = new ProductosBL();
            listaProductosBindingSource.DataSource = _productosBL.ObtenerProductos();
        }
示例#8
0
 private void btnEliminar_Click(object sender, EventArgs e)
 {
     try
     {
         ComprasBL ObjetoCompras = new ComprasBL();
         ObjetoCompras.Cancelar(CompraID);
     }
     catch (Exception Ex)
     {
         MessageBox.Show("Error al tratar de cancelar la recepcion de compras", "Error de cancelacion", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#9
0
 private void CargarCompras()
 {
     try
     {
         ComprasBL ObjetoCompras = new ComprasBL();
         dgvCompras.AutoGenerateColumns = false;
         dgvCompras.DataSource          = ObjetoCompras.Listar("O");
     }
     catch (Exception Ex)
     {
         throw Ex;
     }
 }
示例#10
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            ComprasBL ObjetoCompra    = new ComprasBL();
            Int32?    DocumentoDesde  = ObtenerDocumento(txtDocumentoDesde.Text);
            Int32?    DocumentoHasta  = ObtenerDocumento(txtDocumentoHasta.Text);
            Int32?    FamiliaID       = ObtenerFamilia();
            Int32?    CodigoProveedor = ObtenerProveedor(cbbProveedor.SelectedValue);
            String    CodigoArticulo  = ObtenerArticulo(cbbProducto.SelectedValue);

            List <cReporteArticulosDevueltos> Lista = ObjetoCompra.ReporteArticulosDevueltos(DocumentoDesde, DocumentoHasta, FechaDesde, FechaHasta, CodigoProveedor, CodigoArticulo, FamiliaID);
            frmrptArticulosDevueltos          ArticulosDevueltos = new frmrptArticulosDevueltos(Lista);

            ArticulosDevueltos.ShowDialog(this);
        }
示例#11
0
 private void frmListaDocumento_Load(object sender, EventArgs e)
 {
     //Cargamos la lista de cotizaciones
     try
     {
         ComprasBL ObjetoFactura = new ComprasBL();
         dgvCotizaciones.AutoGenerateColumns = false;
         ListaCotizaciones          = ObjetoFactura.Listar(TipoDocumento);
         dgvCotizaciones.DataSource = ListaCotizaciones;
     }
     catch (Exception Ex)
     {
         MessageBox.Show(Ex.Message);
     }
 }
示例#12
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                //Verificamos que la factura tenga elementos en el detalle
                if (dgvDetalleFactura.RowCount > 0)
                {
                    ComprasBL ObjetoCompra = new ComprasBL();
                    //Numero de Factura Generada
                    Int32 FacturaID = Convert.ToInt32(ObjetoCompra.Crear(ObtenerOrden()));

                    //Insertamos el detalle de factura
                    if (FacturaID != -1)
                    {
                        try
                        {
                            //Insertamos el detalle de la factura
                            InsertarDetalle(FacturaID);
                            //Mostramos el modulo de pagos
                            frmRptOrdenCompra ImpresionOrden = new frmRptOrdenCompra(FacturaID);
                            ImpresionOrden.ShowDialog(this);
                            //frmPagoFactura PagarFactura = new frmPagoFactura(FacturaID, _TotalGeneral);
                            //PagarFactura.ShowDialog(this);
                            //Inhabilitamos el boton de guardar para evitar que se guarde nuevamente la factura;
                            btnGuardar.Enabled = false;
                        }
                        catch (Exception Ex)
                        {
                            MessageBox.Show(Ex.Message, "Error en facturacion", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Error en la recepcion", "Error al crear recepcion", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }

                else
                {
                    MessageBox.Show("Debe agregar elementos a la presente recepcion", "Error en Recepcion", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    IniciarBusquedaArticulo();
                }
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message, "Error en Recepcion", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#13
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            ComprasBL ObjetoCompra     = new ComprasBL();
            Int32?    ProveedorID      = ObtenerProveedor();
            Int32?    DocumentoDesde   = ObtenerDocumento(txtDesde.Text);
            Int32?    DocumentoHasta   = ObtenerDocumento(txtHasta.Text);
            Boolean   IndGenerada      = ckbGenerada.Checked;
            Boolean   IndCancelada     = ckbCancelada.Checked;
            String    CriterioCantidad = ObtenerCriterio(cbbCriterio.Text);
            Decimal   ValorFactura     = ObtenerValor(txtImporte.Text);
            //Boolean IndFacturada = ckbFacturada.Checked;

            List <cCompras> Lista = ObjetoCompra.Filtrar("D", ProveedorID, DocumentoDesde, DocumentoHasta, FechaDesde, FechaHasta, CriterioCantidad, ValorFactura, IndGenerada, IndCancelada);

            GestionDevolucion.BuscarOrdenes(Lista);
        }
示例#14
0
        private void BuscarOrden()
        {
            DetalleCompraBL ObjetoDetalle = new DetalleCompraBL();
            ComprasBL       ObjetoFactura = new ComprasBL();
            Int64           ID;

            if (txtReferencia.Text != String.Empty)
            {
                //Obtenemos el ID del Documento por medio del numero de documento
                ID = Convert.ToInt64(txtReferencia.Text);

                //Buscamos la cotizacion que tiene este numero de documento
                cCompras Factura = ObjetoFactura.BuscarPorID(ID, "O");
                //Verificamos que obtuvimos algun resultado
                if (Int64.TryParse(Factura.ID.ToString(), out ID))
                {
                    //Guardamos el ID de la FacturA
                    Int64 CompraID = Factura.ID;
                    //Asignamos los datos del cliente que se encuentra en la cotizacion
                    BuscarProveedor(Convert.ToInt32(Factura.ProveedorID));

                    //Buscamos la lista de Articulos que se encuentran en la cotizacion
                    List <cDetalleCompra> ListaDetalle = ObjetoDetalle.ListarDetalle(CompraID, "O");

                    //Objeto Inventario para realizar operaciones
                    InventarioBL ObjetoInventario = new InventarioBL();
                    foreach (cDetalleCompra Detalle in ListaDetalle)
                    {
                        cInventario Articulo = ObjetoInventario.BuscarPorID(Detalle.ArticuloID);
                        //Insertamos los articulos en el DataGrid
                        InsertarLineaGrid(Detalle.ArticuloID,
                                          Articulo.CodigoArticulo,
                                          Articulo.Descripcion,
                                          Detalle.Cantidad,
                                          Detalle.Precio,
                                          Detalle.ImpuestoValor,
                                          (Detalle.ImpuestoValor / 100) * Detalle.Precio,
                                          //Detalle.DescuentoValor,
                                          //(Detalle.DescuentoValor / 100) * Detalle.Precio,
                                          ((Detalle.Cantidad * Detalle.Precio) + ((Detalle.ImpuestoValor / 100) * Detalle.Precio)),
                                          //Detalle.Costo,
                                          Detalle.UnidadCompraID,
                                          Detalle.TipoProducto);
                    }
                }
            }
        }
        public FormReporteCompras()
        {
            InitializeComponent();


            _comprasBL = new ComprasBL();

            /*var bindingsource = new BindingSource();
             * bindingsource.DataSource = _comprasBL.ObtenerCompras();
             *
             * var reporte = new ReporteCompras();
             * reporte.SetDataSource(bindingsource);
             *
             * crystalReportViewer1.ReportSource = reporte;
             * crystalReportViewer1.RefreshReport();
             */
        }
示例#16
0
        private void frmrptDevolucionCompra_Load(object sender, EventArgs e)
        {
            ReportDataSource Datasource    = new ReportDataSource();
            ComprasBL        ObjetoFactura = new ComprasBL();

            try
            {
                Datasource.Name  = "dsReporteFactura";
                Datasource.Value = ObjetoFactura.Reporte(CompraID);
                reportViewer1.LocalReport.DataSources.Clear();
                reportViewer1.LocalReport.DataSources.Add(Datasource);
                //reportViewer1.LocalReport.ReportEmbeddedResource = "GESTGYM.Cliente.Reportes.Formularios.rptListaClientes.rdlc";
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message);
            }
            this.reportViewer1.RefreshReport();
        }
示例#17
0
        public void CargarDatos(ComprasBL comprasBL)
        {
            var bindingSource = new BindingSource();

            bindingSource.DataSource =
                from c in comprasBL.ListadeCompras
                select new
            {
                Id          = c.Id,
                Fecha       = c.Fecha,
                ProveedorId = c.ProveedorId,
                Proveedor   = c.Proveedor,
                Subtotal    = c.Subtotal,
                Total       = c.Total,
                Activo      = c.Activo,
            };
            var reporte = new ReportedeCompras();

            reporte.SetDataSource(bindingSource);

            crystalReportViewer1.ReportSource = reporte;
            crystalReportViewer1.RefreshReport();
        }
示例#18
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                ComprasBL ObjetoCompras  = new ComprasBL();
                Int32?    DocumentoDesde = ObtenerDocumento(txtDocumentoDesde.Text);
                Int32?    DocumentoHasta = ObtenerDocumento(txtDocumentoHasta.Text);
                Int32?    FamiliaID      = ObtenerFamilia();
                Int32?    ProveedorDesde = ObtenerProveedor(cbbProveedorDesde.SelectedValue);
                Int32?    ProveedorHasta = ObtenerProveedor(cbbProveedorHasta.SelectedValue);

                List <cReporteResumenFactura> Lista = ObjetoCompras.ResumenCompras(DocumentoDesde, DocumentoHasta, FamiliaID, FechaDesde, FechaHasta, ProveedorDesde, ProveedorHasta, TipoDocumento);
                if (Lista.Count > 0)
                {
                    if (TipoDocumento == "R")
                    {
                        //RESUMEN DE RECEPCIONES
                        frmrptResumenRecepciones ResumenRecepciones = new frmrptResumenRecepciones(Lista);
                        ResumenRecepciones.ShowDialog(this);
                    }
                    else if (TipoDocumento == "D")
                    {
                        //RESUMEN DE DEVOLUCIONES
                        frmrptResumenDevoluciones ResumenDevoluciones = new frmrptResumenDevoluciones(Lista);
                        ResumenDevoluciones.ShowDialog(this);
                    }
                }
                else
                {
                    MessageBox.Show("La busqueda no arrojado ningun resultado", "Busqueda sin resultado", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#19
0
 public void cargarDatos(ComprasBL comprasBL, ProveedoresBL proveedorBL, CostoBL costoBL)
 {
     listadeComprasBindingSource.DataSource   = comprasBL.ListadeCompras;
     listadeProveedorBindingSource.DataSource = proveedorBL.ListadeProveedor;
     listadeCostosBindingSource.DataSource    = costoBL.ListadeCostos;
 }
示例#20
0
        private void BuscarRecepcion()
        {
            DetalleCompraBL ObjetoDetalle   = new DetalleCompraBL();
            ComprasBL       ObjetoFactura   = new ComprasBL();
            ProveedorBL     ObjetoProveedor = new ProveedorBL();

            Int64 ID;

            if (txtReferencia.Text != String.Empty)
            {
                //Obtenemos el ID del Documento por medio del numero de documento
                ID = Convert.ToInt64(txtReferencia.Text);

                //Buscamos la cotizacion que tiene este numero de documento
                cCompras Factura = ObjetoFactura.BuscarPorID(ID, "R");
                //Verificamos que obtuvimos algun resultado
                if (Int64.TryParse(Factura.ID.ToString(), out ID))
                {
                    //Validamos que la recepcion no tenga el estatus de devuelta
                    if (Factura.EstatusID.ToString() == "O")
                    {
                        //Guardamos el ID de la FacturA
                        Int64 FacturaID   = Factura.ID;
                        Int32 ProveedorID = Convert.ToInt32(Factura.ProveedorID);

                        //Asignamos los datos del cliente que se encuentra en la cotizacion
                        AsignarDatosProveedor(ObjetoProveedor.BuscarPorID(ProveedorID));

                        //Buscamos la lista de Articulos que se encuentran en la cotizacion
                        List <cDetalleCompra> ListaDetalle = ObjetoDetalle.ListarDetalle(FacturaID, "R");

                        //Objeto Inventario para realizar operaciones
                        InventarioBL ObjetoInventario = new InventarioBL();
                        foreach (cDetalleCompra Detalle in ListaDetalle)
                        {
                            cInventario Articulo = ObjetoInventario.BuscarPorID(Detalle.ArticuloID);

                            //Insertamos los articulos en el DataGrid
                            InsertarLineaGrid(Detalle.ArticuloID,
                                              Articulo.CodigoArticulo,
                                              Articulo.Descripcion,
                                              Detalle.Cantidad,
                                              Detalle.Precio,
                                              Detalle.ImpuestoValor,
                                              (Detalle.ImpuestoValor / 100) * Detalle.Precio,
                                              ((Detalle.Cantidad * Detalle.Precio) + ((Detalle.ImpuestoValor / 100) * Detalle.Precio)),
                                              Detalle.UnidadCompraID,
                                              Detalle.TipoProducto);
                        }
                    }
                    else
                    {
                        //Documento Cancelado
                        if (Factura.EstatusID.ToString() == "C")
                        {
                            MessageBox.Show("El documento se encuentra Cancelado, Operacion invalida", "Error en busqueda de recepcion", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                        //Documento Devuelto
                        else if (Factura.EstatusID.ToString() == "D")
                        {
                            MessageBox.Show("El documento ya fue devuelto, Operacion Invalida", "Error en busqueda de recepcion", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                }
            }
        }