コード例 #1
0
ファイル: Nags.aspx.cs プロジェクト: cloughin/VoteProject.5
        protected void NagControl_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                string msg;
                if (NagControl.SelectedValue == "T")
                {
                    DonationNagsControl.UpdateIsNaggingEnabled(true);
                    msg = "The Donation Nag Dialog has been ENABLED.";
                }
                else
                {
                    DonationNagsControl.UpdateIsNaggingEnabled(false);
                    msg = "The Donation Nag Dialog has been DISABLED.";
                }

                CommonCacheInvalidation.ScheduleInvalidateNagsAll();
                NagControlFeedback.AddInfo(msg);
                NagControlFeedback.AddInfo("It will take effect in 5 to 10 minutes.");
            }
            catch (Exception ex)
            {
                NagControlFeedback.AddError(
                    "The operation failed due to an unexpected error.");
                NagControlFeedback.HandleException(ex);
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsSuperUser)
            {
                Column1.Visible = false;
                Column2.AddCssClasses("wide");
            }

            if (!IsPostBack)
            {
                const string title = "Master Administration";
                Page.Title   = title;
                H1.InnerHtml = title;

                NoJurisdiction.CreateStateLinks("/admin/?state={StateCode}");
                NoJurisdiction.SetHead("Links to State Administration Pages");

                if (IsSuperUser)
                {
                    var sampleBallotDialogEnabled = DB.Vote.Master.GetPresentGetFutureSampleBallotsDialog(false);
                    var nagsEnabled = DonationNagsControl.GetIsNaggingEnabled(false);
                    if (!sampleBallotDialogEnabled || !nagsEnabled)
                    {
                        if (!sampleBallotDialogEnabled)
                        {
                            new HtmlP {
                                InnerText = "Ballot Choices Dialogs are disabled"
                            }
                        }
コード例 #3
0
ファイル: Nags.aspx.cs プロジェクト: cloughin/VoteProject.5
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Page.Title   = "Donation Nags and Ballot Choices Request Dialogs Control";
                H1.InnerHtml = "Donation Nags and Ballot Choices Request Dialogs Control";
                SampleBallotControl.SelectedValue =
                    DB.Vote.Master.GetPresentGetFutureSampleBallotsDialog(false) ? "T" : "F";
                NagControl.SelectedValue = DonationNagsControl.GetIsNaggingEnabled(false)
          ? "T"
          : "F";
            }

            BuildHtmlTable();
        }
コード例 #4
0
        //private static void InvalidateBallotAll()
        //{
        //  CacheBallotPages.TruncateTable();
        //}

        //private static void InvalidateBallotByDomainDesignCodeElectionKey(
        //  string domainDesignCode, string electionKey)
        //{
        //  CacheBallotPages.DeleteByDomainDesignCodeElectionKey(
        //    domainDesignCode, electionKey);
        //}

        //private static void InvalidateBallotByElectionKey(string electionKey)
        //{
        //  CacheBallotPages.DeleteByElectionKey(electionKey);
        //}

        //private static void InvalidateElectedAll()
        //{
        //  CacheElectedPages.TruncateTable();
        //}

        //private static void InvalidateElectedByStateCode(string stateCode)
        //{
        //  CacheElectedPages.DeleteByStateCode(stateCode);
        //}

        //private static void InvalidateElectionAll()
        //{
        //  CacheElectionPages.TruncateTable();
        //}

        //private static void InvalidateElectionByElectionKey(string electionKey)
        //{
        //  CacheElectionPages.DeleteByElectionKey(electionKey);
        //}

        //private static void InvalidateIntroAll()
        //{
        //  CacheIntroPages.TruncateTable();
        //}

        //private static void InvalidateIntroByPoliticianKey(string politicianKey)
        //{
        //  CacheIntroPages.DeleteByPoliticianKey(politicianKey);
        //}

        //private static void InvalidateIssueAll()
        //{
        //  CacheIssuePages.TruncateTable();
        //}

        //private static void InvalidateIssueByIssueKey(string issueKey)
        //{
        //  CacheIssuePages.DeleteByIssueKey(issueKey);
        //}

        //private static void InvalidateIssueByOfficeKey(string officeKey)
        //{
        //  CacheIssuePages.DeleteByOfficeKey(officeKey);
        //}

        //private static void InvalidateIssueByElectionKeyOfficeKey(
        //  string electionKey, string officeKey)
        //{
        //  CacheIssuePages.DeleteByElectionKeyOfficeKey(electionKey, officeKey);
        //}

        //private static void InvalidateIssueByOfficeKeyIssueKey(
        //  string officeKey, string issueKey)
        //{
        //  CacheIssuePages.DeleteByOfficeKeyIssueKey(officeKey, issueKey);
        //}

        //private static void InvalidateIssueByElectionKeyOfficeKeyIssueKey(
        //  string electionKey, string officeKey, string issueKey)
        //{
        //  CacheIssuePages.DeleteByElectionKeyOfficeKeyIssueKey(
        //    electionKey, officeKey, issueKey);
        //}

        //private static void InvalidateOfficialsAll()
        //{
        //  CacheOfficialsPages.TruncateTable();
        //}

        //private static void InvalidateOfficialsByStateCode(string stateCode)
        //{
        //  CacheOfficialsPages.DeleteByStateCode(stateCode);
        //}

        //private static void InvalidateOfficialsByStateCodeCountyCode(
        //  string stateCode, string countyCode)
        //{
        //  CacheOfficialsPages.DeleteByStateCodeCountyCode(stateCode, countyCode);
        //}

        //private static void InvalidateOfficialsByStateCodeCountyCodeLocalCode(
        //  string stateCode, string countyCode, string localCode)
        //{
        //  CacheOfficialsPages.DeleteByStateCodeCountyCodeLocalCode(
        //    stateCode, countyCode, localCode);
        //}

        private static void InvalidateNagsAll()
        {
            // copy the DonationNagsControl singleton from common to local
            DonationNagsControl.UpdateIsNaggingEnabled(
                DB.VoteCache.DonationNagsControl.GetIsNaggingEnabled(true));

            // copy the DonationNags table from common to local
            var table = DonationNags.GetAllData();

            DB.VoteCacheLocal.DonationNags.TruncateTable();
            foreach (var row in table)
            {
                DB.VoteCacheLocal.DonationNags.Insert(
                    messageNumber: row.MessageNumber, messageHeading: row.MessageHeading,
                    messageText: row.MessageText, nextMessageNumber: row.NextMessageNumber);
            }
        }