Ejemplo n.º 1
0
        public FieldPlanViewModel GetFieldPlanViewModel(int marketingYearId)
        {
            FieldPlanDto fieldPlanDto = _fieldPlanDao.GetByMarketingYear(marketingYearId);

            FiledPlanModel filedPlanModel = null;

            if (fieldPlanDto != null)
            {
                filedPlanModel = new FiledPlanModel
                {
                    Hectare = fieldPlanDto.Hectare
                };
            }

            MarketingYearModel    marketingYearModel    = _marketingYearService.GetMarketingYearModel(marketingYearId);
            AnnualPlanStatusModel annualPlanStatusModel = _annualPlanStatusService.GetByMarketingYearId(marketingYearId);

            var fieldPlanViewModel = new FieldPlanViewModel
            {
                FiledPlanModel        = filedPlanModel,
                MarketingYearModel    = marketingYearModel,
                AnnualPlanStatusModel = annualPlanStatusModel
            };

            return(fieldPlanViewModel);
        }
Ejemplo n.º 2
0
        private FieldPlanModel GetFieldPlanModel()
        {
            FieldPlanDto previousMarketingYearFieldPlan = _fieldPlanDao.GetByMarketingYear(PreviousMarketingYearId);
            FieldPlanDto currentMarketingYearFieldPlan  = _fieldPlanDao.GetByMarketingYear(CurrentMarketingYearId);

            var fieldPlanModel = new FieldPlanModel
            {
                PreviousPlan = previousMarketingYearFieldPlan?.Hectare ?? 0,
                Execution    = 0, //TODO: Add Field utility
                CurrentState = 0,
                FutureState  = currentMarketingYearFieldPlan?.Hectare ?? 0
            };

            return(fieldPlanModel);
        }
Ejemplo n.º 3
0
        public void GetByMarketingYearTest()
        {
            int marketingYearId = 3;

            FieldPlanDto results = _fieldPlanDao.GetByMarketingYear(marketingYearId);

            Assert.That(results, Is.Not.Null);
        }