Example #1
0
        /// <summary>
        /// Converts a post election audit report type to its CFIS code equivalent.
        /// </summary>
        /// <param name="type">The post election audit report type to convert.</param>
        /// <returns>A CFIS code corresponding to the post election type specified by <paramref name="type"/>.</returns>
        public static string ToCfisCode(AuditReportType type)
        {
            switch (type)
            {
            case AuditReportType.InitialDocumentationRequest:
                return("IDRREQ");

            case AuditReportType.IdrInadequateResponse:
                return("DOCINA");

            case AuditReportType.IdrAdditionalInadequateResponse:
            case AuditReportType.DarAdditionalInadequateResponse:
                return("ADDINA");

            case AuditReportType.DraftAuditReport:
                return("DARRPT");

            case AuditReportType.DarInadequateResponse:
                return("DARINS");

            case AuditReportType.FinalAuditReport:
                return("FARRPT");

            default:
                return(string.Empty);
            }
        }
        private AuditReportBase GetReport(AuditReportType type)
        {
            string          key    = string.Join(type.GetType().FullName, "_", type.ToString());
            AuditReportBase report = null;

            if (ViewData.ContainsKey(key))
            {
                report = ViewData[key] as AuditReportBase;
            }
            if (report == null)
            {
                switch (type)
                {
                case AuditReportType.InitialDocumentationRequest:
                    report = CPProfile.InitialDocumentationRequest;
                    break;

                case AuditReportType.DraftAuditReport:
                    report = CPProfile.DraftAuditReport;
                    break;

                case AuditReportType.FinalAuditReport:
                    report = CPProfile.FinalAuditReport;
                    break;
                }
                if (report != null)
                {
                    ViewData[key] = report;
                }
            }
            return(report);
        }
Example #3
0
        /// <summary>
        /// Converts the value of the specified <see cref="AuditReportType"/> to its equivalent <see cref="String"/> representation.
        /// </summary>
        /// <param name="type">An election type.</param>
        /// <returns>The <see cref="String"/> equivalent of the value of <paramref name="type"/>.</returns>
        public static string ToString(AuditReportType type)
        {
            switch (type)
            {
            case AuditReportType.InitialDocumentationRequest:
                return("Request for Documentation");

            case AuditReportType.IdrInadequateResponse:
                return("Request for Documentation—Inadequate Response Notice");

            case AuditReportType.IdrAdditionalInadequateResponse:
                return("Request for Documentation—Additional Inadequate Response Notice");

            case AuditReportType.DraftAuditReport:
                return("Draft Audit Report");

            case AuditReportType.DarInadequateResponse:
                return("Draft Audit Report—Inadequate Response Notice");

            case AuditReportType.DarAdditionalInadequateResponse:
                return("Draft Audit Report—Additional Inadequate Response Notice");

            case AuditReportType.FinalAuditReport:
                return("Final Audit Report");

            default:
                return(string.Empty);
            }
        }
Example #4
0
        /// <summary>
        /// Gets the URL for navigating to a post election audit report page.
        /// </summary>
        /// <param name="type">The type of post election audit report to navigate to.</param>
        /// <returns>The URL for the post election audit report indicated by <paramref name="type"/>.</returns>
        public static string GetPostElectionAuditReportUrl(AuditReportType type)
        {
            // group audit report types
            switch (type)
            {
            case AuditReportType.IdrInadequateResponse:
            case AuditReportType.IdrAdditionalInadequateResponse:
                type = AuditReportType.InitialDocumentationRequest;
                break;

            case AuditReportType.DarInadequateResponse:
            case AuditReportType.DarAdditionalInadequateResponse:
                type = AuditReportType.DraftAuditReport;
                break;
            }
            return(string.Format("{0}?{1}", PageUrlManager.PostElectionPageUrl, QueryStringManager.MakeQueryString(auditReportType: type).ToQueryString(HttpContext.Current != null ? HttpContext.Current.Server : null)));
        }
        public ActionResult StageSummary(AuditReportType id)
        {
            var stage = GetReport(id);
            var model = AuditViewModelFactory.PostElectionSummaryFrom(stage, CmoAuditReview.GetAuditReportMessageIDs(CPProfile.Cid, CPProfile.ElectionCycle));

            if (stage == null)
            {
                // check for no findings condition
                if (CPProfile.HasFinalAuditReport)
                {
                    model.ReportResponse = AuditViewModelFactory.NoFindingsResponse();
                }
                else
                {
                    return(HttpNotFound());
                }
            }
            return(PartialView(Mvc.Strings.Views.PostElectionSummary, model));
        }
