コード例 #1
0
        public ActionResult BAN_008()
        {
            int IdEmpresa = Convert.ToInt32(SessionFixed.IdEmpresa);
            cl_filtros_banco_Info model = new cl_filtros_banco_Info
            {
                IdEmpresa  = IdEmpresa,
                IdSucursal = Convert.ToInt32(SessionFixed.IdSucursal)
            };

            cargar_banco(model.IdEmpresa);
            BAN_008_Rpt report = new BAN_008_Rpt();

            #region Cargo diseño desde base
            var reporte = bus_rep_x_emp.GetInfo(IdEmpresa, "BAN_008");
            if (reporte != null)
            {
                System.IO.File.WriteAllBytes(RootReporte, reporte.ReporteDisenio);
                report.LoadLayout(RootReporte);
            }
            #endregion
            report.p_IdEmpresa.Value  = model.IdEmpresa;
            report.p_IdSucursal.Value = model.IdSucursal;
            report.p_fecha_ini.Value  = model.fecha_ini;
            report.p_fecha_fin.Value  = model.fecha_fin;
            report.usuario            = SessionFixed.IdUsuario.ToString();
            report.empresa            = SessionFixed.NomEmpresa.ToString();
            ViewBag.Report            = report;
            return(View(model));
        }
コード例 #2
0
        public ActionResult FAC_003(int IdSucursal = 0, int IdBodega = 0, decimal IdCbteVta = 0)
        {
            FAC_003_Rpt model     = new FAC_003_Rpt();
            int         IdEmpresa = Convert.ToInt32(SessionFixed.IdEmpresa);

            #region Cargo diseño desde base
            var reporte = bus_rep_x_emp.GetInfo(IdEmpresa, "FAC_003");
            if (reporte != null)
            {
                System.IO.File.WriteAllBytes(RootReporte, reporte.ReporteDisenio);
                model.LoadLayout(RootReporte);
            }
            #endregion

            model.p_IdEmpresa.Value      = IdEmpresa;
            model.p_IdBodega.Value       = IdBodega;
            model.p_IdSucursal.Value     = IdSucursal;
            model.p_IdCbteVta.Value      = IdCbteVta;
            model.p_mostrar_cuotas.Value = bus_factura.MostrarCuotasRpt(IdEmpresa, IdSucursal, IdBodega, IdCbteVta);
            model.RequestParameters      = false;
            model.DefaultPrinterSettingsUsing.UsePaperKind = false;
            //bus_factura.modificarEstadoImpresion(Convert.ToInt32(SessionFixed.IdEmpresa), IdSucursal, IdBodega, IdCbteVta, true);


            return(View(model));
        }
コード例 #3
0
        public ActionResult CAJ_001(int IdTipoCbte = 0, decimal IdCbteCble = 0)
        {
            CAJ_001_Rpt model = new CAJ_001_Rpt();

            #region Cargo diseño desde base
            int IdEmpresa = Convert.ToInt32(SessionFixed.IdEmpresa);
            var reporte   = bus_rep_x_emp.GetInfo(IdEmpresa, "CAJ_001");
            if (reporte != null)
            {
                System.IO.File.WriteAllBytes(RootReporte, reporte.ReporteDisenio);
                model.LoadLayout(RootReporte);
            }
            #endregion
            model.p_IdEmpresa.Value  = Convert.ToInt32(SessionFixed.IdEmpresa);
            model.p_IdTipoCbte.Value = IdTipoCbte;
            model.p_IdCbteCble.Value = IdCbteCble;
            model.usuario            = SessionFixed.IdUsuario.ToString();
            model.empresa            = SessionFixed.NomEmpresa.ToString();
            return(View(model));
        }
コード例 #4
0
        public ActionResult ACTF_001(decimal Id_Mejora_Baja_Activo = 0, string Id_Tipo = "")
        {
            ACTF_001_Rpt model = new ACTF_001_Rpt();

            #region Cargo diseño desde base
            int IdEmpresa = Convert.ToInt32(SessionFixed.IdEmpresa);
            var reporte   = bus_rep_x_emp.GetInfo(IdEmpresa, "ACTF_001");
            if (reporte != null)
            {
                System.IO.File.WriteAllBytes(RootReporte, reporte.ReporteDisenio);
                model.LoadLayout(RootReporte);
            }
            #endregion

            model.p_IdEmpresa.Value             = Convert.ToInt32(SessionFixed.IdEmpresa);
            model.p_Id_Mejora_Baja_Activo.Value = Id_Mejora_Baja_Activo;
            model.p_Id_Tipo.Value = Id_Tipo;
            model.usuario         = SessionFixed.IdUsuario.ToString();
            model.empresa         = SessionFixed.NomEmpresa.ToString();
            return(View(model));
        }
