Exemplo n.º 1
0
        public void btnAddPolicy_Click(object sender, EventArgs e)
        {
            Page.Validate("CreatePolicy");

            if (!Page.IsValid)
            {
                return;
            }

            ExchangeRetentionPolicyTag tag = new ExchangeRetentionPolicyTag();

            tag.TagName = txtPolicy.Text;
            tag.TagType = Convert.ToInt32(ddTagType.SelectedValue);
            tag.AgeLimitForRetention = ageLimitForRetention.QuotaValue;
            tag.RetentionAction      = Convert.ToInt32(ddRetentionAction.SelectedValue);

            Providers.HostedSolution.Organization[] orgs = null;
            if (PanelSecurity.SelectedUserId != 1)
            {
                PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId);

                if ((Packages != null) & (Packages.GetLength(0) > 0))
                {
                    orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false);
                }
            }
            else
            {
                orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false);
            }


            if ((orgs != null) & (orgs.GetLength(0) > 0))
            {
                IntResult result = ES.Services.ExchangeServer.AddExchangeRetentionPolicyTag(orgs[0].Id, tag);

                if (!result.IsSuccess)
                {
                    messageBox.ShowMessage(result, "EXCHANGE_UPDATEPLANS", null);
                    return;
                }
                else
                {
                    messageBox.ShowSuccessMessage("EXCHANGE_UPDATEPLANS");
                }
            }

            BindRetentionPolicy();
        }
Exemplo n.º 2
0
 public ResultObject UpdateExchangeRetentionPolicyTag(int itemId, ExchangeRetentionPolicyTag tag)
 {
     return(ExchangeServerController.UpdateExchangeRetentionPolicyTag(itemId, tag));
 }
Exemplo n.º 3
0
 public IntResult AddExchangeRetentionPolicyTag(int itemId, ExchangeRetentionPolicyTag tag)
 {
     return(ExchangeServerController.AddExchangeRetentionPolicyTag(itemId, tag));
 }