Example #6
0
        /// <summary>
        /// Handles the <see cref="TollingEventsList.UpdateDataSources"/> event.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">An <see cref="EventArgs"/> object that contains the event data.</param>
        protected void _tollingEventsList_UpdateDataSources(object sender, EventArgs e)
        {
            // tolling events list
            ScriptManager sm = ScriptManager.GetCurrent(this);

            if (!Page.IsPostBack || !this.IsDataBound || !_tollingEventsList.EnableViewState || (sm != null && sm.IsInAsyncPostBack))
            {
                AuditReportType type = _postElectionAuditNavigation.SelectedReportType;
                _tollingEventsList.Title = string.Format("{0} Tolling Event Details", _tollingEventsList.DisplayAllEvents ? "All" : CPConvert.ToString(type));
                switch (type)
                {
                case AuditReportType.FinalAuditReport:
                    _tollingEventsList.DataSource         = GetTollingEvents(_dar);
                    _tollingEventsList.MessagesDataSource = CmoAuditReview.GetTollingMessageIDs(CPProfile.Cid, CPProfile.ElectionCycle, true);
                    if (_tollingEventsList.DisplayAllEvents)
                    {
                        IncludeEvents(false);
                    }
                    break;

                case AuditReportType.DraftAuditReport:
                    _tollingEventsList.DataSource         = GetTollingEvents(_idr);
                    _tollingEventsList.MessagesDataSource = CmoAuditReview.GetTollingMessageIDs(CPProfile.Cid, CPProfile.ElectionCycle, false);
                    if (_tollingEventsList.DisplayAllEvents)
                    {
                        IncludeEvents(true);
                    }
                    break;

                default:
                    _tollingEventsList.DataSource         = GetTollingEvents(_idr);
                    _tollingEventsList.MessagesDataSource = CmoAuditReview.GetTollingMessageIDs(CPProfile.Cid, CPProfile.ElectionCycle, false);
                    if (_tollingEventsList.DisplayAllEvents)
                    {
                        IncludeEvents(true);
                    }
                    break;
                }
            }
        }
        public ActionResult TollingEvents(AuditReportType id = AuditReportType.FinalAuditReport)
        {
            AuditReportBase source       = null,
                            secondSource = null;

            switch (id)
            {
            case AuditReportType.InitialDocumentationRequest:
                source = GetReport(AuditReportType.InitialDocumentationRequest);
                break;

            case AuditReportType.DraftAuditReport:
                source = GetReport(AuditReportType.DraftAuditReport);
                break;

            case AuditReportType.FinalAuditReport:
                source       = GetReport(AuditReportType.InitialDocumentationRequest);
                secondSource = GetReport(AuditReportType.DraftAuditReport);
                break;
            }
            return(PartialView(Mvc.Strings.Views.TollingEvents, AuditViewModelFactory.TollingEventsListFrom(source, CmoAuditReview.GetTollingMessageIDs(CPProfile.Cid, CPProfile.ElectionCycle, false), secondSource)));
        }
Example #8
0
 /// <summary>
 /// Gets the calendar item ID for a post election audit item.
 /// </summary>
 /// <param name="type">The item's associated post election audit report type.</param>
 /// <returns>The calendar item ID for the specified post election audit type.</returns>
 private static NameValueCollection GetPostElectionAuditItemID(AuditReportType type)
 {
     return(QueryStringManager.MakeQueryString(auditReportType: type));
 }