Пример #1
0
 public PSInvoice(ApiInvoice invoice)
 {
     if (invoice != null)
     {
         this.Id   = invoice.Id;
         this.Type = invoice.Type;
         this.Name = invoice.Name;
         this.InvoicePeriodStartDate = invoice.InvoicePeriodStartDate;
         this.InvoicePeriodEndDate   = invoice.InvoicePeriodEndDate;
         if (invoice.DownloadUrl != null)
         {
             this.DownloadUrl = invoice.DownloadUrl.Url;
             if (invoice.DownloadUrl.ExpiryTime.HasValue)
             {
                 this.DownloadUrlExpiry = invoice.DownloadUrl.ExpiryTime.Value.ToLocalTime();
             }
         }
     }
 }
Пример #2
0
 public PSInvoice(ApiInvoice invoice)
 {
     if (invoice != null)
     {
         this.Id   = invoice.Id;
         this.Type = invoice.Type;
         this.Name = invoice.Name;
         this.InvoicePeriodStartDate = invoice.InvoicePeriodStartDate;
         this.InvoicePeriodEndDate   = invoice.InvoicePeriodEndDate;
         if (invoice.DownloadUrl != null)
         {
             this.DownloadUrl       = invoice.DownloadUrl.Url;
             this.DownloadUrlExpiry = invoice.DownloadUrl.ExpiryTime;
         }
         if (invoice.BillingPeriodIds != null)
         {
             this.BillingPeriodNames = invoice.BillingPeriodIds.Select(x => Utilities.GetResourceNameFromId(x)).ToList();
         }
     }
 }