Exemplo n.º 1
0
        protected override void ShowSettings()
        {
            pnlConfigure.Visible = true;

            txtVisualizationTitle.Text = GetAttributeValue("Title");

            // Load groups
            List <Bucket> groupList    = GetAttributeValue("Buckets").FromJsonOrNull <List <Bucket> >() ?? new List <Bucket>();
            var           groupListIds = from Bucket b in groupList select b.Id;
            var           groups       = new GroupService(new RockContext())
                                         .Queryable()
                                         .Where(g => groupListIds.Any((id) => id == g.Id))
                                         .ToList();

            dvGroup.SetValues(groups);

            tbSummaryLava.Text            = GetAttributeValue("SummaryLava");
            ddlDefaultStyle.SelectedValue = GetAttributeValue("Style");
            tbEntityUrl.Text    = GetAttributeValue("EntityUrl");
            tbGroupViewUrl.Text = GetAttributeValue("GroupViewUrl");

            mdConfigure.Show();

            BucketDetailsControl.buckets = groupList;
            BucketDetailsControl.Refresh();

            FilterControl.EntityTypeId  = GetAttributeValue("EntityTypeId").AsInteger();
            FilterControl.ShowFilterKey = GetAttributeValue("ShowFilterKey").AsBoolean();
            FilterControl.filters       = filters;
            FilterControl.Refresh();

            upnlContent.Update();
        }
        protected override void ShowSettings()
        {
            pnlConfigure.Visible = true;

            txtVisualizationTitle.Text = GetAttributeValue("Title");

            //var allowedEntities = new List<int>
            //{
            //    15, // Person
            //    16, // Group
            //    113, // Workflow
            //    240, // Connection Request
            //    258, // Registration
            //    313 //Registration Registrant
            //};

            etpEntityType.EntityTypes = new EntityTypeService(new RockContext())
                                        .Queryable()
                                        .OrderBy(t => t.FriendlyName).ToList();
            etpEntityType.SelectedEntityTypeId = GetAttributeValue("EntityTypeId").AsInteger();

            tbEntityUrl.Text   = GetAttributeValue("EntityUrl");
            tbDataViewUrl.Text = GetAttributeValue("DataViewUrl");
            tbSummaryLava.Text = GetAttributeValue("SummaryLava");

            dvBucket1.EntityTypeId = GetAttributeValue("EntityTypeId").AsInteger();
            dvBucket2.EntityTypeId = GetAttributeValue("EntityTypeId").AsInteger();
            dvBucket3.EntityTypeId = GetAttributeValue("EntityTypeId").AsInteger();

            // Load Data Views
            Bucket bucket1 = GetAttributeValue("Bucket1").FromJsonOrNull <Bucket>();
            Bucket bucket2 = GetAttributeValue("Bucket2").FromJsonOrNull <Bucket>();
            Bucket bucket3 = GetAttributeValue("Bucket3").FromJsonOrNull <Bucket>();

            if (bucket1 != null)
            {
                dvBucket1.SetValue(bucket1.Id);
                tbBucket1Color.Text = bucket1.Color;
            }
            if (bucket2 != null)
            {
                dvBucket2.SetValue(bucket2.Id);
                tbBucket2Color.Text = bucket2.Color;
            }
            if (bucket3 != null)
            {
                dvBucket3.SetValue(bucket3.Id);
                tbBucket3Color.Text = bucket3.Color;
            }

            mdConfigure.Show();

            FilterControl.EntityTypeId  = GetAttributeValue("EntityTypeId").AsInteger();
            FilterControl.ShowFilterKey = GetAttributeValue("ShowFilterKey").AsBoolean();
            FilterControl.filters       = filters;
            FilterControl.Refresh();

            upnlContent.Update();
        }
        protected void etpEntityType_SelectedIndexChanged(object sender, EventArgs e)
        {
            dvBucket1.SetValue(null);
            dvBucket1.EntityTypeId = etpEntityType.SelectedEntityTypeId;
            dvBucket2.SetValue(null);
            dvBucket2.EntityTypeId = etpEntityType.SelectedEntityTypeId;
            dvBucket3.SetValue(null);
            dvBucket3.EntityTypeId = etpEntityType.SelectedEntityTypeId;

            FilterControl.EntityTypeId = etpEntityType.SelectedEntityTypeId ?? 0;
            FilterControl.filters      = filters;
            FilterControl.Refresh();

            persistForm();
        }
        protected void etpEntityType_SelectedIndexChanged(object sender, EventArgs e)
        {
            dvDataViewBucketPicker.ClearSelection();
            dvDataViewBucketPicker.EntityTypeId = etpEntityType.SelectedEntityTypeId;

            buckets = new List <Bucket>();
            filters = new Dictionary <string, Filter>();

            BucketDetailsControl.buckets = buckets;
            BucketDetailsControl.Refresh();
            upnlBuckets.Update();

            FilterControl.EntityTypeId = etpEntityType.SelectedEntityTypeId ?? 0;
            FilterControl.filters      = filters;
            FilterControl.Refresh();
        }
        protected override void ShowSettings()
        {
            pnlConfigure.Visible = true;

            txtVisualizationTitle.Text = GetAttributeValue("Title");

            etpEntityType.EntityTypes = new EntityTypeService(new RockContext())
                                        .Queryable()
                                        .OrderBy(t => t.FriendlyName).ToList();
            etpEntityType.SelectedEntityTypeId  = GetAttributeValue("EntityTypeId").AsInteger();
            dvDataViewBucketPicker.EntityTypeId = GetAttributeValue("EntityTypeId").AsInteger();

            // Load Data Views
            List <Bucket> buckets          = GetAttributeValue("Buckets").FromJsonOrNull <List <Bucket> >() ?? new List <Bucket>();
            var           dataViewsOptions = from ListItem li in dvDataViewBucketPicker.Items
                                             where buckets.Any((bucket) => { return(bucket.Id == li.Value.AsInteger()); })
                                             select li;

            foreach (ListItem li in dataViewsOptions)
            {
                li.Selected = true;
            }

            tbSummaryLava.Text            = GetAttributeValue("SummaryLava");
            ddlDefaultStyle.SelectedValue = GetAttributeValue("Style");
            tbEntityUrl.Text   = GetAttributeValue("EntityUrl");
            tbDataViewUrl.Text = GetAttributeValue("DataViewUrl");

            mdConfigure.Show();

            BucketDetailsControl.buckets = buckets;
            BucketDetailsControl.Refresh();
            upnlBuckets.Update();

            FilterControl.EntityTypeId  = GetAttributeValue("EntityTypeId").AsInteger();
            FilterControl.ShowFilterKey = GetAttributeValue("ShowFilterKey").AsBoolean();
            FilterControl.filters       = filters;
            FilterControl.Refresh();

            upnlContent.Update();
        }