示例#1
0
 public Silanis.ESL.SDK.DelegationReport DownloadDelegationReport(string senderId, DateTime from, DateTime to)
 {
     try
     {
         string path     = BuildDelegationReportUrl(senderId, from, to);
         string response = restClient.Get(path);
         Silanis.ESL.API.DelegationReport apiDelegationReport = JsonConvert.DeserializeObject <Silanis.ESL.API.DelegationReport>(response, settings);
         return(new DelegationReportConverter(apiDelegationReport).ToSDKDelegationReport());
     }
     catch (EslServerException e)
     {
         throw new EslServerException("Could not download the delegation report." + " Exception: " + e.Message, e.ServerError, e);
     }
     catch (Exception e)
     {
         throw new EslException("Could not download the delegation report." + " Exception: " + e.Message, e);
     }
 }
示例#2
0
        internal Silanis.ESL.API.DelegationReport ToAPIDelegationReport()
        {
            if (sdkDelegationReport == null)
            {
                return(apiDelegationReport);
            }

            Silanis.ESL.API.DelegationReport result = new Silanis.ESL.API.DelegationReport();

            result.From = sdkDelegationReport.From;
            result.To   = sdkDelegationReport.To;

            foreach (Silanis.ESL.SDK.DelegationEventReport sdkDelegationEventReport in sdkDelegationReport.DelegationEventReports)
            {
                result.AddDelegationEventReport(new DelegationEventReportConverter(sdkDelegationEventReport).ToAPIDelegationEventReport());
            }

            return(result);
        }
        internal Silanis.ESL.API.DelegationReport ToAPIDelegationReport()
        {
            if (sdkDelegationReport == null)
            {
                return(apiDelegationReport);
            }

            Silanis.ESL.API.DelegationReport result = new Silanis.ESL.API.DelegationReport();

            result.From = sdkDelegationReport.From;
            result.To   = sdkDelegationReport.To;

            foreach (KeyValuePair <string, IList <DelegationEventReport> > sdkDelegationEventDictionary in sdkDelegationReport.DelegationEvents)
            {
                result.DelegationEvents.Add(sdkDelegationEventDictionary.Key, GetAPIDelegationEventList(sdkDelegationEventDictionary.Value));
            }

            return(result);
        }
示例#4
0
 internal DelegationReportConverter(Silanis.ESL.API.DelegationReport apiDelegationReport)
 {
     this.apiDelegationReport = apiDelegationReport;
 }