コード例 #5
0
        public ActionResult CXP_012(decimal IdRetencion = 0)
        {
            CXP_012_Rpt model     = new CXP_012_Rpt();
            int         IdEmpresa = Convert.ToInt32(SessionFixed.IdEmpresa);

            #region Cargo diseño desde base
            var reporte = bus_rep_x_emp.GetInfo(IdEmpresa, "CXP_012");
            if (reporte != null)
            {
                System.IO.File.WriteAllBytes(RootReporte, reporte.ReporteDisenio);
                model.LoadLayout(RootReporte);
            }
            #endregion

            model.p_IdEmpresa.Value   = SessionFixed.IdEmpresa;
            model.p_IdRetencion.Value = IdRetencion;
            model.RequestParameters   = false;
            model.DefaultPrinterSettingsUsing.UsePaperKind = false;

            return(View(model));
        }
コード例 #6
0
        public ActionResult Disenar(int IdEmpresa = 0, string CodReporte = "")
        {
            var reporte = bus_reporte.get_info(CodReporte);
            var model   = bus_reporte_x_emp.GetInfo(IdEmpresa, CodReporte);

            XtraReport rpt = GetReport(reporte.Nom_Carpeta + "." + reporte.rpt_clase_rpt);

            if (model == null)
            {
                MemoryStream ms = new MemoryStream();
                rpt.SaveLayoutToXml(ms);
                ms.Position = 0;
                model       = new tb_sis_reporte_x_tb_empresa_Info
                {
                    IdEmpresa      = IdEmpresa,
                    CodReporte     = CodReporte,
                    ReporteDisenio = ms.ToArray()
                };
            }

            return(View(model));
        }
コード例 #7
0
        public ActionResult FAC_001()
        {
            cl_filtros_facturacion_Info model = new cl_filtros_facturacion_Info
            {
                IdEmpresa  = Convert.ToInt32(SessionFixed.IdEmpresa),
                IdSucursal = Convert.ToInt32(SessionFixed.IdSucursal),
                IdCliente  = 0,
                IdProducto = 0,
                Check1     = false
            };

            cargar_combos(model);
            FAC_001_Rpt report = new FAC_001_Rpt();

            #region Cargo diseño desde base
            int IdEmpresa = Convert.ToInt32(SessionFixed.IdEmpresa);
            var reporte   = bus_rep_x_emp.GetInfo(IdEmpresa, "FAC_001");
            if (reporte != null)
            {
                System.IO.File.WriteAllBytes(RootReporte, reporte.ReporteDisenio);
                report.LoadLayout(RootReporte);
            }
            #endregion
            report.p_IdEmpresa.Value        = model.IdEmpresa;
            report.p_fecha_ini.Value        = model.fecha_ini;
            report.p_fecha_fin.Value        = model.fecha_fin;
            report.p_IdSucursal.Value       = model.IdSucursal;
            report.p_IdCliente.Value        = model.IdCliente;
            report.p_IdVendedor.Value       = model.IdVendedor;
            report.p_IdProducto.Value       = model.IdProducto;
            report.p_mostrar_anulados.Value = model.Check1;
            report.usuario = SessionFixed.IdUsuario;
            report.empresa = SessionFixed.NomEmpresa;
            ViewBag.Report = report;
            return(View(model));
        }
