Пример #1
0
        public RequestExplorerModel Execute(RequestExplorerRequestModel request)
        {
            var report = _reportBuilder.Build();

            // TODO -- move to types? Need to support no data in here
            var columnModel    = new JqGridColumnModel();
            var behaviorReport = report.Requests.FirstOrDefault();

            if (behaviorReport != null)
            {
                _columnBuilders
                .SelectMany(builder => builder.ColumnsFor(behaviorReport))
                .Each(col => columnModel.AddColumn(new JqGridColumn
                {
                    hidden     = col.IsHidden,
                    hidedlg    = col.IsHidden,
                    hideFilter = col.HideFilter,
                    name       = col.Name,
                    index      = col.Name
                }));
            }
            return(new RequestExplorerModel {
                ColumnModel = columnModel
            });
        }
Пример #2
0
        public RoutesModel Get(RouteRequestModel request)
        {
            var columnModel = new JqGridColumnModel();
            var chain       = _graph.Behaviors.First();

            _columnBuilders
            .SelectMany(builder => builder.ColumnsFor(chain))
            .Each(col => columnModel.AddColumn(new JqGridColumn
            {
                hidden     = col.IsHidden,
                hidedlg    = col.IsHidden,
                hideFilter = col.HideFilter,
                name       = col.Name,
                index      = col.Name
            }));

            var model = new RoutesModel {
                ColumnModel = columnModel
            };

            if (request.Column.IsNotEmpty() && request.Value.IsNotEmpty())
            {
                model.Filter = new JsonGridFilter {
                    ColumnName = request.Column, Values = new List <string> {
                        request.Value
                    }
                };
            }

            return(model);
        }
Пример #3
0
        public RoutesModel Build()
        {
            var columnModel = new JqGridColumnModel();
            var chain       = _graph.Behaviors.First();

            _columnBuilders
            .SelectMany(builder => builder.ColumnsFor(chain))
            .Each(col => columnModel.AddColumn(new JqGridColumn
            {
                hidden     = col.IsHidden,
                hidedlg    = col.IsHidden,
                hideFilter = col.HideFilter,
                name       = col.Name,
                index      = col.Name
            }));

            return(new RoutesModel
            {
                ColumnModel = columnModel
            });
        }