コード例 #1
0
        public async Task <ActionResult> ListFeatures(FeatureParameters parameters)
        {
            ValidateFeatureParameters(parameters, FeatureParametersValidator.NoValidation);

            var filter = new FeatureFilter()
            {
                FilterMessage = parameters.FilterMessage,
                CarLine       = parameters.CarLine,
                ModelYear     = parameters.ModelYear,
                Gateway       = parameters.Gateway,
                Action        = FeatureAction.Features
            };

            filter.InitialiseFromJson(parameters);

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

            var jQueryResult = new JQueryDataTableResultModel(results);

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

            return(Json(jQueryResult));
        }
コード例 #2
0
        public async Task <ActionResult> FeaturePage(FeatureParameters parameters)
        {
            var filter = new FeatureFilter()
            {
                PageIndex = PageIndex,
                PageSize  = PageSize
            };

            return(View(await FeatureViewModel.GetModel(DataContext, filter)));
        }
コード例 #3
0
        public async Task <ActionResult> ContextMenu(FeatureParameters parameters)
        {
            ValidateFeatureParameters(parameters, FeatureParametersValidator.FeatureIdentifier);

            var filter = FeatureFilter.FromParameters(parameters);

            filter.Action = FeatureAction.Feature;

            var derivativeView = await FeatureViewModel.GetModel(DataContext, filter);

            return(PartialView("_ContextMenu", derivativeView));
        }
コード例 #4
0
 private async Task <FeatureViewModel> GetModelFromParameters(FeatureParameters parameters)
 {
     return(await FeatureViewModel.GetModel(DataContext, FeatureMappingFilter.FromParameters(parameters)));
 }