Пример #1
0
        public ActionResult DowndZip(string corr_planificacion)
        {
            Int64  nroTarja     = 0;
            string planDescJson = new PlanificacionDescBLL().sp_selPlanDescIDBLL(corr_planificacion);

            PlanificacionDescBO planDesc = new PlanificacionDescBO();

            planDesc = JsonConvert.DeserializeObject <PlanificacionDescBO>(planDescJson);
            TarjaDescDetBO tarja = new TarjaDescDetBLL().sp_sel_tarjaDescDetBLL(corr_planificacion);

            nroTarja = tarja.Nro_tarja;
            string contenedor = planDesc.Cod_contenedor;


            var memoryStream = new ZipFotos().crearZip(nroTarja, planDesc.Fecha);

            byte[] byteInfo = memoryStream.ToArray();
            memoryStream.Write(byteInfo, 0, byteInfo.Length);
            memoryStream.Position = 0;
            Response.Buffer       = true;

            string base64string = Convert.ToBase64String(byteInfo);

            return(File(byteInfo, "application/gzip", contenedor + ".zip"));
        }
Пример #2
0
        public ActionResult CrearPdf(string corr_planificacion)
        {
            Int64  nroTarja     = 0;
            string planDescJson = new PlanificacionDescBLL().sp_selPlanDescIDBLL(corr_planificacion);

            PlanificacionDescBO planDesc = new PlanificacionDescBO();

            planDesc = JsonConvert.DeserializeObject <PlanificacionDescBO>(planDescJson);
            TarjaDescDetBO tarja = new TarjaDescDetBLL().sp_sel_tarjaDescDetBLL(corr_planificacion);

            nroTarja = tarja.Nro_tarja;

            Document     doc       = new Document(PageSize.A4.Rotate());
            MemoryStream outstreem = new MemoryStream();
            string       fileName  = null;

            PdfWriter.GetInstance(doc, outstreem).CloseStream = false;
            doc.Open();
            doc      = new PdfDesco().BindingData(doc, planDesc, tarja);
            fileName = "reporte-" + nroTarja;
            doc.Close();

            byte[] byteInfo = outstreem.ToArray();
            outstreem.Write(byteInfo, 0, byteInfo.Length);
            outstreem.Position = 0;
            Response.Buffer    = true;

            string base64string = Convert.ToBase64String(byteInfo);

            return(File(byteInfo, "application/pdf"));
        }