Esempio n. 1
0
        public RequestExplorerModel Get(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();

            _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 };
        }
Esempio n. 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;
        }