Esempio n. 1
0
        public HttpResponseMessage ObtenerReporteExcel(EDCargueMasivo cargue)
        {
            HttpResponseMessage response = null;

            try
            {
                LNCargue logica  = new LNCargue();
                var      archivo = logica.CargarPlantillaCargueAusentismo(cargue);
                if (archivo != null)
                {
                    response = Request.CreateResponse <EDCargueMasivo>(HttpStatusCode.Created, archivo);
                    return(response);
                }
                else
                {
                    response = Request.CreateResponse(HttpStatusCode.ExpectationFailed);
                    return(response);
                }
            }
            catch (Exception ex)
            {
                response = Request.CreateResponse(HttpStatusCode.InternalServerError);
                return(response);
            }
        }
Esempio n. 2
0
        public HttpResponseMessage ObtenerReporteExcel(string Nit)
        {
            HttpResponseMessage response = null;

            try
            {
                LNCargue logica  = new LNCargue();
                var      archivo = logica.DescargarPlantillaCargue(Nit);
                if (archivo != null)
                {
                    response = Request.CreateResponse <byte[]>(HttpStatusCode.OK, archivo);
                    return(response);
                }
                else
                {
                    response = Request.CreateResponse(HttpStatusCode.ExpectationFailed);
                    return(response);
                }
            }
            catch (Exception ex)
            {
                response = Request.CreateResponse(HttpStatusCode.InternalServerError);
                return(response);
            }
        }