protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(typeof (BackupAjaxHandler), Page);

            Page.RegisterStyleControl(ResolveUrl("~/usercontrols/management/backup/css/backup.less"));
            Page.RegisterBodyScripts(ResolveUrl("~/usercontrols/management/backup/js/backup.js"));

            FolderSelectorHolder.Controls.Add(LoadControl(CommonLinkUtility.ToAbsolute("~/products/files/controls/fileselector/fileselector.ascx")));

            BackupTimePeriod.Controls.Add(LoadControl(ChooseTimePeriod.Location));
            RestoreHolder.Controls.Add(LoadControl(Restore.Location));

            var size = CoreContext.TenantManager.FindTenantQuotaRows(new TenantQuotaRowQuery(TenantProvider.CurrentTenantID))
                                  .Where(r => !string.IsNullOrEmpty(r.Tag) && new Guid(r.Tag) != Guid.Empty && !new Guid(r.Tag).Equals(_mailStorageTag))
                                  .Sum(r => r.Counter);
            if (size > AvailableZipSize)
            {
                AvailableStatus = BackupAvailableSize.NotAvailable;
            }
            else
            {
                size = TenantStatisticsProvider.GetUsedSize();
                if (size > AvailableZipSize)
                {
                    AvailableStatus = BackupAvailableSize.WithoutMail;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(typeof(BackupAjaxHandler), Page);

            Page.RegisterStyleControl(ResolveUrl("~/usercontrols/management/backup/css/backup.less"));
            Page.RegisterBodyScripts(ResolveUrl("~/usercontrols/management/backup/js/backup.js"));

            FolderSelectorHolder.Controls.Add(LoadControl(CommonLinkUtility.ToAbsolute("~/products/files/controls/fileselector/fileselector.ascx")));

            BackupTimePeriod.Controls.Add(LoadControl(ChooseTimePeriod.Location));
            RestoreHolder.Controls.Add(LoadControl(Restore.Location));

            var size = CoreContext.TenantManager.FindTenantQuotaRows(new TenantQuotaRowQuery(TenantProvider.CurrentTenantID))
                       .Where(r => !string.IsNullOrEmpty(r.Tag) && new Guid(r.Tag) != Guid.Empty && !new Guid(r.Tag).Equals(_mailStorageTag))
                       .Sum(r => r.Counter);

            if (size > AvailableZipSize)
            {
                AvailableStatus = BackupAvailableSize.NotAvailable;
            }
            else
            {
                size = TenantStatisticsProvider.GetUsedSize();
                if (size > AvailableZipSize)
                {
                    AvailableStatus = BackupAvailableSize.WithoutMail;
                }
            }
        }