public EmploymentPlanBaseViewModel GetEmploymentPlanViewModel(int marketingYearId) { IList <EmploymentPlanDto> employmentPlanDtos = _employmentPlanDao.GetByMarketingYear(marketingYearId); List <EmploymentPlanViewModel> employmentPlanViewModels = ( from employmentPlan in employmentPlanDtos where employmentPlan.MarketingYearId == marketingYearId select new EmploymentPlanViewModel { Id = employmentPlan.Id, EmploymentType = employmentPlan.EmploymentType, EmploymentTypeName = GetEmploymentTypeName(employmentPlan.EmploymentType), Count = employmentPlan.Count } ).ToList(); MarketingYearModel marketingYearModel = _marketingYearService.GetMarketingYearModel(marketingYearId); AnnualPlanStatusModel annualPlanStatusModel = _annualPlanStatusService.GetByMarketingYearId(marketingYearId); var employmentPlanBaseViewModel = new EmploymentPlanBaseViewModel { EmploymentPlanViewModels = employmentPlanViewModels, MarketingYearModel = marketingYearModel, AnnualPlanStatusModel = annualPlanStatusModel }; return(employmentPlanBaseViewModel); }
public ActionResult Plan(int marketingYearId) { EmploymentPlanBaseViewModel employmentPlanBaseViewModel = _employmentPlanService.GetEmploymentPlanViewModel(marketingYearId); return(View(employmentPlanBaseViewModel)); }