public a7FilterGroupEditor(a7SingleTableExplorer entity, bool vertical, bool isReadOnly, a7SqlTools.Controls.Filter.a7FilterEditor editorContext)
 {
     InitializeComponent();
     EditorContext = editorContext;
     _entity       = entity;
     if (entity != null)
     {
         Elements = a7FilterEditorUtils.GetFilterEditorElements(entity);
     }
     else
     {
         Elements = new List <a7FilterElementDefinition>();
     }
     SubGroups = new List <a7FilterGroupEditor>();
     _vertical = vertical;
     this.VerticalAlignment   = VerticalAlignment.Center;
     this.HorizontalAlignment = HorizontalAlignment.Center;
     if (!_vertical)
     {
         Orientation = Orientation.Horizontal;
     }
     else
     {
         Orientation = Orientation.Vertical;
     }
     IsReadOnly = false;
     popupFieldSelect.Opened += (sender, args) =>
     {
         EditorContext?.EntityFieldsPopups.Add(popupFieldSelect);
     };
     this.IsReadOnly = isReadOnly;
 }
예제 #2
0
        public a7FilterElementEditor(a7SingleTableExplorer entity, FltAtomExprData filter)
        {
            InitializeComponent();
            var field = entity.AvailableColumns.FirstOrDefault(c => c.Name == filter.Field);

            Filter = filter;
            IsWithEntityIdFilter = false;
            setField(field);
        }
예제 #3
0
 public void SetTable(a7SingleTableExplorer table)
 {
     if (table.IsNotEmpty())
     {
         _entity  = table;
         Elements = a7FilterEditorUtils.GetFilterEditorElements(table);
     }
     Reset();
 }
 protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
 {
     base.OnPropertyChanged(e);
     if (e.Property == TableProperty && _table != e.NewValue as a7SingleTableExplorer)
     {
         if (_fePopupControl != null)
         {
             _fePopupControl.SetTable(e.NewValue as a7SingleTableExplorer);
             _table = e.NewValue as a7SingleTableExplorer;
             if (this.FilterExpr != null)
             {
                 _fePopupControl.SetFilter(_table, FilterExpr);
             }
         }
         else
         {
             _table = e.NewValue as a7SingleTableExplorer;
         }
     }
     else if (e.Property == FilterExprProperty)
     {
         if (this.FilterExpr != e.NewValue as FilterExpressionData)
         {
             if (_fePopupControl != null && this._table != null)
             {
                 _fePopupControl.SetFilter(this._table, e.NewValue as FilterExpressionData);
             }
             else
             {
                 this.FilterExpr = e.NewValue as FilterExpressionData;
             }
         }
         RefreshButtonHighlight(e.NewValue as FilterExpressionData);
     }
     else if (e.Property == UpdateFilterFunctionProperty && this._fePopupControl != null)
     {
         this._fePopupControl.UpdateFilterFunction = UpdateFilter;
     }
 }
예제 #5
0
        public void SetFilter(a7SingleTableExplorer entity, FilterExpressionData filter)
        {
            if (entity == null)
            {
                Reset();
                return;
            }
            Elements = a7FilterEditorUtils.GetFilterEditorElements(entity);
            var fge = new a7FilterGroupEditor(entity, false, this.IsReadOnly, this);

            fge.SetFilter(filter);
            this.FilterExpr = filter;
            SetRootGroup(fge);
            if (filter != null)
            {
                gStartPanel.Visibility = Visibility.Collapsed;
                MyBorder.Visibility    = System.Windows.Visibility.Visible;
                if (!IsReadOnly)
                {
                    spButtons.Visibility = System.Windows.Visibility.Visible;
                }
            }
        }
 public a7FilterGroupEditor(a7SingleTableExplorer entity, bool vertical, bool isReadOnly, a7SqlTools.Controls.Filter.a7FilterEditor editorContext, FilterExpressionData filter)
     : this(entity, vertical, isReadOnly, editorContext)
 {
     SetFilter(filter);
 }
예제 #7
0
 public static IEnumerable <a7FilterElementDefinition> GetFilterEditorElements(a7SingleTableExplorer entity)
 {
     if (entity != null)
     {
         //fields
         var elements = new List <a7FilterElementDefinition>();
         foreach (var fld in entity.AvailableColumns)
         {
             elements.Add(a7FilterElementDefinition.GetFieldFilterElement(fld));
         }
         return(elements);
     }
     return(new List <a7FilterElementDefinition>());
 }