Exemple #1
0
 private void RefreshAttributes()
 {
     EnableControls(false);
     cmbAttribute.Items.Clear();
     if (records != null)
     {
         var entityName = records.EntityName;
         if (NeedToLoadEntity(entityName))
         {
             if (!working)
             {
                 LoadEntityDetails(entityName, RefreshAttributes);
             }
             return;
         }
         var attributes = GetDisplayAttributes(entityName);
         foreach (var attribute in attributes)
         {
             AttributeItem.AddAttributeToComboBox(cmbAttribute, attribute, true);
         }
         if (entityAttributes.ContainsKey(records.EntityName))
         {
             var attr = entityAttributes[records.EntityName];
             var coll = new Dictionary <string, string>();
             coll.Add("attribute", attr);
             ControlUtils.FillControl(coll, cmbAttribute);
         }
     }
     crmGridView1.ShowFriendlyNames = useFriendlyNames;
     crmGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
     EnableControls(true);
 }
Exemple #2
0
        private void RefreshAttributes()
        {
            cmbAttribute.Items.Clear();
            var entityNode = cmbEntity.SelectedItem is EntityNode ? (EntityNode)cmbEntity.SelectedItem : null;

            if (entityNode == null)
            {
                entityNode = new EntityNode(GetClosestEntityNode(node));
            }
            if (entityNode == null)
            {
                return;
            }
            var entityName = entityNode.EntityName;

            if (form.NeedToLoadEntity(entityName))
            {
                if (!form.working)
                {
                    form.LoadEntityDetails(entityName, RefreshAttributes);
                }
                return;
            }
            var attributes = form.GetDisplayAttributes(entityName);

            foreach (var attribute in attributes)
            {
                AttributeItem.AddAttributeToComboBox(cmbAttribute, attribute, true, FetchXmlBuilder.friendlyNames);
            }
            // RefreshFill now that attributes are loaded
            ControlUtils.FillControl(collec, cmbAttribute);
            ControlUtils.FillControl(collec, cmbValue);
        }
        private void PopulateControls(TreeNode node, AttributeMetadata[] attributes)
        {
            cmbAttribute.Items.Clear();
            if (attributes != null)
            {
                foreach (var attribute in attributes)
                {
                    AttributeItem.AddAttributeToComboBox(cmbAttribute, attribute, false);
                }
            }
            var aggregate = FetchXmlBuilder.IsFetchAggregate(node);

            textAlias.Enabled = aggregate;
        }
 private void PopulateControls(TreeNode node, AttributeMetadata[] attributes)
 {
     cmbAttribute.Items.Clear();
     if (attributes != null)
     {
         foreach (var attribute in attributes)
         {
             AttributeItem.AddAttributeToComboBox(cmbAttribute, attribute, false, FetchXmlBuilder.friendlyNames);
         }
     }
     aggregate            = TreeBuilderControl.IsFetchAggregate(node);
     cmbAggregate.Enabled = aggregate;
     chkGroupBy.Enabled   = aggregate;
     if (!aggregate)
     {
         cmbAggregate.SelectedIndex = -1;
         chkGroupBy.Checked         = false;
     }
 }
Exemple #5
0
        protected override void PopulateControls()
        {
            cmbAttribute.Items.Clear();
            aggregate            = Node.IsFetchAggregate();
            cmbAggregate.Enabled = aggregate;
            chkGroupBy.Enabled   = aggregate;
            if (!aggregate)
            {
                cmbAggregate.SelectedIndex = -1;
                chkGroupBy.Checked         = false;
            }

            if (attributes != null)
            {
                foreach (var attribute in attributes)
                {
                    AttributeItem.AddAttributeToComboBox(cmbAttribute, attribute, false, FetchXmlBuilder.friendlyNames);
                }
            }
        }
        private void RefreshAttributes()
        {
            if (!IsInitialized)
            {
                return;
            }
            cmbAttribute.Items.Clear();
            var entityNode = cmbEntity.SelectedItem is EntityNode ? (EntityNode)cmbEntity.SelectedItem : null;

            if (entityNode == null)
            {
                entityNode = new EntityNode(GetClosestEntityNode(Node));
            }
            if (entityNode == null)
            {
                return;
            }
            var entityName = entityNode.EntityName;

            if (fxb.NeedToLoadEntity(entityName))
            {
                if (!fxb.working)
                {
                    fxb.LoadEntityDetails(entityName, RefreshAttributes);
                }
                return;
            }
            BeginInit();
            var attributes = fxb.GetDisplayAttributes(entityName);

            attributes.ToList().ForEach(a => AttributeItem.AddAttributeToComboBox(cmbAttribute, a, true, FetchXmlBuilder.friendlyNames));
            // RefreshFill now that attributes are loaded
            ReFillControl(cmbAttribute);
            ReFillControl(cmbValue);
            EndInit();
            RefreshOperators();
            UpdateValueField();
            RefreshValueOf();
            NormalizeLike();
        }
        protected override void PopulateControls()
        {
            var aggregate = Node.IsFetchAggregate();

            if (!aggregate)
            {
                cmbAttribute.Items.Clear();
                if (attributes != null)
                {
                    foreach (var attribute in attributes)
                    {
                        AttributeItem.AddAttributeToComboBox(cmbAttribute, attribute, false, friendly);
                    }
                }
            }
            else
            {
                cmbAlias.Items.Clear();
                cmbAlias.Items.Add("");
                cmbAlias.Items.AddRange(GetAliases(Tree.tvFetch.Nodes[0]).ToArray());
            }
            cmbAttribute.Enabled = !aggregate;
            cmbAlias.Enabled     = aggregate;
        }
        private void PopulateControls(TreeNode node, AttributeMetadata[] attributes)
        {
            var aggregate = FetchXmlBuilder.IsFetchAggregate(node);

            if (!aggregate)
            {
                cmbAttribute.Items.Clear();
                if (attributes != null)
                {
                    foreach (var attribute in attributes)
                    {
                        AttributeItem.AddAttributeToComboBox(cmbAttribute, attribute, false, friendly);
                    }
                }
            }
            else
            {
                cmbAlias.Items.Clear();
                cmbAlias.Items.Add("");
                cmbAlias.Items.AddRange(GetAliases(form.tvFetch.Nodes[0]).ToArray());
            }
            cmbAttribute.Enabled = !aggregate;
            cmbAlias.Enabled     = aggregate;
        }