예제 #1
0
 public List <ReporteServiciosRealizados> ObtenerReporteServiciosRealizados(string Conexion, DateTime FechaInicio, DateTime FechaFin)
 {
     try
     {
         Reporte_Datos Datos = new Reporte_Datos();
         return(Datos.ObtenerReporteServiciosRealizados(Conexion, FechaInicio, FechaFin));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #2
0
 public int GenerarReporteEstadoResultados(string Conexion, EstadoResultados _Datos, string IDUsuario)
 {
     try
     {
         Reporte_Datos Datos = new Reporte_Datos();
         return(Datos.GenerarReporteEstadoResultados(Conexion, _Datos, IDUsuario));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #3
0
 public EstadoResultados ObtenerDetalleEstadoResultados(string Conexion, int IDReporte)
 {
     try
     {
         Reporte_Datos Datos = new Reporte_Datos();
         return(Datos.ObtenerDetalleEstadoResultados(Conexion, IDReporte));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #4
0
 public List <EstadoResultados> ObtenerGridReporteER(string Conexion, int IDMes, int Anio)
 {
     try
     {
         Reporte_Datos Datos = new Reporte_Datos();
         return(Datos.ObtenerGridReporteER(Conexion, IDMes, Anio));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #5
0
 public List <ReporteTrabajosRealizados> ObtenerReportesTrabajosRealizados(string Conexion)
 {
     try
     {
         Reporte_Datos Datos = new Reporte_Datos();
         return(Datos.ObtenerReporteTrabajosRealizados(Conexion));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #6
0
 //
 public List <ReporteMobiliarioXSucursal> ObtenerReporteMobiliarioAsignadoPorSucursal(string Conexion, string IDSucursal)
 {
     try
     {
         Reporte_Datos Datos = new Reporte_Datos();
         return(Datos.ObtenerReporteMobiliarioAsignadoPorSucursal(Conexion, IDSucursal));
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #7
0
 /// <summary>
 /// Obtiene el reporte del promedio del tiempo de los servicios
 /// </summary>
 /// <param name="Conexion"></param>
 /// <returns></returns>
 public List <ReporteTiempoServicios> ObtenerReporteTiempoServicio()
 {
     try
     {
         Reporte_Datos Datos1 = new Reporte_Datos();
         return(Datos1.ObtenerReporteTiempoServicio(Comun.Conexion));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #8
0
 public ReporteTrabajosRealizados ObtenerDetalleReporteTrabajosRealizados(string Conexion, int IDReporte)
 {
     try
     {
         Reporte_Datos Datos = new Reporte_Datos();
         return(Datos.ObtenerDetalleReporteTrabajosRealizados(Conexion, IDReporte));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #9
0
 public object[] ObtenerReporteMaterialesProduccion(Sucursal _datos)
 {
     try
     {
         Reporte_Datos repDatos = new Reporte_Datos();
         return(repDatos.ObtenerReporteMaterialesProduccion(_datos));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #10
0
 /// <summary>
 /// Obtiene el reporte de Porductos Vendidos por Fecha
 /// </summary>
 /// <param name="Conexion"></param>
 /// <param name="Fecha"></param>
 /// <returns></returns>
 public List <ReporteProductosVendidos> ObtenerReportesProductosVendidos(string Conexion, DateTime Fecha)
 {
     try
     {
         Reporte_Datos Datos = new Reporte_Datos();
         return(Datos.ObtenerReportesProductosVendidos(Conexion, Fecha));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #11
0
 public List <Mes> ObtenerComboMeses(string Conexion)
 {
     try
     {
         try
         {
             Reporte_Datos Datos = new Reporte_Datos();
             return(Datos.ObtenerComboMeses(Conexion));
         }
         catch (Exception ex)
         {
             throw ex;
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #12
0
        public ActionResult ReporteCajaChica(Int64 id)
        {
            try
            {
                _CajaChica_Datos       datos = new _CajaChica_Datos();
                Reporte_Datos          R     = new Reporte_Datos();
                ReporteCajaChica       model = datos.ObtenerDatosReporteCajaChica(id);
                DatosEmpresaViewModels x     = R.ObtenerDatosEmpresaGeneral(_ConexionRepositorio.CadenaConexion);
                LocalReport            Rtp   = new LocalReport
                {
                    EnableExternalImages = true
                };
                Rtp.DataSources.Clear();
                string path = Path.Combine(Server.MapPath("~/Reports"), "ReporteCajaChica.rdlc");
                if (System.IO.File.Exists(path))
                {
                    Rtp.ReportPath = path;
                }
                else
                {
                    return(RedirectToAction("Index", "HistorialCajaChica"));
                }
                ReportParameter[] Parametros = new ReportParameter[6];
                Parametros[0] = new ReportParameter("Empresa", x.RazonFiscal);
                Parametros[1] = new ReportParameter("RFC", x.RFC);
                Parametros[2] = new ReportParameter("Direccion", x.DireccionFiscal);
                Parametros[3] = new ReportParameter("Telefono", x.NumTelefonico1);
                Parametros[4] = new ReportParameter("TelefonoMovil", x.NumTelefonico2);
                Parametros[5] = new ReportParameter("UrlLogo", x.LogoEmpresa);

                Rtp.SetParameters(Parametros);
                Rtp.DataSources.Add(new ReportDataSource("Movimientos", model.ListaMovimientos));
                Rtp.DataSources.Add(new ReportDataSource("Arqueo", model.ListaDenominaciones));
                Rtp.DataSources.Add(new ReportDataSource("Conceptos", model.ListaConceptos));
                Rtp.DataSources.Add(new ReportDataSource("MovimientosCheque", model.ListaMovimientosCheque));
                string reportType = "PDF";
                string mimeType;
                string encoding;
                string fileNameExtension;

                string deviceInfo = "<DeviceInfo>" +
                                    "  <OutputFormat>" + reportType + "</OutputFormat>" +
                                    "</DeviceInfo>";

                Warning[] warnings;
                string[]  streams;
                byte[]    renderedBytes;

                renderedBytes = Rtp.Render(
                    reportType,
                    deviceInfo,
                    out mimeType,
                    out encoding,
                    out fileNameExtension,
                    out streams,
                    out warnings);

                return(File(renderedBytes, mimeType));
            }
            catch (Exception ex)
            {
                return(RedirectToAction("Index", "HistorialCajaChica"));
            }
        }
        public ActionResult ReporteExcel()
        {
            try
            {
                //Cabecera
                Reporte_Datos     R            = new Reporte_Datos();
                CatEmpresaModels  Empresa      = new CatEmpresaModels();
                _CatEmpresa_Datos EmpresaDatos = new _CatEmpresa_Datos();
                Empresa.Conexion = Conexion;
                Empresa          = EmpresaDatos.GetDatosEmpresaPrincipal(Empresa);

                //Lista
                DocumentoPorPagarModels Documentos      = new DocumentoPorPagarModels();
                DocumentoXPagar_Datos   DocumentosDatos = new DocumentoXPagar_Datos();
                Documentos.Conexion        = Conexion;
                Documentos.ListaDocumentos = DocumentosDatos.ObtenerListaDocumentosPagar(Documentos);

                for (int i = 0; i < Documentos.ListaDocumentos.Count; i++)
                {
                    Documentos.ListaDocumentos[i].TotalString     = Auxiliar.StringToMoneda_MX(Documentos.ListaDocumentos[i].Total.ToString());
                    Documentos.ListaDocumentos[i].PagadoString    = Auxiliar.StringToMoneda_MX(Documentos.ListaDocumentos[i].MontoPagado.ToString());
                    Documentos.ListaDocumentos[i].PendienteString = Auxiliar.StringToMoneda_MX(Documentos.ListaDocumentos[i].Pendientes.ToString());
                }

                LocalReport Rtp = new LocalReport();
                Rtp.EnableExternalImages = true;
                Rtp.DataSources.Clear();
                string path = Path.Combine(Server.MapPath("~/Formatos"), "ConcentradoDocumentosPorPagar.rdlc");
                if (System.IO.File.Exists(path))
                {
                    Rtp.ReportPath = path;
                }
                else
                {
                    return(RedirectToAction("Index"));
                }

                string GeneralesEmpresa = "<b>Representante: </b>" + Empresa.Representante + "<br/>";
                GeneralesEmpresa += "<b>RFC: </b>" + Empresa.RFC + "<br/>";
                GeneralesEmpresa += "<b>Horario de atención: </b>" + Empresa.HorarioAtencion + "<br/>";
                string Telefonos = string.IsNullOrEmpty(Empresa.NumTelefonico1) ? string.Empty : Empresa.NumTelefonico1;
                Telefonos += string.IsNullOrEmpty(Empresa.NumTelefonico2) ? string.Empty : " " + Empresa.NumTelefonico1;
                if (!string.IsNullOrEmpty(Telefonos))
                {
                    GeneralesEmpresa += "<b>Teléfono(s): </b>" + Telefonos + "<br/>";
                }
                if (!string.IsNullOrEmpty(Empresa.Email))
                {
                    GeneralesEmpresa += "<b>Email: </b>" + Empresa.Email;
                }

                ReportParameter[] Parametros = new ReportParameter[4];
                Parametros[0] = new ReportParameter("LogoEmpresa", Empresa.LogoEmpresa);
                Parametros[1] = new ReportParameter("NombreEmpresa", Empresa.RazonFiscal);
                Parametros[2] = new ReportParameter("DireccionEmpresa", Empresa.DireccionFiscal);
                Parametros[3] = new ReportParameter("GeneralesEmpresa", GeneralesEmpresa);


                Rtp.SetParameters(Parametros);
                Documentos.ListaDocumentos = Documentos.ListaDocumentos.OrderByDescending(x => x.Fecha).ToList();
                Rtp.DataSources.Add(new ReportDataSource("Lista", Documentos.ListaDocumentos));
                Rtp.Refresh();

                string reportType = "EXCEL";
                string mimeType;
                string encoding;
                string fileNameExtension;

                string deviceInfo = "<DeviceInfo>" +
                                    "  <OutputFormat>" + "Documentos por pagar" + "</OutputFormat>" +
                                    "</DeviceInfo>";

                Warning[] warnings;
                string[]  streams;
                byte[]    renderedBytes;

                renderedBytes = Rtp.Render(
                    reportType,
                    deviceInfo,
                    out mimeType,
                    out encoding,
                    out fileNameExtension,
                    out streams,
                    out warnings);

                return(File(renderedBytes, mimeType));
            }
            catch (Exception ex)
            {
                string Mensaje = ex.Message.Replace("\r\n", "").Replace("\r", "").Replace("\n", "");
                TempData["typemessage"] = "2";
                TempData["message"]     = "No se puede cargar la vista, error: " + Mensaje;
                return(View("Index"));
            }
        }
        public ActionResult Comprobante(int?id)
        {
            try
            {
                if (id == null)
                {
                    TempData["typemessage"] = "2";
                    TempData["message"]     = "Verifique sus datos";
                    return(View("Index"));
                }

                Reporte_Datos R = new Reporte_Datos();
                List <ComprobantePagosModels> ListaComprobantePagosDetalles          = new List <ComprobantePagosModels>();
                List <VentaGeneralComprobanteDetalleModels> ListaComprobanteDetalles = new List <VentaGeneralComprobanteDetalleModels>();

                _Comprobante_Datos        oDatosComprobante  = new _Comprobante_Datos();
                _VentaGeneral_Datos       oDatosVentaGeneral = new _VentaGeneral_Datos();
                ComprobanteCabeceraModels Cabecera           = new ComprobanteCabeceraModels();

                Cabecera = oDatosComprobante.Comprobante_spCSLDB_get_Cabecera(2, id.Value.ToString(), conexion);
                ListaComprobantePagosDetalles = oDatosComprobante.Comprobante_spCIDDB_get_detallesPagos(2, id.Value.ToString(), conexion);
                ListaComprobanteDetalles      = oDatosVentaGeneral.VentaGeneral_spCIDDB_Comprobante_get_detalles(conexion, id.Value);

                LocalReport Rtp = new LocalReport();
                Rtp.EnableExternalImages = true;
                Rtp.DataSources.Clear();
                string path = Path.Combine(Server.MapPath("~/Formatos"), "ComprobanteVentaGeneral.rdlc");
                if (System.IO.File.Exists(path))
                {
                    Rtp.ReportPath = path;
                }
                else
                {
                    return(RedirectToAction("Index"));
                }
                ReportParameter[] Parametros = new ReportParameter[11];
                Parametros[0]  = new ReportParameter("urlLogo", Cabecera.LogoEmpresa);
                Parametros[1]  = new ReportParameter("nombreEmpresa", Cabecera.NombreEmpresa);
                Parametros[2]  = new ReportParameter("rubroEmpresa", Cabecera.RubroEmpresa);
                Parametros[3]  = new ReportParameter("direccionEmpresa", Cabecera.DireccionEmpresa);
                Parametros[4]  = new ReportParameter("folio", Cabecera.Folio);
                Parametros[5]  = new ReportParameter("nombreCliente", Cabecera.NombreCliente);
                Parametros[6]  = new ReportParameter("telefonoCliente", Cabecera.TelefonoCliente);
                Parametros[7]  = new ReportParameter("rfcCliente", Cabecera.RFCCliente);
                Parametros[8]  = new ReportParameter("diaImpresion", Cabecera.DiaImpresion);
                Parametros[9]  = new ReportParameter("mesImpresion", Cabecera.MesImpresion);
                Parametros[10] = new ReportParameter("annoImpresion", Cabecera.AnnoImpresion);

                Rtp.SetParameters(Parametros);
                Rtp.DataSources.Add(new ReportDataSource("ListaDetalles", ListaComprobanteDetalles));
                Rtp.DataSources.Add(new ReportDataSource("ListaDetallesCobros", ListaComprobantePagosDetalles));

                string reportType = "PDF";
                string mimeType;
                string encoding;
                string fileNameExtension;

                string deviceInfo = "<DeviceInfo>" +
                                    "  <OutputFormat>Comprobante</OutputFormat>" +
                                    "</DeviceInfo>";

                Warning[] warnings;
                string[]  streams;
                byte[]    renderedBytes;

                renderedBytes = Rtp.Render(
                    reportType,
                    deviceInfo,
                    out mimeType,
                    out encoding,
                    out fileNameExtension,
                    out streams,
                    out warnings);

                return(File(renderedBytes, mimeType));
            }
            catch (Exception ex)
            {
                string Mensaje = ex.Message.Replace("\r\n", "").Replace("\r", "").Replace("\n", "");
                TempData["typemessage"] = "2";
                TempData["message"]     = "No se puede cargar la vista, error: " + Mensaje;
                return(View("Index"));
            }
        }