예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="campaignId"></param>
        /// <param name="language"></param>
        /// <returns></returns>
        public CampaignReportType Report(string campaignId = null, string language = "NL")
        {
            try
            {
                if (_report == null)
                {
                    var req = new GetCampaignReportReq()
                    {
                        header = Client.RequestHeader
                    };

                    if (!string.IsNullOrWhiteSpace(campaignId))
                    {
                        req.campaignId = int.Parse(campaignId);
                    }
                    req.campaignIdSpecified = true;

                    req.language = language;

                    _report = _client.API.GetCampaignReport(req);
                }

                if (_report != null && _report.errorCode == (int)errorCode.No_error)
                {
                    return(_report.campaignReportType);
                }
                else
                if (_report != null)
                {
                    throw new FlexMailException(FlexMail.Resources.Campaign.ResourceManager.GetString("Report_" + _report.errorCode), _report.errorCode);
                }

                throw new FlexMailException(FlexMail.Resources.Blacklist.ResourceManager.GetString("Report_" + _report.errorCode), _report.errorCode);
            }
            catch (Exception ex)
            {
                //telemetry.TrackException(ex, new Dictionary<string, string> { { "Flexmail", "Campaign.Report" } });
                if (ex is FlexMailException)
                {
                    throw (ex);
                }
            }
            finally
            {
                _report = null;
            }
            return(new CampaignReportType());
        }
예제 #2
0
        private bool disposedValue = false; // To detect redundant calls

        /// <summary>
        ///
        /// </summary>
        /// <param name="disposing"></param>
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                }

                _campaigns    = null;
                _delete       = null;
                _history      = null;
                _report       = null;
                _summary      = null;
                disposedValue = true;
            }
        }