Beispiel #1
0
        public DeerLickerBaseViewModel GetDeerLickerViewModel(int marketingYearId)
        {
            IList <DeerLickerDto> deerLickerDtos = _deerLickerDao.GetByMarketingYear(marketingYearId);

            List <DeerLickerViewModel> deerLickerViewModels = deerLickerDtos.Select(x => new DeerLickerViewModel
            {
                Id          = x.Id,
                Count       = x.Count,
                Section     = x.Section,
                District    = x.District,
                Forestry    = x.Forestry,
                Description = x.Description
            }).ToList();

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

            var pastureBaseViewModel = new DeerLickerBaseViewModel
            {
                DeerLickerViewModels  = deerLickerViewModels,
                MarketingYearModel    = marketingYearModel,
                AnnualPlanStatusModel = annualPlanStatusModel
            };

            return(pastureBaseViewModel);
        }
Beispiel #2
0
        public ActionResult List(int marketingYearId)
        {
            DeerLickerBaseViewModel deerLickerBaseViewModel = _deerLickerService.GetDeerLickerViewModel(marketingYearId);

            return(View(deerLickerBaseViewModel));
        }