public async Task <ActionResult> ListDerivatives(DerivativeParameters parameters) { ValidateDerivativeParameters(parameters, DerivativeParametersValidator.NoValidation); var filter = new DerivativeFilter() { FilterMessage = parameters.FilterMessage, CarLine = parameters.CarLine, ModelYear = parameters.ModelYear, Gateway = parameters.Gateway, Action = DerivativeAction.Derivatives }; filter.InitialiseFromJson(parameters); var results = await DerivativeViewModel.GetModel(DataContext, filter); var jQueryResult = new JQueryDataTableResultModel(results); foreach (var result in results.Derivatives.CurrentPage) { jQueryResult.aaData.Add(result.ToJQueryDataTableResult()); } return(Json(jQueryResult)); }
public async Task <ActionResult> DerivativePage(DerivativeParameters parameters) { var filter = new DerivativeFilter() { PageIndex = PageIndex, PageSize = PageSize }; return(View(await DerivativeViewModel.GetModel(DataContext, filter))); }
public async Task <ActionResult> ContextMenu(DerivativeParameters parameters) { ValidateDerivativeParameters(parameters, DerivativeParametersValidator.DerivativeIdentifier); var filter = DerivativeFilter.FromParameters(parameters); filter.Action = DerivativeAction.Derivative; var derivativeView = await DerivativeViewModel.GetModel(DataContext, filter); return(PartialView("_ContextMenu", derivativeView)); }
private async Task <DerivativeViewModel> GetModelFromParameters(DerivativeParameters parameters) { return(await DerivativeViewModel.GetModel(DataContext, DerivativeMappingFilter.FromParameters(parameters))); }