Exemplo n.º 1
0
        private void AddMoveButtons(TableCell tableCell, IVwbColumn column)
        {
            if (column == _articleCheckboxes || column == _articleNumberColumn || column == _titleColumn)
            {
                return;
            }

            if (!_query.ColumnKeysInOrder.Any())
            {
                return;
            }

            if (column.Key() != _query.ColumnKeysInOrder.FirstOrDefault())
            {
                var link = new HyperLink {
                    CssClass = "moveleft"
                };
                var query = _query.Clone();
                query.MoveColumnLeft(column.Key());
                link.Attributes.Add("href", GetUrlForQuery(query));
                tableCell.Controls.Add(link);
            }
            if (column.Key() != _query.ColumnKeysInOrder.Last())
            {
                var link = new HyperLink {
                    CssClass = "moveright"
                };
                var query = _query.Clone();
                query.MoveColumnRight(column.Key());
                link.Attributes.Add("href", GetUrlForQuery(query));
                tableCell.Controls.Add(link);
            }
        }
Exemplo n.º 2
0
        public ReportBuilder(Page page, VwbQuery query)
        {
            _page  = page;
            _query = query.Clone();
            IEnumerable <string> immutableColKeys = ColumnFactory.ImmutableColumns.Select(i => i.Key());

            if (_query.SortColumnKey != null && !_query.ColumnKeysInOrder.Contains(_query.SortColumnKey) &&
                !immutableColKeys.Contains(_query.SortColumnKey))
            {
                _query.SortColumnKey = null;
            }
            if (string.IsNullOrEmpty(_query.SortColumnKey))
            {             //if no sort defined, sort by article number
                _query.SortColumnKey = ColumnFactory.GetArticleNumberColumn().Key();
            }
        }