コード例 #1
0
        // ReSharper disable MemberCanBePrivate.Global
        // ReSharper disable MemberCanBeProtected.Global
        // ReSharper disable UnusedMember.Global
        // ReSharper disable UnusedMethodReturnValue.Global
        // ReSharper disable UnusedAutoPropertyAccessor.Global
        // ReSharper disable UnassignedField.Global

        #endregion ReSharper disable

        public static Control GetReport(string electionKey, string officeKey)
        {
            var dataTable   = Issues.GetIssuePageIssues(electionKey, officeKey);
            var placeHolder = new PlaceHolder();

            foreach (DataRow row in dataTable.Rows)
            {
                var    issueKey = row.IssueKey();
                var    issue    = row.Issue();
                string title;
                if (issueKey.EndsWith("IssuesList", StringComparison.Ordinal))
                {
                    title =
                        "Complete list of issues and issue questions available for candidates' responses.";
                }
                else if (issueKey == "ALLBio")
                {
                    title = "Biographical comparison of candidates";
                }
                else
                {
                    title =
                        string.Format(
                            "Comparisons of positions and views of the candidates on {0}", issue);
                }
                if (placeHolder.Controls.Count > 0)
                {
                    new Literal {
                        Text = " | "
                    }
                }