Esempio n. 1
0
        public IActionResult DisplayBatchCalculations(BatchCalculation batchCalculation)
        {
            // if all goes well, redirect to import patients with a success message
            // otherwise, r

            if (!CsvProcessor.IsCsv(batchCalculation.File))
            {
                ViewData["ErrorMessage"] = "Could not upload patients, the file provided was not a CSV file.";
                return(View(viewName: "BatchCalculation"));
            }
            var errorMessages = CsvProcessor.ReadBatchPatientData(batchCalculation.File, out List <ListCalculations> calculatedPatients);

            if (errorMessages.Count != 0)
            {
                ViewData["ErrorMessages"] = errorMessages;
            }
            return(View(viewName: "DisplayBatchCalculations", model: calculatedPatients));
        }