Пример #1
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)
                {
                }

                _categories = null;
                _create     = null;
                _delete     = null;
                _update     = null;

                disposedValue = true;
            }
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="categoryId"></param>
        /// <param name="categoryName"></param>
        public void Update(string categoryId = null, string categoryName = null)
        {
            try
            {
                if (_update == null)
                {
                    var req = new UpdateCategoryReq()
                    {
                        header = Client.RequestHeader
                    };

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

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

                    _update = _client.API.UpdateCategory(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", "Category.Update" } });
                if (ex is FlexMailException)
                {
                    throw (ex);
                }
            }

            finally
            {
                _update = null;
            }
            return;
        }