public IMDResponse <EntReporteVenta> CReporteGlobalVentas([FromUri] string psFolio               = null,
                                                                  [FromUri] string psIdEmpresa           = null, [FromUri] string psIdProducto    = null,
                                                                  [FromUri] string psIdTipoProducto      = null, [FromUri] string psIdOrigen      = null,
                                                                  [FromUri] string psOrderId             = null, [FromUri] string psStatus        = null, [FromUri] string psCupon = null, [FromUri] string psTipoPago = null,
                                                                  [FromUri] DateTime?pdtFechaInicio      = null, [FromUri] DateTime?pdtFechaFinal = null,
                                                                  [FromUri] DateTime?pdtFechaVencimiento = null)
        {
            IMDResponse <EntReporteVenta> response = new IMDResponse <EntReporteVenta>();

            string metodo = nameof(this.CReporteGlobalVentas);

            logger.Info(IMDSerialize.Serialize(67823458599211, $"Inicia {metodo}([FromUri]string psFolio = null, [FromUri]string psIdEmpresa = null, [FromUri]string psIdProducto = null, [FromUri]string psIdTipoProducto = null, [FromUri]string psIdOrigen = null, [FromUri]string psOrderId = null, [FromUri]string psStatus = null,[FromUri]string psCupon = null, [FromUri]DateTime ? pdtFechaInicio = null, [FromUri]DateTime ? pdtFechaFinal = null, [FromUri]DateTime ? pdtFechaVencimiento = null)", psFolio, psIdEmpresa, psIdProducto, psIdTipoProducto, psIdOrigen, psOrderId, psStatus, psCupon, pdtFechaInicio, pdtFechaFinal, pdtFechaVencimiento));

            try
            {
                BusReportes busReportes = new BusReportes();
                response = busReportes.BReporteGlobalVentas(psFolio, psIdEmpresa, psIdProducto, psIdTipoProducto, psIdOrigen, psOrderId, psStatus, psCupon, psTipoPago, pdtFechaInicio, pdtFechaFinal, pdtFechaVencimiento);
            }
            catch (Exception ex)
            {
                response.Code    = 67823458599988;
                response.Message = "Ocurrió un error inesperado al consultar los folios del reporte en la base de datos.";

                logger.Error(IMDSerialize.Serialize(67823458599988, $"Error en {metodo}([FromUri]string psFolio = null, [FromUri]string psIdEmpresa = null, [FromUri]string psIdProducto = null, [FromUri]string psIdTipoProducto = null, [FromUri]string psIdOrigen = null, [FromUri]string psOrderId = null, [FromUri]string psStatus = null,[FromUri]string psCupon = null, [FromUri]DateTime ? pdtFechaInicio = null, [FromUri]DateTime ? pdtFechaFinal = null, [FromUri]DateTime ? pdtFechaVencimiento = null): {ex.Message}", psFolio, psIdEmpresa, psIdProducto, psIdTipoProducto, psIdOrigen, psOrderId, psStatus, psCupon, pdtFechaInicio, pdtFechaFinal, pdtFechaVencimiento, ex, response));
            }
            return(response);
        }
        public HttpResponseMessage CDescargarReporteDoctores([FromUri] string psIdColaborador            = null, [FromUri] string psColaborador       = null, [FromUri] string psIdTipoDoctor = null, [FromUri] string psIdEspecialidad = null,
                                                             [FromUri] string psIdConsulta               = null, [FromUri] string psIdEstatusConsulta = null, [FromUri] string psRFC          = null, [FromUri] string psNumSala = null,
                                                             [FromUri] DateTime?pdtFechaProgramadaInicio = null, [FromUri] DateTime?pdtFechaProgramadaFinal = null, [FromUri] DateTime?pdtFechaConsultaInicio = null, [FromUri] DateTime?pdtFechaConsultaFin = null)
        {
            HttpResponseMessage response;

            string metodo = nameof(this.CDescargarReporteDoctores);

            logger.Info(IMDSerialize.Serialize(67823458575901, $"Inicia {metodo}([FromUri]string psIdColaborador = null, [FromUri]string psColaborador = null, [FromUri]string psIdTipoDoctor = null, [FromUri]string psIdEspecialidad = null, [FromUri]string psIdConsulta = null, [FromUri]string psIdEstatusConsulta = null, [FromUri]string psRFC = null, [FromUri]string psNumSala = null, [FromUri]DateTime ? pdtFechaProgramadaInicio = null, [FromUri]DateTime ? pdtFechaProgramadaFinal = null, [FromUri]DateTime ? pdtFechaConsultaInicio = null, [FromUri]DateTime ? pdtFechaConsultaFin = null)", psIdColaborador, psColaborador, psIdTipoDoctor, psIdEspecialidad, psIdConsulta, psIdEstatusConsulta, psRFC, psNumSala, pdtFechaProgramadaInicio, pdtFechaProgramadaFinal, pdtFechaConsultaInicio, pdtFechaConsultaFin));

            try
            {
                BusReportes busReportes             = new BusReportes();
                IMDResponse <MemoryStream> resExcel = busReportes.BDescargarReporteDoctores(psIdColaborador, psColaborador, psIdTipoDoctor, psIdEspecialidad, psIdConsulta, psIdEstatusConsulta, psRFC, psNumSala, pdtFechaProgramadaInicio, pdtFechaProgramadaFinal, pdtFechaConsultaInicio, pdtFechaConsultaFin);
                if (resExcel.Code != 0)
                {
                    response = Request.CreateResponse(HttpStatusCode.InternalServerError, resExcel.Message);
                }
                else
                {
                    response         = Request.CreateResponse(HttpStatusCode.OK);
                    response.Content = new StreamContent(resExcel.Result);
                    response.Content.Headers.ContentDisposition          = new ContentDispositionHeaderValue("attachment");
                    response.Content.Headers.ContentDisposition.FileName = "ReporteDoctores.xlsx";
                    response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
                }
            }
            catch (Exception ex)
            {
                response = Request.CreateResponse(HttpStatusCode.InternalServerError, "No se pudo generar el reporte de doctores.");

                logger.Error(IMDSerialize.Serialize(67823458576678, $"Error en {metodo}([FromUri]string psIdColaborador = null, [FromUri]string psColaborador = null, [FromUri]string psIdTipoDoctor = null, [FromUri]string psIdEspecialidad = null, [FromUri]string psIdConsulta = null, [FromUri]string psIdEstatusConsulta = null, [FromUri]string psRFC = null, [FromUri]string psNumSala = null, [FromUri]DateTime ? pdtFechaProgramadaInicio = null, [FromUri]DateTime ? pdtFechaProgramadaFinal = null, [FromUri]DateTime ? pdtFechaConsultaInicio = null, [FromUri]DateTime ? pdtFechaConsultaFin = null): {ex.Message}", psIdColaborador, psColaborador, psIdTipoDoctor, psIdEspecialidad, psIdConsulta, psIdEstatusConsulta, psRFC, psNumSala, pdtFechaProgramadaInicio, pdtFechaProgramadaFinal, pdtFechaConsultaInicio, pdtFechaConsultaFin, ex, response));
            }
            return(response);
        }
        public IMDResponse <EntReporteDoctores> CObtenerReporteDoctores(
            [FromUri] string psIdColaborador            = null, [FromUri] string psColaborador       = null, [FromUri] string psIdTipoDoctor = null, [FromUri] string psIdEspecialidad = null,
            [FromUri] string psIdConsulta               = null, [FromUri] string psIdEstatusConsulta = null, [FromUri] string psRFC          = null, [FromUri] string psNumSala = null,
            [FromUri] DateTime?pdtFechaProgramadaInicio = null, [FromUri] DateTime?pdtFechaProgramadaFinal = null, [FromUri] DateTime?pdtFechaConsultaInicio = null, [FromUri] DateTime?pdtFechaConsultaFin = null)
        {
            IMDResponse <EntReporteDoctores> response = new IMDResponse <EntReporteDoctores>();

            string metodo = nameof(this.CObtenerReporteDoctores);

            logger.Info(IMDSerialize.Serialize(67823458574347, $"Inicia {metodo}([FromUri]string psIdColaborador = null, [FromUri]string psColaborador = null, [FromUri]string psIdTipoDoctor = null, [FromUri]string psIdEspecialidad = null, [FromUri]string psIdConsulta = null, [FromUri]string psIdEstatusConsulta = null, [FromUri]string psRFC = null, [FromUri]string psNumSala = null, [FromUri]DateTime ? pdtFechaProgramadaInicio = null, [FromUri]DateTime ? pdtFechaProgramadaFinal = null, [FromUri]DateTime ? pdtFechaConsultaInicio = null, [FromUri]DateTime ? pdtFechaConsultaFin = null)", psIdColaborador, psColaborador, psIdTipoDoctor, psIdEspecialidad, psIdConsulta, psIdEstatusConsulta, psRFC, psNumSala, pdtFechaProgramadaInicio, pdtFechaProgramadaFinal, pdtFechaConsultaInicio, pdtFechaConsultaFin));

            try
            {
                BusReportes busReportes = new BusReportes();
                response = busReportes.BObtenerReporteDoctores(psIdColaborador, psColaborador, psIdTipoDoctor, psIdEspecialidad, psIdConsulta, psIdEstatusConsulta, psRFC, psNumSala, pdtFechaProgramadaInicio, pdtFechaProgramadaFinal, pdtFechaConsultaInicio, pdtFechaConsultaFin);
            }
            catch (Exception ex)
            {
                response.Code    = 67823458575124;
                response.Message = "Ocurrió un error inesperado al consultar la información de doctores para el reporte en la base de datos.";

                logger.Error(IMDSerialize.Serialize(67823458575124, $"Error en {metodo}([FromUri]string psIdColaborador = null, [FromUri]string psColaborador = null, [FromUri]string psIdTipoDoctor = null, [FromUri]string psIdEspecialidad = null, [FromUri]string psIdConsulta = null, [FromUri]string psIdEstatusConsulta = null, [FromUri]string psRFC = null, [FromUri]string psNumSala = null, [FromUri]DateTime ? pdtFechaProgramadaInicio = null, [FromUri]DateTime ? pdtFechaProgramadaFinal = null, [FromUri]DateTime ? pdtFechaConsultaInicio = null, [FromUri]DateTime ? pdtFechaConsultaFin = null): {ex.Message}", psIdColaborador, psColaborador, psIdTipoDoctor, psIdEspecialidad, psIdConsulta, psIdEstatusConsulta, psRFC, psNumSala, pdtFechaProgramadaInicio, pdtFechaProgramadaFinal, pdtFechaConsultaInicio, pdtFechaConsultaFin, ex, response));
            }
            return(response);
        }
