Beispiel #1
0
        private MonthlyReportFodderTypeModel GetMonthlyReportFodderTypeModel(FodderType fodderType, IList <FodderDto> fodders)
        {
            var annualPlanFodderTypeModel = new MonthlyReportFodderTypeModel
            {
                FodderType     = fodderType,
                FodderTypeName = TypeName.GetFodderTypeName((int)fodderType),
                PutOut         = fodders.Where(x => x.Type == (int)fodderType).Sum(x => x.Kilograms)
            };

            return(annualPlanFodderTypeModel);
        }
Beispiel #2
0
        private AnnualPlanFodderTypeModel GetAnnualPlanFodderTypeModel(FodderType fodderType,
                                                                       IList <FodderPlanDto> previousMarketingYearFodderPlans, IList <FodderPlanDto> currentMarketingYearFodderPlans,
                                                                       IList <FodderDto> fodders)
        {
            var annualPlanFodderTypeModel = new AnnualPlanFodderTypeModel
            {
                FodderType     = fodderType,
                FodderTypeName = TypeName.GetFodderTypeName((int)fodderType),
                PreviousPlan   = previousMarketingYearFodderPlans.FirstOrDefault(x => x.Type == (int)fodderType)?.Ton ?? 0,
                Execution      = fodders.Where(x => x.Type == (int)fodderType).Sum(x => x.Kilograms) / 1000.0,
                CurrentState   = 0,
                FutureState    = currentMarketingYearFodderPlans.FirstOrDefault(x => x.Type == (int)fodderType)?.Ton ?? 0
            };

            return(annualPlanFodderTypeModel);
        }