Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="mailingListId"></param>
        /// <param name="mailingListName"></param>
        /// <param name="mailingListLanguage"></param>
        public void Update(string mailingListId = null, string mailingListName = null, string mailingListLanguage = "NL")
        {
            try
            {
                if (_update == null)
                {
                    var req = new UpdateMailingListReq()
                    {
                        header = Client.RequestHeader
                    };

                    if (!string.IsNullOrWhiteSpace(mailingListId))
                    {
                        req.mailingListId = int.Parse(mailingListId);
                    }

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

                    req.mailingListLanguage = mailingListLanguage;

                    _update = _client.API.UpdateMailingList(req);
                }

                if (_update.errorCode == (int)errorCode.No_error)
                {
                    return;
                }

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

            finally
            {
                _update = null;
            }
            return;
        }
Esempio n. 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)
                {
                }

                _create       = null;
                _delete       = null;
                _mailingLists = null;
                _truncate     = null;
                _update       = null;

                disposedValue = true;
            }
        }