示例#4
0
        public void TestMethod2()
        {
            BusReportes busReportes = new BusReportes();

            var res = busReportes.BObtenerFolios(psIdOrigen: "2");

            string json = JsonConvert.SerializeObject(res, Formatting.Indented);
        }
示例#5
0
        public void TestMethod1()
        {
            BusReportes busReportes = new BusReportes();

            var res = busReportes.BReporteGlobalVentas(psIdOrigen: "1, 2");

            string json = JsonConvert.SerializeObject(res, Formatting.Indented);
        }
示例#6
0
    public static string SelectExistenciasProducto(string piezas)
    {
        List <EntProductosPedido> productos = new List <EntProductosPedido>();

        productos = new BusReportes().SelectPedidoProductos(Convert.ToInt32(piezas));

        JavaScriptSerializer oSerializer = new JavaScriptSerializer();
        string sJson = oSerializer.Serialize(productos);

        return(sJson);
    }
示例#7
0
    public static string SelectVentasEmpleados(string fechaVentas)
    {
        List <EntProductosVentas> productos = new List <EntProductosVentas>();

        productos = new BusReportes().SelectVentasEmpleados(fechaVentas);

        JavaScriptSerializer oSerializer = new JavaScriptSerializer();
        string sJson = oSerializer.Serialize(productos);

        return(sJson);
    }
