public IActionResult AddAllBatchesToShiftLog() { var batches = _batchRepository.AllBatches.Where(x => x.StartTime.Month == 10 && x.StartTime.Year == 2020 && x.StartTime.Day > 16).ToList(); _shiftLogRepository.AddBatchesToShiftLog(batches); return(RedirectToAction("Index", "Settings")); }
public async Task <IActionResult> UploadBatches(string textfromAllfiles) { List <BatchReport> batchReports = _batchDataFileManager.ProcessStringIntoBatchReports(textfromAllfiles); int goodBatches = 0; int badBatches = 0; await CheckForbatchesThatAlreadyExist(batchReports); foreach (var report in batchReports) { if (report.IsValidBatch) { goodBatches++; issueScannerManager.ScanForIssues(report); _batchRepository.Add(report); } else { badBatches++; _batchRepository.AddConversionFaults(report.ConversionFaults); } } _batchRepository.SaveChanges(); _shiftLogRepository.AddBatchesToShiftLog(batchReports); ViewData["goodBatches"] = goodBatches; ViewData["badBatches"] = badBatches; ViewData["totalBatches"] = batchReports.Count; return(View("ViewResults", batchReports)); }