コード例 #1
0
        private void notasDeDébitoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ComprobantesBL FacturasBL = BusinessLogicFactory.GetBusinessLogicInstance(db, typeof(ComprobantesBL)) as ComprobantesBL;

            FacturasBL.SetTipoFilter(TiposComprobantesList.NotaDebito);
            CRUDComprobantesController result = new CRUDComprobantesController(FacturasBL, "Notas de Débito", "Notas de Débito", typeof(ComprobantesCRUD));

            CRUDControllerManager.Instance.GetCRUDChildControllerManager().SetChildControllers(result);
            result.ShowGrid();
        }
コード例 #2
0
 private void detallesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (SecurityManager.Instance.HavePermissions(new FuncionReportes()))
     {
         CRUDComprobantesController crudComprobantes = new CRUDComprobantesController(BusinessLogicFactory.GetBusinessLogicInstance(db, typeof(ComprobantesBL)), "Comprobantes", "Comprobantes", typeof(ComprobantesCRUD));
         crudComprobantes.Comprobantes = BusinessLogicFactory.GetBusinessLogicInstance(db, typeof(ComprobantesBL)) as ComprobantesBL;
         crudComprobantes.Empresas     = BusinessLogicFactory.GetBusinessLogicInstance(db, typeof(EmpresasBL)) as EmpresasBL;
         crudComprobantes.GenerarArchivoDetallePeriodo();
         MessageBox.Show("Se ha generado con éxito el archivo de detalles", "Archivo de detalles generado", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #3
0
        private void emitirPendientesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            frmSplash.Show();
            EmpresasBL     EmpresasBL = BusinessLogicFactory.GetBusinessLogicInstance(db, typeof(EmpresasBL)) as EmpresasBL;
            ComprobantesBL FacturasBL;

            FacturasBL = BusinessLogicFactory.GetBusinessLogicInstance(db, typeof(ComprobantesBL)) as ComprobantesBL;
            //FacturasBL.SetTipoFilter(TiposComprobantesList.Factura);
            List <TiposComprobantesList> tipos = new List <TiposComprobantesList>();

            tipos.Add(TiposComprobantesList.Factura);
            tipos.Add(TiposComprobantesList.NotaCredito);
            tipos.Add(TiposComprobantesList.NotaDebito);
            FacturasBL.SetTiposFilter(tipos);
            FacturasBL.SetEstadoFilter(Comprobantes.EstadoPendiente);
            FacturasBL.SetEmisionHoyFilter();
            ArrayList facturasPend = new ArrayList();

            facturasPend.AddRange(FacturasBL.GetDataSource());
            CRUDComprobantesController result = new CRUDComprobantesController(FacturasBL, "Facturas", "Facturas", typeof(ComprobantesCRUD));

            bool     verReporteAux;
            string   nroComp;
            int      index = 1;
            Empresas emp   = null;

            foreach (Comprobantes comp in facturasPend)
            {
                frmSplash.TextoContador = String.Format("{0} de {1}", index.ToString(), facturasPend.Count.ToString());
                frmSplash.Refresh();
                nroComp         = null;
                verReporteAux   = comp.VerReporte;
                comp.VerReporte = false;
                result.EmitirComprobante(comp, out nroComp, false);
                if (nroComp == "-1")
                {
                    throw new Exception("Hubo un error emitiendo los comprobantes.");
                }
                PersistirUltimoNroCbanteComprobante(comp);

                comp.VerReporte = verReporteAux;
                index++;
                emp = comp.Empresa;
            }
            EmpresasBL.SaveOrUpdate(emp);
            frmSplash.Hide();
            Cursor.Current = Cursors.Default;
        }
コード例 #4
0
        private void emitirFacturaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Thread thrdStatus = new Thread(new ParameterizedThreadStart(Status.CheckStatus));

            thrdStatus.IsBackground = true;
            thrdStatus.Start(this);

            ComprobantesBL FacturasBL = BusinessLogicFactory.GetBusinessLogicInstance(db, typeof(ComprobantesBL)) as ComprobantesBL;

            FacturasBL.SetTipoFilter(TiposComprobantesList.Factura);
            CRUDComprobantesController result = new CRUDComprobantesController(FacturasBL, "Facturas", "Facturas", typeof(ComprobantesCRUD));

            CRUDControllerManager.Instance.GetCRUDChildControllerManager().SetChildControllers(result);

            result.ShowCRUDForm();
        }
