Exemple #1
0
        private int PopulateOfficeTree(IList <DataRow> table)
        {
            var relatedJurisdictions =
                OfficeControl.CreateRelatedJurisdictionsNodes("/admin/updateElections.aspx",
                                                              "addcandidates", StateCode, CountyCode, LocalKey);

            return(OfficeControl.PopulateOfficeTree(table, OfficeControl.OfficeTree, StateCode,
                                                    false, false, true, AdminPageLevel == AdminPageLevel.State, relatedJurisdictions));
        }
            public override void LoadControl()
            {
                OfficeCount = 0;
                Elections.ActualizeElection(Page.GetElectionKey());
                var table = Elections.GetAvailableElectionOfficeData(Page.GetElectionKey(),
                                                                     Page.StateCode, Page.CountyCode, Page.LocalKey);

                if (table.Count == 0)
                {
                    Page.AddOfficesMessage.RemoveCssClass("hidden");
                    Page.AddOfficesControl.AddCssClasses("hidden");
                }
                else
                {
                    Page.AddOfficesMessage.AddCssClasses("hidden");
                    Page.AddOfficesControl.RemoveCssClass("hidden");
                    var relatedJurisdictions =
                        OfficeControl.CreateRelatedJurisdictionsNodes("/admin/updateElections.aspx",
                                                                      "addoffices", Page.StateCode, Page.CountyCode, Page.LocalKey);
                    OfficeCount = OfficeControl.PopulateOfficeTree(table,
                                                                   Page.PlaceHolderAddOfficesTree, Page.StateCode, true, false, true,
                                                                   Page.AdminPageLevel == AdminPageLevel.State, relatedJurisdictions);
                }
            }