Exemple #1
0
 /// <summary>
 /// Retrieves a generic collection of all C-SMART/IDS requests on record for the specified candidate and election cycle.
 /// </summary>
 /// <param name="candidateID">The ID of the candidate whose C-SMART/IDS requests are to be retrieved.</param>
 /// <param name="electionCycle">The election cycle in which to search.</param>
 /// <returns>A generic List collection of all C-SMART/IDS requests on record for the specified candidate and election cycle.</returns>
 public CsmartIdsRequestHistory GetCsmartIdsRequests(string candidateID, string electionCycle)
 {
     using (CsmartIdsRequestTds ds = new CsmartIdsRequestTds())
     {
         using (CsmartIdsRequestsTableAdapter ta = new CsmartIdsRequestsTableAdapter())
         {
             ta.Fill(ds.CsmartIdsRequests, candidateID, electionCycle);
         }
         CsmartIdsRequestHistory c = new CsmartIdsRequestHistory(ds.CsmartIdsRequests.Count);
         foreach (CsmartIdsRequestTds.CsmartIdsRequestsRow row in ds.CsmartIdsRequests.Rows)
         {
             c.Documents.Add(new CsmartIdsRequest(row.Number, row.LastUpdated)
             {
                 PageCount      = row.PageCount,
                 StatusReason   = CPConvert.ToDocumentStatusReason(row.ReasonCode.Trim()),
                 Status         = CPConvert.ToDocumentStatus(row.StatusCode.Trim()),
                 DeliveryType   = CPConvert.ToDeliveryType(row.DeliveryCode.Trim()),
                 SubmissionType = CPConvert.ToSubmissionType(row.SubmissionCode.Trim()),
                 ReceivedDate   = row.IsReceivedDateNull() ? null : row.ReceivedDate as DateTime?,
                 StatusDate     = row.IsStatusDateNull() ? null : row.StatusDate as DateTime?,
                 PostmarkDate   = row.IsPostmarkDateNull() ? null : row.PostmarkDate as DateTime?,
             });
         }
         return(c);
     }
 }
 /// <summary>
 /// Raises the <see mref="Load"/> event.
 /// </summary>
 /// <param name="args">An <see cref="EventArgs"/> object that contains the event data.</param>
 protected override void OnLoad(EventArgs args)
 {
     base.OnLoad(args);
     if (!Page.IsPostBack)
     {
         CsmartIdsRequestHistory cirh = CPProfile.CsmartIdsRequestHistory;
         if (cirh != null)
         {
             this.EnsureChildControls();
             this.DataSource = cirh.Documents;
             this.DataBind();
         }
     }
 }