Пример #1
0
        public IActionResult ListaTestes(int idRelease, [FromServices] VivoDAO vivoDAO)
        {
            List <TestesVivo> testes = vivoDAO.ListaTestesVivo(idRelease);

            ViewBag.CodRelease = testes.Select(t => t.CodRelease).FirstOrDefault();
            return(View(testes));
        }
Пример #2
0
        public IActionResult ExportRelease(int idRelease, string codRelease, [FromServices] VivoDAO vivoDAO)
        {
            ReadExcel readExcel = new ReadExcel(_hostingEnvironment);

            List <TestesVivo> testesVivo = vivoDAO.ListaTestesVivo(idRelease);

            string       url          = string.Format("{0}://{1}/{2}", Request.Scheme, Request.Host, $"{codRelease}.xlsx");
            MemoryStream memoryStream = readExcel.DownloadTestesVivo(testesVivo, codRelease, url);

            return(File(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", $"{codRelease}.xlsx"));
        }