示例#8
0
    public static string SelectVentasEmpleadosNEW()
    {
        EntUsuarios usua = new EntUsuarios();

        usua = (EntUsuarios)HttpContext.Current.Session["Login"];

        List <EntTotales> totales = new List <EntTotales>();

        totales = new BusReportes().SelectVentasEmpleadosNEW(usua.Id_Usuario);

        JavaScriptSerializer oSerializer = new JavaScriptSerializer();
        string sJson = oSerializer.Serialize(totales);

        return(sJson);
    }
示例#9
0
    public static string SelectVentasMedicoNEW()
    {
        EntUsuarios usua = new EntUsuarios();

        usua = (EntUsuarios)HttpContext.Current.Session["Login"];

        List <EntVentasMedico> ventas = new List <EntVentasMedico>();

        ventas = new BusReportes().SelectVentasMedicoNEW(usua.Id_Usuario);

        JavaScriptSerializer oSerializer = new JavaScriptSerializer();
        string sJson = oSerializer.Serialize(ventas);

        return(sJson);
    }
        public HttpResponseMessage CDescargarReporteVentas([FromUri] string psFolio               = null,
                                                           [FromUri] string psIdEmpresa           = null, [FromUri] string psIdProducto    = null,
                                                           [FromUri] string psIdTipoProducto      = null, [FromUri] string psIdOrigen      = null,
                                                           [FromUri] string psOrderId             = null, [FromUri] string psStatus        = null, [FromUri] string psCupon = null, [FromUri] string psTipoPago = null,
                                                           [FromUri] DateTime?pdtFechaInicio      = null, [FromUri] DateTime?pdtFechaFinal = null,
                                                           [FromUri] DateTime?pdtFechaVencimiento = null)
        {
            HttpResponseMessage response;

            string metodo = nameof(this.CDescargarReporteVentas);

            logger.Info(IMDSerialize.Serialize(67823458572793, $"Inicia {metodo}([FromUri]string psFolio = null, [FromUri]string psIdEmpresa = null, [FromUri]string psIdProducto = null, [FromUri]string psIdTipoProducto = null, [FromUri]string psIdOrigen = null, [FromUri]string psOrderId = null, [FromUri]string psStatus = null,[FromUri]string psCupon = null, [FromUri]DateTime ? pdtFechaInicio = null, [FromUri]DateTime ? pdtFechaFinal = null, [FromUri]DateTime ? pdtFechaVencimiento = null)", psFolio, psIdEmpresa, psIdProducto, psIdTipoProducto, psIdOrigen, psOrderId, psStatus, psCupon, pdtFechaInicio, pdtFechaFinal, pdtFechaVencimiento));

            try
            {
                BusReportes busReportes             = new BusReportes();
                IMDResponse <MemoryStream> resExcel = busReportes.BDescargarReporteVentas(psFolio, psIdEmpresa, psIdProducto, psIdTipoProducto, psIdOrigen, psOrderId, psStatus, psCupon, psTipoPago, pdtFechaInicio, pdtFechaFinal, pdtFechaVencimiento);
                if (resExcel.Code != 0)
                {
                    response = Request.CreateResponse(HttpStatusCode.InternalServerError, resExcel.Message);
                }
                else
                {
                    response         = Request.CreateResponse(HttpStatusCode.OK);
                    response.Content = new StreamContent(resExcel.Result);
                    response.Content.Headers.ContentDisposition          = new ContentDispositionHeaderValue("attachment");
                    response.Content.Headers.ContentDisposition.FileName = "ReporteVentas.xlsx";
                    response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
                }
            }
            catch (Exception ex)
            {
                response = Request.CreateResponse(HttpStatusCode.InternalServerError, "No se pudo generar el reporte de ventas.");

                logger.Error(IMDSerialize.Serialize(67823458573570, $"Error en {metodo}([FromUri]string psFolio = null, [FromUri]string psIdEmpresa = null, [FromUri]string psIdProducto = null, [FromUri]string psIdTipoProducto = null, [FromUri]string psIdOrigen = null, [FromUri]string psOrderId = null, [FromUri]string psStatus = null,[FromUri]string psCupon = null, [FromUri]DateTime ? pdtFechaInicio = null, [FromUri]DateTime ? pdtFechaFinal = null, [FromUri]DateTime ? pdtFechaVencimiento = null): {ex.Message}", psFolio, psIdEmpresa, psIdProducto, psIdTipoProducto, psIdOrigen, psOrderId, psStatus, psCupon, pdtFechaInicio, pdtFechaFinal, pdtFechaVencimiento, ex, response));
            }
            return(response);
        }