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); }
public ActionResult List(int marketingYearId) { DeerLickerBaseViewModel deerLickerBaseViewModel = _deerLickerService.GetDeerLickerViewModel(marketingYearId); return(View(deerLickerBaseViewModel)); }