protected void bntAddTag_Click(object sender, EventArgs e)
        {
            int addTagId;
            if (!int.TryParse(ddTags.SelectedValue, out addTagId))
                return;

            Providers.HostedSolution.ExchangeRetentionPolicyTag tag = ES.Services.ExchangeServer.GetExchangeRetentionPolicyTag(PanelRequest.ItemID, addTagId);
            if (tag == null) return;

            List<ExchangeMailboxPlanRetentionPolicyTag> res = ViewState["Tags"] as List<ExchangeMailboxPlanRetentionPolicyTag>;
            if (res == null) res = new List<ExchangeMailboxPlanRetentionPolicyTag>();

            ExchangeMailboxPlanRetentionPolicyTag add = new ExchangeMailboxPlanRetentionPolicyTag();
            add.MailboxPlanId = PanelRequest.GetInt("MailboxPlanId");
            add.TagID = tag.TagID;
            add.TagName = tag.TagName;

            res.Add(add);

            ViewState["Tags"] = res;

            gvPolicy.DataSource = res;
            gvPolicy.DataBind();

            UpdateTags();
        }
コード例 #2
0
        public static IntResult AddExchangeMailboxPlanRetentionPolicyTag(int itemID, ExchangeMailboxPlanRetentionPolicyTag planTag)
        {
            // place log record
            IntResult res = TaskManager.StartResultTask<IntResult>("EXCHANGE", "ADD_EXCHANGE_RETENTIONPOLICYTAG", planTag.TagName, itemID);

            Organization org;
            try
            {
                org = GetOrganization(itemID);
                if (org == null)
                    throw new ApplicationException("Organization is null");
            }
            catch (Exception ex)
            {
                TaskManager.CompleteResultTask(res, ErrorCodes.CANNOT_GET_ORGANIZATION_BY_ITEM_ID, ex);
                return res;
            }

            try
            {
                // Log Extension
                LogExtension.WriteObject(planTag);
                
                // load package context
                PackageContext cntx = PackageController.GetPackageContext(org.PackageId);

                if (org.PackageId > 1)
                {
                    // quotas
                }

                res.Value = DataProvider.AddExchangeMailboxPlanRetentionPolicyTag(planTag.TagID, planTag.MailboxPlanId);

                UpdateExchangeRetentionPolicy(itemID, planTag.MailboxPlanId, res);

            }
            catch (Exception ex)
            {
                TaskManager.WriteError(ex);
                TaskManager.CompleteResultTask(res);
                return res;
            }

            TaskManager.CompleteResultTask();
            return res;

        }
コード例 #3
0
 /// <remarks/>
 public void AddExchangeMailboxPlanRetentionPolicyTagAsync(int itemId, ExchangeMailboxPlanRetentionPolicyTag planTag, object userState) {
     if ((this.AddExchangeMailboxPlanRetentionPolicyTagOperationCompleted == null)) {
         this.AddExchangeMailboxPlanRetentionPolicyTagOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddExchangeMailboxPlanRetentionPolicyTagOperationCompleted);
     }
     this.InvokeAsync("AddExchangeMailboxPlanRetentionPolicyTag", new object[] {
                 itemId,
                 planTag}, this.AddExchangeMailboxPlanRetentionPolicyTagOperationCompleted, userState);
 }
コード例 #4
0
 /// <remarks/>
 public void AddExchangeMailboxPlanRetentionPolicyTagAsync(int itemId, ExchangeMailboxPlanRetentionPolicyTag planTag) {
     this.AddExchangeMailboxPlanRetentionPolicyTagAsync(itemId, planTag, null);
 }
コード例 #5
0
 /// <remarks/>
 public System.IAsyncResult BeginAddExchangeMailboxPlanRetentionPolicyTag(int itemId, ExchangeMailboxPlanRetentionPolicyTag planTag, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("AddExchangeMailboxPlanRetentionPolicyTag", new object[] {
                 itemId,
                 planTag}, callback, asyncState);
 }
コード例 #6
0
 public IntResult AddExchangeMailboxPlanRetentionPolicyTag(int itemId, ExchangeMailboxPlanRetentionPolicyTag planTag) {
     object[] results = this.Invoke("AddExchangeMailboxPlanRetentionPolicyTag", new object[] {
                 itemId,
                 planTag});
     return ((IntResult)(results[0]));
 }
コード例 #7
0
 public IntResult AddExchangeMailboxPlanRetentionPolicyTag(int itemId, ExchangeMailboxPlanRetentionPolicyTag planTag)
 {
     return ExchangeServerController.AddExchangeMailboxPlanRetentionPolicyTag(itemId, planTag);
 }