public async Task <ActionResult> ListTakeRates(TakeRateParameters parameters)
        {
            TakeRateParametersValidator
            .ValidateTakeRateParameters(DataContext, parameters, TakeRateParametersValidator.NoValidation);

            var js     = new JavaScriptSerializer();
            var filter = new TakeRateFilter()
            {
                FilterMessage    = parameters.FilterMessage,
                TakeRateStatusId = parameters.TakeRateStatusId,
                Action           = TakeRateDataItemAction.TakeRates
            };

            filter.InitialiseFromJson(parameters);

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

            var jQueryResult = new JQueryDataTableResultModel(results);

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

            return(Json(jQueryResult));
        }
Esempio n. 2
0
        public async Task <ActionResult> ListMarketReview(TakeRateParameters parameters)
        {
            TakeRateParametersValidator
            .ValidateTakeRateParameters(DataContext, parameters, TakeRateParametersValidator.NoValidation);

            var filter = new TakeRateFilter()
            {
                FilterMessage = parameters.FilterMessage,
                Action        = TakeRateDataItemAction.MarketReview
            };

            filter.InitialiseFromJson(parameters);

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

            var jQueryResult = new JQueryDataTableResultModel(results);

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

            return(Json(jQueryResult));
        }