/// <remarks/>
 public void UpdateExchangeDisclaimerAsync(int itemId, ExchangeDisclaimer disclaimer, object userState) {
     if ((this.UpdateExchangeDisclaimerOperationCompleted == null)) {
         this.UpdateExchangeDisclaimerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateExchangeDisclaimerOperationCompleted);
     }
     this.InvokeAsync("UpdateExchangeDisclaimer", new object[] {
                 itemId,
                 disclaimer}, this.UpdateExchangeDisclaimerOperationCompleted, userState);
 }
        public static int UpdateExchangeDisclaimer(int itemId, ExchangeDisclaimer disclaimer)
        {
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
            if (accountCheck < 0) return accountCheck;

            // place log record
            TaskManager.StartTask("EXCHANGE", "UPDATE_EXCHANGE_EXCHANGEDISCLAIMER", disclaimer.DisclaimerName, itemId);

            // Log Extension
            LogExtension.WriteObject(disclaimer);

            try
            {
                Organization org = GetOrganization(itemId);
                if (org == null) return -1;
                int exchangeServiceId = GetExchangeServiceID(org.PackageId);
                ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId);

                var oldObj = GetExchangeDisclaimer(itemId, disclaimer.ExchangeDisclaimerId);

                exchange.SetDisclaimer(disclaimer.WSPUniqueName, disclaimer.DisclaimerText);
                DataProvider.UpdateExchangeDisclaimer(itemId, disclaimer);

                // Log Extension
                LogExtension.LogPropertiesIfChanged(oldObj, disclaimer);
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }

            return 0;
        }
 /// <remarks/>
 public System.IAsyncResult BeginUpdateExchangeDisclaimer(int itemId, ExchangeDisclaimer disclaimer, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("UpdateExchangeDisclaimer", new object[] {
                 itemId,
                 disclaimer}, callback, asyncState);
 }
 /// <remarks/>
 public void UpdateExchangeDisclaimerAsync(int itemId, ExchangeDisclaimer disclaimer) {
     this.UpdateExchangeDisclaimerAsync(itemId, disclaimer, null);
 }
 public int UpdateExchangeDisclaimer(int itemId, ExchangeDisclaimer disclaimer) {
     object[] results = this.Invoke("UpdateExchangeDisclaimer", new object[] {
                 itemId,
                 disclaimer});
     return ((int)(results[0]));
 }
 /// <remarks/>
 public void AddExchangeDisclaimerAsync(int itemId, ExchangeDisclaimer disclaimer) {
     this.AddExchangeDisclaimerAsync(itemId, disclaimer, null);
 }
 public int UpdateExchangeDisclaimer(int itemId, ExchangeDisclaimer disclaimer)
 {
     return ExchangeServerController.UpdateExchangeDisclaimer(itemId, disclaimer);
 }
 public static void UpdateExchangeDisclaimer(int itemID, ExchangeDisclaimer disclaimer)
 {
     SqlHelper.ExecuteNonQuery(
         ConnectionString,
         CommandType.StoredProcedure,
         "UpdateExchangeDisclaimer",
         new SqlParameter("@ExchangeDisclaimerId", disclaimer.ExchangeDisclaimerId),
         new SqlParameter("@DisclaimerName", disclaimer.DisclaimerName),
         new SqlParameter("@DisclaimerText", disclaimer.DisclaimerText)
     );
 }
        public static int AddExchangeDisclaimer(int itemID, ExchangeDisclaimer disclaimer)
        {
            SqlParameter outParam = new SqlParameter("@ExchangeDisclaimerId", SqlDbType.Int);
            outParam.Direction = ParameterDirection.Output;

            SqlHelper.ExecuteNonQuery(
                ConnectionString,
                CommandType.StoredProcedure,
                "AddExchangeDisclaimer",
                outParam,

                new SqlParameter("@ItemID", itemID),
                new SqlParameter("@DisclaimerName", disclaimer.DisclaimerName),
                new SqlParameter("@DisclaimerText", disclaimer.DisclaimerText)
            );

            return Convert.ToInt32(outParam.Value);
        }