public async Task <ActionResult> ListBrochureModelCodes(DerivativeMappingParameters parameters) { ValidateDerivativeMappingParameters(parameters, DerivativeMappingParametersValidator.NoValidation); var filter = new DerivativeMappingFilter() { FilterMessage = parameters.FilterMessage, CarLine = parameters.CarLine, ModelYear = parameters.ModelYear, Gateway = parameters.Gateway, Action = DerivativeMappingAction.BrochureModelCodes, DocumentId = parameters.DocumentId }; filter.InitialiseFromJson(parameters); var results = await DerivativeMappingViewModel.GetModel(DataContext, filter); var jQueryResult = new JQueryDataTableResultModel(results); foreach (var result in results.OxoDerivatives.CurrentPage) { try { jQueryResult.aaData.Add(result.ToJQueryDataTableResult()); } catch (Exception ex) { Log.Error(ex); } } return(Json(jQueryResult)); }
public async Task <ActionResult> ListDerivativeMappings(DerivativeMappingParameters parameters) { ValidateDerivativeMappingParameters(parameters, DerivativeMappingParametersValidator.NoValidation); var filter = new DerivativeMappingFilter() { FilterMessage = parameters.FilterMessage, CarLine = parameters.CarLine, ModelYear = parameters.ModelYear, Gateway = parameters.Gateway, Action = DerivativeMappingAction.Mappings }; filter.InitialiseFromJson(parameters); var results = await DerivativeMappingViewModel.GetModel(DataContext, filter); var jQueryResult = new JQueryDataTableResultModel(results); foreach (var result in results.DerivativeMappings.CurrentPage) { jQueryResult.aaData.Add(result.ToJQueryDataTableResult()); } return(Json(jQueryResult)); }