示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="formId"></param>
        /// <param name="campaignId"></param>
        /// <param name="timestampSince"></param>
        /// <returns></returns>
        public List <FormResultType> Results(string formId = null, string campaignId = null, string timestampSince = null)
        {
            try
            {
                if (_results == null)
                {
                    var req = new GetFormResultsReq()
                    {
                        header = Client.RequestHeader
                    };

                    if (!string.IsNullOrWhiteSpace(formId))
                    {
                        req.formId = formId;
                    }

                    if (!string.IsNullOrWhiteSpace(campaignId))
                    {
                        req.campaignId = campaignId;
                    }

                    if (!string.IsNullOrWhiteSpace(timestampSince))
                    {
                        req.timestampSince = timestampSince;
                    }

                    _results = _client.API.GetFormResults(req);
                }

                if (_results.errorCode == (int)errorCode.No_error)
                {
                    return(_results.formResultTypeItems.ToList <FormResultType>());
                }

                throw new FlexMailException(_results.errorMessage, _results.errorCode);
            }
            catch (Exception ex)
            {
                //telemetry.TrackException(ex, new Dictionary<string, string> { { "Flexmail", "Form.Results" } });
                if (ex is FlexMailException)
                {
                    throw (ex);
                }
            }

            finally
            {
                _results = null;
            }
            return(new List <FormResultType>());
        }
示例#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)
                {
                }

                _forms   = null;
                _results = null;

                disposedValue = true;
            }
        }