Пример #1
0
        public virtual ActionResult List(DataSourceRequest command, LivechatLogListModel model)
        {
            if (!permissionService.Authorize(StandardPermissionProvider.ManageLivechat))
            {
                return(AccessDeniedKendoGridJson());
            }

            var customerId = UserHasAllCustomerPermission() ? 0 : workContext.CurrentCustomer.Id;

            var conversationList = livechatService.GetSummarizedConversationList(
                storeMappingService.CurrentStore(),
                command.Page,
                command.PageSize,
                currentUser: customerId
                );

            var gridModel = new DataSourceResult
            {
                Data  = conversationList.Select(x => x),
                Total = conversationList.TotalCount
            };

            return(Json(gridModel));
        }