Example #1
0
        private void cbGroup_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbGroup.SelectedItem == null)
            {
                return;
            }
            var selectedGroup = ((GroupProxy)cbGroup.SelectedItem).Value;

            tbGrpId.Text = selectedGroup.Id;

            cbPage.Items.Clear();
            tbPbiPage.Text = "";

            cbReport.Items.Clear();
            tbReportId.Text = "";

            foreach (var report in selectedGroup.Reports)
            {
                var reportProxy = new ReportProxy
                {
                    Text  = report.Name,
                    Value = report
                };
                cbReport.Items.Add(reportProxy);
            }
        }
Example #2
0
        public void InitializeDropdowns(string groupId, string reportId, string pageName)
        {
            if (cbGroup.Items.Count == 0)
            {
                return;
            }
            foreach (GroupProxy group in cbGroup.Items)
            {
                if (@group.Value.Id.ToUpper() != groupId.ToUpper())
                {
                    continue;
                }
                cbGroup.SelectedItem = group;

                cbReport.Items.Clear();
                foreach (var report in group.Value.Reports)
                {
                    var reportProxy = new ReportProxy
                    {
                        Text  = report.Name,
                        Value = report
                    };
                    cbReport.Items.Add(reportProxy);
                }
                break;
            }

            foreach (ReportProxy report in cbReport.Items)
            {
                if (report.Value.Id.ToUpper() != reportId.ToUpper())
                {
                    continue;
                }
                cbReport.SelectedItem = report;

                cbPage.Items.Clear();
                foreach (var page in report.Value.Pages)
                {
                    var pageProxy = new PageProxy
                    {
                        Text  = page.DisplayName,
                        Value = page
                    };
                    cbPage.Items.Add(pageProxy);
                }
                break;
            }

            foreach (PageProxy page in cbPage.Items)
            {
                if (page.Value.Name != pageName)
                {
                    continue;
                }

                cbPage.SelectedItem = page;
                break;
            }
        }