Ejemplo n.º 1
0
        public ExecQueryModel()
        {
            JoinTables         = new ObservableCollection <JoinTable>();
            RelFields          = new ObservableCollection <RelationField>();
            SelectedFields     = new ObservableCollection <FieldViewModel>();
            SelectedConditions = new ObservableCollection <ConditionViewModel>();
            SelectedSorts      = new ObservableCollection <SortViewModel>();

            QueryExecutor        = new QueryExecutor(this);
            TableSelector        = new TableSelector(this);
            SelFieldsSelector    = new SelFieldsSelector(this);
            SortFieldsSelector   = new SortFieldsSelector(this);
            FilterFieldsSelector = new FilterFieldsSelector(this);

            InitDataSource();
        }
Ejemplo n.º 2
0
        //基础字段源过滤
        public void FilterBaseFieldsSrc()
        {
            ICollectionView view = ViewSrcBaseFields.View;

            if (view == null)
            {
                return;
            }
            var baseFields = GetFieldsBySelectedTable();

            if (baseFields.IsEmpty())
            {
                view.Filter = model => { return(1 == 0); };
            }
            else
            {
                view.Filter = model => { return(baseFields.Contains((FieldViewModel)model)); };
            }

            //基础字段发生变化后,查询结果字段、过滤、排序数据源都得更新
            SelFieldsSelector.FilterSelFieldsSrc(baseFields);
            FilterFieldsSelector.FilterFilterFieldsSrc(baseFields);
            SortFieldsSelector.FilterSortFieldsSrc(baseFields);
        }