Beispiel #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));
        }
Beispiel #2
0
        private void LoadOfficeControl(string officeKey = null)
        {
            var table = Elections.GetJurisdictionOfficeData(StateCode, CountyCode, LocalCode);

            OfficeControl.PopulateOfficeTree(table, OfficeControl.OfficeTree,
                                             StateCode, false, AdminPageLevel == AdminPageLevel.State,
                                             AdminPageLevel != AdminPageLevel.State,
                                             AdminPageLevel == AdminPageLevel.State);
            if (!string.IsNullOrWhiteSpace(officeKey))
            {
                OfficeControl.OfficeKey = officeKey;
            }
            OfficeControl.Update();
        }
            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);
                }
            }