private void BindItems() { // get settings SfBUser sfbUser = ES.Services.SfB.GetSfBUserGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); // title litDisplayName.Text = sfbUser.DisplayName; planSelector.planId = sfbUser.SfBUserPlanId.ToString(); sfbUserSettings.sipAddress = sfbUser.SipAddress; Utils.SelectListItem(ddlPhoneNumber, sfbUser.LineUri); PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); OrganizationUser user = ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); if (user.LevelId > 0 && cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels)) { SolidCP.EnterpriseServer.Base.HostedSolution.ServiceLevel serviceLevel = ES.Services.Organizations.GetSupportServiceLevel(user.LevelId); litServiceLevel.Visible = true; litServiceLevel.Text = serviceLevel.LevelName; litServiceLevel.ToolTip = serviceLevel.LevelDescription; } imgVipUser.Visible = user.IsVIP && cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels); }
private void BindSettings() { try { // get settings ExchangeMailbox mailbox = ES.Services.ExchangeServer.GetMailboxGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); //get statistics ExchangeMailboxStatistics stats = ES.Services.ExchangeServer.GetMailboxStatistics(PanelRequest.ItemID, PanelRequest.AccountID); // mailbox plan // title litDisplayName.Text = mailbox.DisplayName; // bind form chkHideAddressBook.Checked = mailbox.HideFromAddressBook; chkDisable.Checked = mailbox.Disabled; lblExchangeGuid.Text = string.IsNullOrEmpty(mailbox.ExchangeGuid) ? "<>" : mailbox.ExchangeGuid; // get account meta ExchangeAccount account = ES.Services.ExchangeServer.GetAccount(PanelRequest.ItemID, PanelRequest.AccountID); // get mailbox plan ExchangeMailboxPlan plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(PanelRequest.ItemID, account.MailboxPlanId); chkPmmAllowed.Checked = (account.MailboxManagerActions & MailboxManagerActions.GeneralSettings) > 0; if (account.MailboxPlanId == 0) { mailboxPlanSelector.AddNone = true; mailboxPlanSelector.MailboxPlanId = "-1"; } else { mailboxPlanSelector.MailboxPlanId = account.MailboxPlanId.ToString(); } if (account.ArchivingMailboxPlanId < 1) { mailboxRetentionPolicySelector.MailboxPlanId = "-1"; } else { mailboxRetentionPolicySelector.MailboxPlanId = account.ArchivingMailboxPlanId.ToString(); } mailboxSize.QuotaUsedValue = Convert.ToInt32(stats.TotalSize / 1024 / 1024); mailboxSize.QuotaValue = (stats.MaxSize == -1) ? -1 : (int)Math.Round((double)(stats.MaxSize / 1024 / 1024)); secCalendarSettings.Visible = ((account.AccountType == ExchangeAccountType.Equipment) | (account.AccountType == ExchangeAccountType.Room)); secLitigationHoldSettings.Visible = mailbox.EnableLitigationHold; litigationHoldSpace.QuotaUsedValue = Convert.ToInt32(stats.LitigationHoldTotalSize / 1024 / 1024); litigationHoldSpace.QuotaValue = (stats.LitigationHoldMaxSize == -1) ? -1 : (int)Math.Round((double)(stats.LitigationHoldMaxSize / 1024 / 1024)); if (Utils.CheckQouta(Quotas.EXCHANGE2007_DISCLAIMERSALLOWED, Cntx)) { int disclaimerId = ES.Services.ExchangeServer.GetExchangeAccountDisclaimerId(PanelRequest.ItemID, PanelRequest.AccountID); ddDisclaimer.SelectedValue = disclaimerId.ToString(); } int ArchivingMaxSize = -1; if (plan != null) { ArchivingMaxSize = plan.ArchiveSizeMB; } chkEnableArchiving.Checked = account.EnableArchiving; archivingQuotaViewer.QuotaUsedValue = Convert.ToInt32(stats.ArchivingTotalSize / 1024 / 1024); archivingQuotaViewer.QuotaValue = ArchivingMaxSize; rowArchiving.Visible = chkEnableArchiving.Checked; if (account.LevelId > 0 && Cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels)) { SolidCP.EnterpriseServer.Base.HostedSolution.ServiceLevel serviceLevel = ES.Services.Organizations.GetSupportServiceLevel(account.LevelId); litServiceLevel.Visible = true; litServiceLevel.Text = serviceLevel.LevelName; litServiceLevel.ToolTip = serviceLevel.LevelDescription; } imgVipUser.Visible = account.IsVIP && Cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels); if (account.AccountType == ExchangeAccountType.SharedMailbox) { litDisplayName.Text += GetSharedLocalizedString("SharedMailbox.Text"); } if (account.AccountType == ExchangeAccountType.Room) { litDisplayName.Text += GetSharedLocalizedString("RoomMailbox.Text"); } if (account.AccountType == ExchangeAccountType.Equipment) { litDisplayName.Text += GetSharedLocalizedString("EquipmentMailbox.Text"); } } catch (Exception ex) { messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOX_SETTINGS", ex); } }