public void GetMessageUrlTest()
        {
            string uniqueID = string.Empty;             // TODO: Initialize to an appropriate value
            string expected = string.Empty;             // TODO: Initialize to an appropriate value
            string actual;

            actual = PageUrlManager.GetMessageUrl(uniqueID);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        /// Renders the contents of the control to the specified writer.
        /// </summary>
        /// <param name="writer">A <see cref="HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param>
        protected override void RenderContents(HtmlTextWriter writer)
        {
            // header row
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "ms-viewheadertr");
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);
            // description
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "tollingEvent");
            writer.RenderBeginTag(HtmlTextWriterTag.Th);
            writer.Write("Event Description");
            writer.RenderEndTag(); // Th
            // start date
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "tollingStartDate");
            writer.RenderBeginTag(HtmlTextWriterTag.Th);
            writer.Write("Start Date");
            writer.RenderEndTag(); // Th
            // end date
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "tollingEndDate");
            writer.RenderBeginTag(HtmlTextWriterTag.Th);
            writer.Write("End Date");
            writer.RenderEndTag(); // Th
            // end reason
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "tollingEndReason");
            writer.RenderBeginTag(HtmlTextWriterTag.Th);
            writer.Write("End Reason");
            writer.RenderEndTag(); // Th
            // tolling days
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "tollingDays");
            writer.RenderBeginTag(HtmlTextWriterTag.Th);
            writer.Write("# of Days");
            writer.RenderEndTag(); // Th
            // due date
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "dueDate");
            writer.RenderBeginTag(HtmlTextWriterTag.Th);
            writer.Write("Due Date");
            writer.RenderEndTag(); // Th
            writer.RenderEndTag(); // Tr

            if (_viewState == null || _viewState.Events.Count == 0)
            {
                // empty data message
                if (this.Visible = this.EmptyVisible)
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                    writer.AddAttribute(HtmlTextWriterAttribute.Colspan, "7");
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "emptydata");
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    writer.Write(this.EmptyDataText);
                    writer.RenderEndTag(); // Td
                    writer.RenderEndTag(); // Tr
                }
            }
            else
            {
                foreach (var e in _viewState.Events)
                {
                    string description = Page.Server.HtmlEncode(e.Description);
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                    // description
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "tollingEvent cp-DownloadLink");
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    if (string.IsNullOrEmpty(e.MessageID))
                    {
                        writer.Write("<span class=\"nolink\">{0}</span>", description);
                    }
                    else
                    {
                        writer.Write("<a class=\"pdf-file\" href=\"{0}\" title=\"{1}\">{1}</a>", PageUrlManager.GetMessageUrl(e.MessageID), description);
                    }
                    writer.RenderEndTag(); // Td
                    // start date
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "tollingStartDate");
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    writer.Write(e.StartDate.ToString("d"));
                    writer.RenderEndTag(); // Td
                    // end date
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "tollingEndDate");
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    writer.Write(e.EndDate.HasValue ? e.EndDate.Value.ToString("d") : this.OngoingEndDateText);
                    writer.RenderEndTag(); // Td
                    // end reason
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "tollingEndReason");
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    writer.Write(e.EndReason);
                    writer.RenderEndTag(); // Td
                    // tolling days
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "tollingDays");
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    writer.Write(e.TollingDays);
                    writer.RenderEndTag(); // Td
                    // due date
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "dueDate");
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    if (e.Deadline.HasValue)
                    {
                        writer.Write(e.Deadline.Value.ToString("d"));
                    }
                    writer.RenderEndTag(); // Td
                    writer.RenderEndTag(); // Tr
                }
            }
        }
        /// <summary>
        /// Renders the contents of the control to the specified writer.
        /// </summary>
        /// <param name="writer">A <see cref="HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param>
        protected override void RenderContents(HtmlTextWriter writer)
        {
            // opening <table> tag
            writer.AddAttribute(HtmlTextWriterAttribute.Border, "0");
            writer.RenderBeginTag(HtmlTextWriterTag.Table);

            // <caption>
            writer.RenderBeginTag(HtmlTextWriterTag.Caption);
            writer.Write(this.Title);
            writer.RenderEndTag();

            // issuance date row
            bool hasMessage = !string.IsNullOrEmpty(this.MessageID);

            writer.RenderBeginTag(HtmlTextWriterTag.Tr);
            writer.RenderBeginTag(HtmlTextWriterTag.Th);
            writer.Write(this.SentTitle);
            writer.RenderEndTag();
            if (hasMessage && this.SentDate.HasValue)
            {
                // render date with CMO message link
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "cp-DownloadLink");
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "pdf-file");
                writer.AddAttribute(HtmlTextWriterAttribute.Href, PageUrlManager.GetMessageUrl(this.MessageID));
                writer.AddAttribute(HtmlTextWriterAttribute.Title, "View " + this.Title);
                writer.RenderBeginTag(HtmlTextWriterTag.A);
                writer.Write(this.SentDate.Value.ToShortDateString());
                writer.RenderEndTag();
                writer.RenderEndTag();
            }
            else
            {
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.Write(this.NoFindingsOverride ? this.NoReportText : this.SentDate.HasValue ? this.SentDate.Value.ToShortDateString() : this.NotYetIssuedText);
                writer.RenderEndTag();
            }
            writer.RenderEndTag();

            if (this.SecondSentVisible)
            {
                // second issuance date row
                writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                writer.RenderBeginTag(HtmlTextWriterTag.Th);
                writer.Write(this.SecondSentTitle);
                writer.RenderEndTag();
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.Write("{0:d}", this.SecondSentDate);
                writer.RenderEndTag();
                writer.RenderEndTag();
            }

            if (this.ResponseVisible)
            {
                // response due date row
                writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                writer.RenderBeginTag(HtmlTextWriterTag.Th);
                writer.Write("Response Due");
                writer.RenderEndTag();
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                if (!this.ResponseDate.HasValue && DateTime.Today > this.DueDate)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "alert");
                }
                if (!this.ResponseDate.HasValue)
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Strong);
                }
                writer.Write("{0:d}", this.DueDate);
                if (!this.ResponseDate.HasValue)
                {
                    writer.RenderEndTag();
                }
                writer.RenderEndTag();
                writer.RenderEndTag();

                // response received date row
                writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                writer.RenderBeginTag(HtmlTextWriterTag.Th);
                writer.Write("Response Received");
                writer.RenderEndTag();
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                if (this.ResponseDate.HasValue)
                {
                    writer.Write("{0:d}", this.ResponseDate);
                }
                else
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "alert");
                    writer.RenderBeginTag(HtmlTextWriterTag.Span);
                    writer.Write(this.ResponseNotReceivedText);
                    writer.RenderEndTag();
                }
                writer.RenderEndTag();
                writer.RenderEndTag();
            }

            // postmark date row
            if (this.PostmarkVisible)
            {
                writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                writer.RenderBeginTag(HtmlTextWriterTag.Th);
                writer.Write("Response Postmarked");
                writer.RenderEndTag();
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.Write("{0:d}", this.PostmarkDate);
                writer.RenderEndTag();
                writer.RenderEndTag();
            }

            // closing </table> tag
            writer.RenderEndTag();
        }
        /// <summary>
        /// Raises the <see cref="GridView.RowDataBound"/> event.
        /// </summary>
        /// <param name="e">A <see cref="GridViewRowEventArgs"/> that contains the event data.</param>
        protected override void OnRowDataBound(GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                DoingBusinessReview dbr         = e.Row.DataItem as DoingBusinessReview;
                StatementReview     sr          = e.Row.DataItem as StatementReview;
                ComplianceVisit     cv          = e.Row.DataItem as ComplianceVisit;
                AuditReviewBase     review      = e.Row.DataItem as AuditReviewBase;
                int responseReceivedColumnIndex = cv != null ? 3 : 2;
                int numColumnIndex = 0;
                if (this.AllowGrouping)
                {
                    responseReceivedColumnIndex++;
                    numColumnIndex++;
                }

                // number details
                if (dbr != null)
                {
                    e.Row.Cells[numColumnIndex].Text = string.Format("{0} ({1:d})", dbr.Number, dbr.Statement.DueDate);
                }
                else if (sr != null)
                {
                    e.Row.Cells[numColumnIndex].Text = string.Format("{0} ({1:d})", sr.Number, sr.Statement.DueDate);
                }
                if (review != null)
                {
                    if (review.ResponseRequired)
                    {
                        // response deadline
                        ResponseDeadlineBase deadline = review.ResponseDeadline;
                        if (deadline.ExtensionGranted)
                        {
                            if (deadline.ExtensionDate.HasValue)
                            {
                                e.Row.Cells[responseReceivedColumnIndex].Text = string.Format("{0:MM/dd/yyyy}<br />Originally due {1:MM/dd/yyyy}<br />Extension granted {2:MM/dd/yyyy}", deadline.Date, deadline.OriginalDueDate, deadline.ExtensionDate);
                            }
                            else
                            {
                                e.Row.Cells[responseReceivedColumnIndex].Text = string.Format("{0:d}<br />Originally due {1:d}<br />Extensions granted: {2}", deadline.Date, deadline.OriginalDueDate, deadline.ExtensionNumber);
                            }
                        }
                        else
                        {
                            e.Row.Cells[responseReceivedColumnIndex].Text = string.Format(this.DateFormat, deadline.Date);
                        }

                        // response status
                        e.Row.Cells[responseReceivedColumnIndex + 1].Text = review.ResponseReceived ? (dbr != null ? Properties.Resources.ResponseReceivedText : string.Format(this.ResponseReceivedFormat, review.ResponseReceivedDate)) : this.ResponseNotReceivedText;

                        // response extension - disabled indefinitely
                        //string.Format("{0} <a href=\"{1}\" title=\"Request Response Extension\">(Request Extension)</a>", this.ResponseNotReceivedText, PageUrlManager.GetExtensionRequestUrl(ExtensionType.StatementReview, sr.StatementNumber));
                        //string.Format("{0} {1}", this.ResponseNotReceivedText, MakeExtensionRequestLink(ExtensionType.ComplianceVisitReview, cv.Number));
                    }
                    else
                    {
                        e.Row.Cells[responseReceivedColumnIndex].Text = e.Row.Cells[responseReceivedColumnIndex + 1].Text = this.NoResponseRequiredText;
                    }

                    // add link to view CMO message if available
                    string messageID;
                    if (this.MessageIDDataSource != null && this.MessageIDDataSource.TryGetValue(review.Number, out messageID))
                    {
                        e.Row.Cells[responseReceivedColumnIndex + 2].Text = string.Format("<a class=\"pdf-file\" href=\"{0}\" title=\"{1}\">{1}</a>", PageUrlManager.GetMessageUrl(messageID), "View Review");
                    }
                }
            }
        }
        /// <summary>
        /// Raises the <see cref="Control.DataBinding"/> event.
        /// </summary>
        /// <param name="e">An <see cref="EventArgs"/> object that contains the event data.</param>
        protected override void OnDataBinding(EventArgs e)
        {
            _rowsArray.Clear();
            string cid = CPProfile.Cid;

            // generate HTML for each public funds determination record
            foreach (PublicFundsDetermination item in this.DataSource)
            {
                string downloadLink = item.MessageID > 0 ? string.Format("<a class=\"pdf-file\" href=\"{0}\" title=\"{1}\">{1}</a>", PageUrlManager.GetMessageUrl(CmoMessage.ToUniqueID(cid, item.MessageID)), "View Letter") : null;
                if (item.PaymentIssued)
                {
                    _rowsArray.Add(string.Format(PaymentRowHtmlTemplate, item.Date, item.PaymentAmount, CPConvert.ToString(item.PaymentMethod), CPConvert.ToString(item.ElectionType), downloadLink));
                }
                else
                {
                    _rowsArray.Add(string.Format(NonPaymentRowHtmlTemplate, item.Date, CPConvert.ToString(item.ElectionType), downloadLink));
                }
            }

            // generate HTML for public funds summary
            _footerHtml = string.Format(FooterHtmlTemplate, this.DataSource.PaymentCount, this.DataSource.TotalPaymentAmount);
        }