Esempio n. 1
0
        /// <summary>
        /// Raises the <see cref="Control.Load"/> event.
        /// </summary>
        /// <param name="e">An <see cref="EventArgs"/> object that contains the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            this.EnsureChildControls();
            // set up committee list
            _committeeList.Items.Clear();
            foreach (char id in _dsh.CommitteeNames.Keys)
            {
                _committeeList.Items.Add(new ListItem(string.Format("{0} ({1})", _dsh.CommitteeNames[id], id), id.ToString()));
            }
            // show default committee, else show first committee
            char?primaryID = AuthorizedCommittee.GetPrimaryCommitteeID(CPProfile.Cid, CPProfile.ElectionCycle);

            if (primaryID.HasValue)
            {
                ListItem item = _committeeList.Items.FindByValue(primaryID.Value.ToString());
                if (!object.Equals(item, null))
                {
                    item.Selected = true;
                    FilterByCommittee(null, null);
                }
            }
            else
            {
                _committeeList.SelectedIndex = 0;
                FilterByCommittee(null, null);
            }
        }
Esempio n. 2
0
        // GET: Filings/DisclosureStatements
        public ActionResult Index(char?committeeID, byte?statementNumber)
        {
            bool idSpecified = committeeID.HasValue || statementNumber.HasValue;
            var  data        = GetDisclosureStatementData();

            if (!committeeID.HasValue)
            {
                committeeID = AuthorizedCommittee.GetPrimaryCommitteeID(CPProfile.Cid, CPProfile.ElectionCycle);
            }
            if (committeeID.HasValue && data != null && data.CommitteeNames.ContainsKey(committeeID.Value))
            {
                var statements = data.CommitteeStatements[committeeID.Value].Values;
                if (statements.Any())
                {
                    return(Statement(committeeID.Value, statements.Max(s => s.Number)));
                }
            }
            return(View());
        }