コード例 #8
0
        private void OnTimedEvent(object sender, ElapsedEventArgs e)
        {
            #region Variables
            tb_sis_reporte_x_tb_empresa_Bus bus_rep_x_emp     = new tb_sis_reporte_x_tb_empresa_Bus();
            tb_ColaImpresionDirecta_Bus     bus_colaImpresion = new tb_ColaImpresionDirecta_Bus();
            string  RootReporte = System.IO.Path.GetTempPath() + "Rpt_Facturacion.repx";
            string  IPLocal     = string.Empty;
            int     IdSucursal  = 0;
            int     IdBodega    = 0;
            decimal IdCbteVta   = 0;
            #endregion

            #region GetIPAdress

            var host = Dns.GetHostEntry(Dns.GetHostName());
            foreach (var ip in host.AddressList)
            {
                if (ip.AddressFamily == AddressFamily.InterNetwork)
                {
                    IPLocal = ip.ToString();
                }
            }
            #endregion

            #region GetImpresion
            var Impresion = bus_colaImpresion.GetInfoPorImprimir(IPLocal);
            if (Impresion == null)
            {
                return;
            }

            bus_colaImpresion.ModificarDB(Impresion);
            #endregion

            try
            {
                var reporte = bus_rep_x_emp.GetInfo(Impresion.IdEmpresa, Impresion.CodReporte);
                if (!string.IsNullOrEmpty(Impresion.Parametros))
                {
                    string[] array = Impresion.Parametros.Split(',');
                    if (array.Count() > 2)
                    {
                        IdSucursal = Convert.ToInt32(array[0]);
                        IdBodega   = Convert.ToInt32(array[1]);
                        IdCbteVta  = Convert.ToDecimal(array[2]);
                    }
                }
                #region


                switch (Impresion.CodReporte)
                {
                case "FAC_003":
                    FAC_003_Rpt RPT_003 = new FAC_003_Rpt();

                    #region Cargo diseño desde base
                    if (reporte != null)
                    {
                        System.IO.File.WriteAllBytes(RootReporte, reporte.ReporteDisenio);
                        RPT_003.LoadLayout(RootReporte);
                    }
                    #endregion

                    #region Parametros
                    if (!string.IsNullOrEmpty(Impresion.Parametros))
                    {
                        RPT_003.p_IdEmpresa.Value      = Impresion.IdEmpresa;
                        RPT_003.p_IdBodega.Value       = IdBodega;
                        RPT_003.p_IdSucursal.Value     = IdSucursal;
                        RPT_003.p_IdCbteVta.Value      = IdCbteVta;
                        RPT_003.p_mostrar_cuotas.Value = false;
                        RPT_003.PrinterName            = Impresion.IPImpresora;
                        RPT_003.CreateDocument();
                    }
                    #endregion

                    PrintToolBase tool003 = new PrintToolBase(RPT_003.PrintingSystem);
                    for (int i = 0; i < Impresion.NumCopias; i++)
                    {
                        if (string.IsNullOrEmpty(Impresion.IPImpresora))
                        {
                            tool003.Print();
                        }
                        else
                        {
                            tool003.Print(Impresion.IPImpresora);
                        }
                    }
                    break;

                case "FAC_013":
                    FAC_013_Rpt RPT_013 = new FAC_013_Rpt();

                    #region Cargo diseño desde base
                    if (reporte != null)
                    {
                        System.IO.File.WriteAllBytes(RootReporte, reporte.ReporteDisenio);
                        RPT_013.LoadLayout(RootReporte);
                    }
                    #endregion

                    #region Parametros
                    if (!string.IsNullOrEmpty(Impresion.Parametros))
                    {
                        RPT_013.p_IdEmpresa.Value  = Impresion.IdEmpresa;
                        RPT_013.p_IdBodega.Value   = IdBodega;
                        RPT_013.p_IdSucursal.Value = IdSucursal;
                        RPT_013.p_IdCbteVta.Value  = IdCbteVta;
                        RPT_013.PrinterName        = Impresion.IPImpresora;
                        RPT_013.CreateDocument();
                    }
                    #endregion
                    PrintToolBase tool013 = new PrintToolBase(RPT_013.PrintingSystem);
                    for (int i = 0; i < Impresion.NumCopias; i++)
                    {
                        if (string.IsNullOrEmpty(Impresion.IPImpresora))
                        {
                            tool013.Print();
                        }
                        else
                        {
                            tool013.Print(Impresion.IPImpresora);
                        }
                    }
                    break;
                }
                #endregion
                bus_colaImpresion.ModificarDB(Impresion);
            }
            catch (Exception ex)
            {
                Impresion.Comentario = ex.Message.ToString();
                bus_colaImpresion.ModificarDB(Impresion);
            }
        }