Ejemplo n.º 1
0
        public IActionResult History(DataSourceRequest command, string customerReminderId)
        {
            //we use own own binder for searchCustomerRoleIds property
            var history = _customerReminderService.GetAllCustomerReminderHistory(customerReminderId,
                                                                                 pageIndex: command.Page - 1,
                                                                                 pageSize: command.PageSize);
            var gridModel = new DataSourceResult
            {
                Data  = history.Select(x => _customerReminderViewModelService.PrepareHistoryModelForList(x)),
                Total = history.TotalCount
            };

            return(Json(gridModel));
        }
        public async Task <IActionResult> History(DataSourceRequest command, string customerReminderId)
        {
            //we use own own binder for searchCustomerGroupIds property
            var history = await _customerReminderService.GetAllCustomerReminderHistory(customerReminderId,
                                                                                       pageIndex : command.Page - 1,
                                                                                       pageSize : command.PageSize);

            var items = new List <SerializeCustomerReminderHistoryModel>();

            foreach (var item in history)
            {
                items.Add(await _customerReminderViewModelService.PrepareHistoryModelForList(item));
            }
            var gridModel = new DataSourceResult
            {
                Data  = items,
                Total = history.TotalCount
            };

            return(Json(gridModel));
        }