コード例 #5
0
        private void bbMain_ItemClick(object sender, ItemEventArgs e)
        {
            CRUDComprobantesController result;
            ComprobantesBL             FacturasBL;

            switch (e.Item.Key)
            {
            case "Productos":
            {
                CRUDControllerManager.Instance.GetCRUDController(db, typeof(ProductosBL), typeof(ProductosCRUD), "Productos", "Productos").ShowGrid();
                break;
            }

            case "Clientes":
            {
                CRUDControllerManager.Instance.GetCRUDController(db, typeof(ClientesBL), typeof(ClientesCRUD), "Clientes", "Clientes").ShowGrid();
                break;
            }

            case "Rubros":
            {
                CRUDControllerManager.Instance.GetCRUDController(db, typeof(RubrosBL), typeof(IdDescripcionCRUD), "Rubros", "Rubros").ShowGrid();
                break;
            }

            case "Clases":
            {
                CRUDControllerManager.Instance.GetCRUDController(db, typeof(ClasesBL), typeof(IdDescripcionCRUD), "Clases", "Clases").ShowGrid();
                break;
            }

            case "Tipos Contribuyente":
            {
                CRUDControllerManager.Instance.GetCRUDController(db, typeof(TiposContribuyentesBL), typeof(TiposContribuyentesCRUD), "Tipos Contribuyentes", "Tipos Contribuyentes").ShowGrid();
                break;
            }

            case "Empresa":
            {
                CRUDControllerManager.Instance.GetCRUDController(db, typeof(EmpresasBL), typeof(EmpresasCRUD), "Empresas", "Empresas").ShowGrid();
                break;
            }

            case "Facturacion":
            {
                if (SecurityManager.Instance.HavePermissions(new FuncionReportes()))
                {
                    ShowPeriodoYTipo(ShowFacturacionReport);
                }
                break;
            }

            case "ProductosTOP":
            {
                if (SecurityManager.Instance.HavePermissions(new FuncionReportes()))
                {
                    ShowPeriodo(ShowProductosReport);
                }
                break;
            }

            case "LibroIVA":
            {
                if (SecurityManager.Instance.HavePermissions(new FuncionReportes()))
                {
                    ShowPeriodo(ShowComprobantesReport);
                }
                break;
            }

            case "Usuarios":
            {
                if (SecurityManager.Instance.HavePermissions(new FuncionReportes()))
                {
                    ShowPeriodoYTipo(ShowFacturacionUsuariosReport);
                }
                break;
            }

            case "Comprobantes":
            {
                //CRUDControllerManager.Instance.GetCRUDController(db, typeof(ComprobantesBL), typeof(ComprobantesCRUD), "Comprobantes", "Comprobantes").ShowGrid();
                //CRUDComprobantesController result = new CRUDComprobantesController(BusinessLogicFactory.GetBusinessLogicInstance(db, typeof(ComprobantesBL)), "Comprobantes", "Comprobantes", typeof(ComprobantesCRUD));
                //CRUDControllerManager.Instance.GetCRUDChildControllerManager().SetChildControllers(result);
                //result.ShowGrid();

                FacturasBL = BusinessLogicFactory.GetBusinessLogicInstance(db, typeof(ComprobantesBL)) as ComprobantesBL;
                FacturasBL.SetTipoFilter(TiposComprobantesList.Factura);
                result = new CRUDComprobantesController(FacturasBL, "Facturas", "Facturas", typeof(ComprobantesCRUD));
                CRUDControllerManager.Instance.GetCRUDChildControllerManager().SetChildControllers(result);

                result.ShowGrid();

                break;
            }

            case "Pendientes":
            {
                FacturasBL = BusinessLogicFactory.GetBusinessLogicInstance(db, typeof(ComprobantesBL)) as ComprobantesBL;
                //FacturasBL.SetTipoFilter(TiposComprobantesList.Factura);
                List <TiposComprobantesList> tipos = new List <TiposComprobantesList>();
                tipos.Add(TiposComprobantesList.Factura);
                tipos.Add(TiposComprobantesList.NotaCredito);
                tipos.Add(TiposComprobantesList.NotaDebito);
                FacturasBL.SetTiposFilter(tipos);
                FacturasBL.SetEstadoFilter(Comprobantes.EstadoPendiente);
                result = new CRUDComprobantesController(FacturasBL, "Pendientes", "Facturas", typeof(ComprobantesCRUD));
                CRUDControllerManager.Instance.GetCRUDChildControllerManager().SetChildControllers(result);

                result.ShowGrid();

                break;
            }

            case "EmitirComprobante":
            {
                Thread thrdStatus = new Thread(new ParameterizedThreadStart(Status.CheckStatus));
                thrdStatus.IsBackground = true;
                thrdStatus.Start(this);

                FacturasBL = BusinessLogicFactory.GetBusinessLogicInstance(db, typeof(ComprobantesBL)) as ComprobantesBL;
                FacturasBL.SetTipoFilter(TiposComprobantesList.Factura);
                result = new CRUDComprobantesController(FacturasBL, "Facturas", "Facturas", typeof(ComprobantesCRUD));
                CRUDControllerManager.Instance.GetCRUDChildControllerManager().SetChildControllers(result);

                result.ShowCRUDForm();
                break;
            }

            case "NotaCredito":
            {
                FacturasBL = BusinessLogicFactory.GetBusinessLogicInstance(db, typeof(ComprobantesBL)) as ComprobantesBL;
                FacturasBL.SetTipoFilter(TiposComprobantesList.NotaCredito);
                result = new CRUDComprobantesController(FacturasBL, "Notas de Crédito", "Notas de Crédito", typeof(ComprobantesCRUD));
                CRUDControllerManager.Instance.GetCRUDChildControllerManager().SetChildControllers(result);
                result.ShowGrid();
                break;
            }

            case "NotaDebito":
            {
                FacturasBL = BusinessLogicFactory.GetBusinessLogicInstance(db, typeof(ComprobantesBL)) as ComprobantesBL;
                FacturasBL.SetTipoFilter(TiposComprobantesList.NotaDebito);
                result = new CRUDComprobantesController(FacturasBL, "Notas de Débito", "Notas de Débito", typeof(ComprobantesCRUD));
                CRUDControllerManager.Instance.GetCRUDChildControllerManager().SetChildControllers(result);
                result.ShowGrid();
                break;
            }
            }
        }