|
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx.cs
index 0f4eb61e..4080c20f 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx.cs
@@ -30,11 +30,18 @@ using System;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.Common;
using WebsitePanel.Providers.HostedSolution;
+using WebsitePanel.Providers.OS;
namespace WebsitePanel.Portal.ExchangeServer
{
public partial class EnterpriseStorageCreateFolder : WebsitePanelModuleBase
{
+ #region Constants
+
+ private const int OneGb = 1024;
+
+ #endregion
+
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
@@ -44,6 +51,17 @@ namespace WebsitePanel.Portal.ExchangeServer
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "enterprisestorage_folders",
"ItemID=" + PanelRequest.ItemID));
}
+
+ OrganizationStatistics organizationStats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID);
+
+ if (organizationStats.AllocatedEnterpriseStorageSpace != -1)
+ {
+ OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID);
+
+ rangeFolderSize.MaximumValue = Math.Round((tenantStats.AllocatedEnterpriseStorageSpace - (decimal)tenantStats.UsedEnterpriseStorageSpace) / OneGb
+ + Utils.ParseDecimal(txtFolderSize.Text, 0), 2).ToString();
+ rangeFolderSize.ErrorMessage = string.Format("The quota you’ve entered exceeds the available quota for tenant ({0}Gb)", rangeFolderSize.MaximumValue);
+ }
}
}
@@ -69,7 +87,12 @@ namespace WebsitePanel.Portal.ExchangeServer
ES.Services.EnterpriseStorage.CreateEnterpriseStorage(PanelSecurity.PackageId, PanelRequest.ItemID);
}
- ResultObject result = ES.Services.EnterpriseStorage.CreateEnterpriseFolder(PanelRequest.ItemID, txtFolderName.Text, chkAddDefaultGroup.Checked);
+ ResultObject result = ES.Services.EnterpriseStorage.CreateEnterpriseFolder(
+ PanelRequest.ItemID,
+ txtFolderName.Text,
+ (int)(decimal.Parse(txtFolderSize.Text) * OneGb),
+ rbtnQuotaSoft.Checked ? QuotaType.Soft : QuotaType.Hard,
+ chkAddDefaultGroup.Checked);
if (!result.IsSuccess && result.ErrorCodes.Count > 0)
{
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx.designer.cs
index 2c020b89..b2415b73 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx.designer.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx.designer.cs
@@ -93,6 +93,69 @@ namespace WebsitePanel.Portal.ExchangeServer {
///
protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireFolderName;
+ ///
+ /// locFolderSize control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Localize locFolderSize;
+
+ ///
+ /// txtFolderSize control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtFolderSize;
+
+ ///
+ /// valRequireFolderSize control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireFolderSize;
+
+ ///
+ /// rangeFolderSize control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.RangeValidator rangeFolderSize;
+
+ ///
+ /// locQuotaType control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Localize locQuotaType;
+
+ ///
+ /// rbtnQuotaSoft control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.RadioButton rbtnQuotaSoft;
+
+ ///
+ /// rbtnQuotaHard control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.RadioButton rbtnQuotaHard;
+
///
/// locAddDefaultGroup control.
///
|