private MatVarOverviewViewModel GetGainsAndLosses(MatVarOverviewViewModel overview)
        {
            List <BatchReport>     reports            = helper.GetBatchReportsForDateSelector(overview.DateSelectorModal);
            List <MaterialDetails> allMaterialDetails = _materialDetailsRepository.GetAllMaterialDetails();

            overview.UnsortedTotals = GetUnsortedTotals(reports, allMaterialDetails);
            SortTotals(overview);
            overview.CombinedTotal = overview.TotalGainForPeriod + overview.TotalLossForPeriod;
            return(overview);
        }
        public IActionResult ShowControlChart(QualityControlChartViewModel qualityControlChartViewModel)
        {
            List <BatchReport> reports = _generalHelperMethods.GetBatchReportsForDateSelector(qualityControlChartViewModel.DateSelectorModal);

            switch (qualityControlChartViewModel.ParameterId)
            {
            case "1":
                qualityControlChartViewModel.ChartData.AddRange(GetViscoChartData(reports));
                break;

            case "2":
                qualityControlChartViewModel.ChartData.AddRange(GetPhChartData(reports));
                break;

            case "3":
                qualityControlChartViewModel.ChartData.AddRange(GetSoftquatChartData(reports));
                break;

            case "4":
                qualityControlChartViewModel.ChartData.AddRange(GetStenolDropChartData(reports));
                break;

            case "5":
                qualityControlChartViewModel.ChartData.AddRange(GetActiveDropChartData(reports));
                break;

            case "6":
                qualityControlChartViewModel.ChartData.AddRange(GetHCLChartData(reports));
                break;
            }

            return(ViewComponent("QualityControlChart", qualityControlChartViewModel));
        }