예제 #1
0
        public async Task <IActionResult> Details(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var medic = await _getMedicsServices.GetMedicById((Guid)id);

            if (medic == null)
            {
                return(NotFound());
            }

            return(View(medic));
        }
예제 #2
0
        public async Task <IActionResult> ExportExcelAsync(MedicTime medicTime)
        {
            DateTime date      = DateTime.Today;
            var      filename  = "turns";
            var      medicName = await _getMedics.GetMedicById(medicTime.MedicId);

            var reportname = medicName.Name + "_" + date.Year + "-" + date.Month + "-" + date.Day + ".xlsx";
            var stream     = await _exportService.ExportExcelAsync(date, medicTime.MedicId, filename);

            var contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";

            return(File(stream, contentType, reportname));
        }