예제 #1
0
        private static bool IsValidIssue(string issueKey, string stateCode)
        {
            if (Is_Valid_Issue(issueKey))

            #region Check StateCode in IssueKey match StateCode for page

            {
                switch (Issues.GetIssueLevelFromKey(issueKey.ToUpper()))
                {
                case "A": //All Offices
                    return(Issues.GetStateCodeFromKey(issueKey) == "LL");

                case "B": //National issues
                    return(Issues.GetStateCodeFromKey(issueKey) == "US");

                case "C": //State Issues
                    return(Issues.GetStateCodeFromKey(issueKey) == stateCode);

                case "D": //County Issues
                    return(Issues.GetStateCodeFromKey(issueKey) == stateCode);

                case "E": //Local Issues
                    return(Issues.GetStateCodeFromKey(issueKey) == stateCode);

                default:
                    return(false);
                }
            }

            #endregion Check StateCode in IssueKey match StateCode for page

            return(false);
        }
예제 #2
0
        public static string Issues_List(string issueKey)
        {
            if (IsNullOrEmpty(issueKey))
            {
                return(Empty);
            }
            var issueLevel = Issues.GetIssueLevelFromKey(issueKey);
            var stateCode  = IssueGroup_IssueKey(issueKey); //LL, US or StateCode

            return(issueLevel + stateCode + "IssuesList");
        }
예제 #3
0
        private void Page_Load(object sender, EventArgs e)
        {
            _IssueKey    = QueryIssue;
            _IssueLevel  = Issues.GetIssueLevelFromKey(_IssueKey);
            _QuestionKey = QueryQuestion;
            _IssuesGroup = GetQueryString("Group");

            if (IsNullOrWhiteSpace(_IssuesGroup) || IsNullOrWhiteSpace(_IssueKey))
            {
                HandleFatalError("The IssueGroup and/or IssueKey is missing");
            }

            if (IsPostBack)
            {
                var questionKey = ViewState["QuestionKey"] as string;
                if (!IsNullOrEmpty(questionKey))
                {
                    _QuestionKey = questionKey;
                }
            }
            else
            {
                Title = H1.InnerText = "Questions";

                try
                {
                    PageTitle.Text = PageTitleForQuestions(_IssuesGroup,
                                                           _IssueKey, _IssueLevel);

                    HyperLinkReport.NavigateUrl =
                        $"/Admin/IssuesReport.aspx?IssueLevel={_IssueLevel}&Group={_IssuesGroup}";


                    if (QueryQuestion == Empty)
                    {
                        #region From: /Admin/Issues.aspx

                        ClearControls();
                        ButtonUpdate.Visible = false;

                        #endregion
                    }
                    else
                    {
                        #region From: Table of Questions at bottom of this page

                        LoadControls();
                        Msg.Text =
                            Message("You can now either: (1) change the Order or Question" + " and click Update" +
                                    " or (2) chage the Status by clicking a radio button" +
                                    " or (3) click Clear to clear the order and topic question in preparation to Add a Question.");

                        ButtonUpdate.Visible = true;
                        ButtonAdd.Visible    = false;

                        #endregion
                    }

                    ShowQuestions();
                }
                catch (Exception ex)
                {
                    #region

                    Msg.Text = Fail(ex.Message);
                    LogAdminError(ex);

                    #endregion
                }
            }
        }