Beispiel #1
0
        /// <summary>
        /// Determines whether or not a tolling event is an extension for a post election audit report.
        /// </summary>
        /// <param name="evt">The <see cref="ITollingEvent"/> to analyze.</param>
        /// <param name="report">The post election audit report to compare against.</param>
        /// <returns>true if the tolling event is an extension for the post election audit report specified; otherwise, false.</returns>
        public static bool IsExtensionFor(this ITollingEvent evt, AuditReportBase report)
        {
            // check basic properties
            if (report == null || evt == null || !evt.IsExtension || evt.TollingLetter == null)
            {
                return(false);
            }

            // check tolling source and, where applicable, reference event number
            switch (report.AuditReportType)
            {
            case AuditReportType.InitialDocumentationRequest:
                return(evt.TollingLetter.HasIdrScope);

            case AuditReportType.IdrInadequateResponse:
            case AuditReportType.IdrAdditionalInadequateResponse:
                IdrInadequateEvent idrInadequate = report as IdrInadequateEvent;
                return(idrInadequate != null && idrInadequate.TollingEventNumber == evt.ReferenceEventNumber && evt.TollingLetter.HasIdrInadequateScope);

            case AuditReportType.DraftAuditReport:
                return(evt.TollingLetter.HasDarScope);

            case AuditReportType.DarInadequateResponse:
            case AuditReportType.DarAdditionalInadequateResponse:
                DarInadequateEvent darInadequate = report as DarInadequateEvent;
                return(darInadequate != null && darInadequate.TollingEventNumber == evt.ReferenceEventNumber && evt.TollingLetter.HasDarInadequateScope);

            default:
                return(false);
            }
        }
 /// <summary>
 /// Creates a due date for a response to an Draft Audit Report Inadequate Response event.
 /// </summary>
 /// <param name="deadline">The due date for the response.</param>
 /// <param name="source">The corresponding inadequate event source.</param>
 /// <exception cref="ArgumentNullException"><paramref name="source"/> is null or has a null statement.</exception>
 /// <exception cref="ArgumentException"><paramref name="source"/> has not been sent.</exception>
 public DarInadequateDeadline(DateTime deadline, DarInadequateEvent source)
     : this(deadline, source != null && source.IsAdditional)
 {
     if (source == null)
     {
         throw new ArgumentNullException("source", "Source Draft Audit Report Inadequate Event cannot be null.");
     }
     this.ReviewSentDate = source.SentDate;
 }