public async Task <ActionResult> ListMarketMappings(MarketMappingParameters parameters)
        {
            ValidateMarketMappingParameters(parameters, MarketMappingParametersValidator.NoValidation);

            var filter = new MarketMappingFilter()
            {
                FilterMessage = parameters.FilterMessage,
                CarLine       = parameters.CarLine,
                ModelYear     = parameters.ModelYear,
                Gateway       = parameters.Gateway,
                Action        = MarketMappingAction.Mappings
            };

            filter.InitialiseFromJson(parameters);

            var results = await MarketMappingViewModel.GetModel(DataContext, filter);

            var jQueryResult = new JQueryDataTableResultModel(results);

            foreach (var result in results.MarketMappings.CurrentPage)
            {
                jQueryResult.aaData.Add(result.ToJQueryDataTableResult());
            }

            return(Json(jQueryResult));
        }
        public async Task <ActionResult> ModalContent(MarketMappingParameters parameters)
        {
            ValidateMarketMappingParameters(parameters, MarketMappingParametersValidator.Action);

            var filter = MarketMappingFilter.FromMarketMappingParameters(parameters);
            var derivativeMappingView = await MarketMappingViewModel.GetModel(DataContext, filter);

            return(PartialView(GetContentPartialViewName(parameters.Action), derivativeMappingView));
        }
        public async Task <ActionResult> MarketMappingPage(MarketMappingParameters parameters)
        {
            var filter = new MarketMappingFilter()
            {
                PageIndex = PageIndex,
                PageSize  = PageSize
            };

            return(View(await MarketMappingViewModel.GetModel(DataContext, filter)));
        }
        public async Task <ActionResult> ContextMenu(MarketMappingParameters parameters)
        {
            ValidateMarketMappingParameters(parameters, MarketMappingParametersValidator.MarketMappingIdentifier);

            var filter = MarketMappingFilter.FromMarketMappingParameters(parameters);

            filter.Action = MarketMappingAction.Mapping;

            var derivativeMappingView = await MarketMappingViewModel.GetModel(DataContext, filter);

            return(PartialView("_ContextMenu", derivativeMappingView));
        }
 private async Task <MarketMappingViewModel> GetModelFromParameters(MarketMappingParameters parameters)
 {
     return(await MarketMappingViewModel.GetModel(DataContext, MarketMappingFilter.FromMarketMappingParameters(parameters)));
 }