public ListResult <BackendActionLog> GetLogPage(ListCommand cmd, BackendActionLogFilter filter)
        {
            var data = repository.GetPage(cmd, filter, out var totalRecords).ToList();

            return(new ListResult <BackendActionLog>
            {
                Data = data,
                TotalRecords = totalRecords
            });
        }
        public ActionResult _Actions(GridCommand command, [Bind(Prefix = "searchQuery")][ModelBinder(typeof(JsonStringModelBinder <BackendActionLogFilter>))] BackendActionLogFilter filter)
        {
            var list = _actionLogService.GetLogPage(command.GetListCommand(), filter);
            var data = list.Data.Select(r =>
            {
                r.ActionTypeName = Translator.Translate(r.ActionTypeName);
                r.ActionName     = Translator.Translate(r.ActionName);
                r.EntityTypeName = Translator.Translate(r.EntityTypeName);
                return(r);
            });

            return(new TelerikResult(data, list.TotalRecords));
        }
Exemple #3
0
        public ActionResult _Actions(
            int page,
            int pageSize,
            string orderBy,
            [Bind(Prefix = "searchQuery")]
            [ModelBinder(typeof(JsonStringModelBinder <BackendActionLogFilter>))]
            BackendActionLogFilter filter)
        {
            var listCommand = GetListCommand(page, pageSize, orderBy);
            var list        = _actionLogService.GetLogPage(listCommand, filter);

            var data = list.Data.Select(log =>
            {
                log.ActionTypeName = Translator.Translate(log.ActionTypeName);
                log.ActionName     = Translator.Translate(log.ActionName);
                log.EntityTypeName = Translator.Translate(log.EntityTypeName);
                return(log);
            });

            return(new TelerikResult(data, list.TotalRecords));
        }
Exemple #4
0
        IEnumerable <BackendActionLog> IBackendActionLogPagesRepository.GetPage(ListCommand cmd, BackendActionLogFilter filter, out int totalRecords)
        {
            filter = filter ?? new BackendActionLogFilter();
            using (var scope = new QPConnectionScope())
            {
                var rows = Common.GetActionLogPage(scope.DbConnection, cmd.SortExpression,
                                                   filter.actionCode,
                                                   filter.actionTypeCode,
                                                   filter.entityTypeCode,
                                                   filter.entityStringId,
                                                   filter.parentEntityId,
                                                   filter.entityTitle,
                                                   filter.from, filter.to,
                                                   (filter.userIDs ?? Enumerable.Empty <int>()).ToList(),
                                                   out totalRecords, cmd.StartRecord, cmd.PageSize);

                return(MapperFacade.BackendActionLogRowMapper.GetBizList(rows.ToList()));
            }
        }