public TrunkFoodPlanViewModel GetTrunkFoodPlanViewModel(int marketingYearId) { TrunkFoodPlanDto trunkFoodPlanDto = _trunkFoodPlanDao.GetByMarketingYear(marketingYearId); TrunkFoodPlanModel trunkFoodPlanModel = null; if (trunkFoodPlanDto != null) { trunkFoodPlanModel = new TrunkFoodPlanModel { Hectare = trunkFoodPlanDto.Hectare }; } MarketingYearModel marketingYearModel = _marketingYearService.GetMarketingYearModel(marketingYearId); AnnualPlanStatusModel annualPlanStatusModel = _annualPlanStatusService.GetByMarketingYearId(marketingYearId); var trunkFoodPlanViewModel = new TrunkFoodPlanViewModel { TrunkFoodPlanModel = trunkFoodPlanModel, MarketingYearModel = marketingYearModel, AnnualPlanStatusModel = annualPlanStatusModel }; return(trunkFoodPlanViewModel); }
private TrunkFoodPlanModel GetTrunkFoodPlanModel() { TrunkFoodPlanDto previousMarketingYearTrunkFoodPlan = _trunkFoodPlanDao.GetByMarketingYear(PreviousMarketingYearId); TrunkFoodPlanDto currentMarketingYearTrunkFoodPlan = _trunkFoodPlanDao.GetByMarketingYear(CurrentMarketingYearId); var trunkFoodPlanModel = new TrunkFoodPlanModel { PreviousPlan = previousMarketingYearTrunkFoodPlan?.Hectare ?? 0, Execution = 0, //TODO: Add Trunk Food utility CurrentState = 0, FutureState = currentMarketingYearTrunkFoodPlan?.Hectare ?? 0 }; return(trunkFoodPlanModel); }