Esempio n. 1
0
        public CostPlanBaseViewModel GetCostPlanViewModel(int marketingYearId)
        {
            IList <CostPlanDto> costPlanDtos = _costPlanDao.GetByMarketingYear(marketingYearId);

            List <CostPlanViewModel> costPlanViewModels =
                (
                    from costPlan in costPlanDtos
                    where costPlan.MarketingYearId == marketingYearId
                    select new CostPlanViewModel
            {
                Id = costPlan.Id,
                Type = costPlan.Type,
                TypeName = GetCostTypeName(costPlan.Type),
                Cost = costPlan.Cost
            }
                ).ToList();

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

            var costPlanViewBaseModel = new CostPlanBaseViewModel
            {
                CostPlanViewModels    = costPlanViewModels,
                MarketingYearModel    = marketingYearModel,
                AnnualPlanStatusModel = annualPlanStatusModel
            };

            return(costPlanViewBaseModel);
        }
Esempio n. 2
0
        public ActionResult Plan(int marketingYearId)
        {
            CostPlanBaseViewModel costPlanBaseViewModel = _costPlanService.GetCostPlanViewModel(marketingYearId);

            return(View(costPlanBaseViewModel));
        }