This commit is contained in:
Virtuworks 2014-04-22 00:01:31 -04:00
commit 7ef077a0ba
12 changed files with 266 additions and 35 deletions

View file

@ -153,4 +153,7 @@
<data name="gvGroupsNotes.Header" xml:space="preserve">
<value>Notes</value>
</data>
<data name="locQuota.Text" xml:space="preserve">
<value>Total Groups Created:</value>
</data>
</root>

View file

@ -53,15 +53,24 @@ namespace WebsitePanel.Portal.ExchangeServer
}
OrganizationStatistics organizationStats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID);
OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(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 youve entered exceeds the available quota for tenant ({0}Gb)", rangeFolderSize.MaximumValue);
}
if (organizationStats.AllocatedGroups != -1)
{
int groupsAvailable = tenantStats.AllocatedGroups - tenantStats.CreatedGroups;
if (groupsAvailable <= 0)
{
chkAddDefaultGroup.Enabled = false;
}
}
}
}

View file

@ -6,6 +6,7 @@
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
<div id="ExchangeContainer">
<div class="Module">
<div class="Left">
</div>
<div class="Content">

View file

@ -164,13 +164,13 @@ namespace WebsitePanel.Portal.ExchangeServer
lnkUsers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "users",
"SpaceID=" + PanelSecurity.PackageId);
if (Utils.CheckQouta(Quotas.ORGANIZATION_SECURITYGROUPMANAGEMENT, cntx))
if (Utils.CheckQouta(Quotas.ORGANIZATION_SECURITYGROUPS, cntx))
{
securGroupsStat.Visible = true;
groupStats.QuotaUsedValue = orgStats.CreatedGroups;
groupStats.QuotaValue = orgStats.AllocatedGroups;
if (orgStats.AllocatedUsers != -1) groupStats.QuotaAvailable = tenantStats.AllocatedGroups - tenantStats.CreatedGroups;
if (orgStats.AllocatedGroups != -1) groupStats.QuotaAvailable = tenantStats.AllocatedGroups - tenantStats.CreatedGroups;
lnkGroups.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "secur_groups",
"SpaceID=" + PanelSecurity.PackageId);

View file

@ -1,6 +1,7 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationSecurityGroups.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.OrganizationSecurityGroups" %>
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %>
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
@ -78,6 +79,10 @@
<asp:ControlParameter Name="filterValue" ControlID="txtSearchValue" PropertyName="Text" />
</SelectParameters>
</asp:ObjectDataSource>
<br/>
<asp:Localize ID="locQuota" runat="server" meta:resourcekey="locQuota" Text="Total Groups Created:"></asp:Localize>
&nbsp;&nbsp;&nbsp;
<wsp:QuotaViewer ID="groupsQuota" runat="server" QuotaTypeId="2" />
</div>
</div>
</div>

View file

@ -48,7 +48,29 @@ namespace WebsitePanel.Portal.ExchangeServer
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindStats();
}
}
private void BindStats()
{
// quota values
OrganizationStatistics stats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID);
OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID);
groupsQuota.QuotaUsedValue = stats.CreatedGroups;
groupsQuota.QuotaValue = stats.AllocatedGroups;
if (stats.AllocatedGroups != -1)
{
int groupsAvailable = groupsQuota.QuotaAvailable = tenantStats.AllocatedGroups - tenantStats.CreatedGroups;
if (groupsAvailable <= 0)
{
btnCreateGroup.Enabled = false;
}
}
}
protected void btnCreateGroup_Click(object sender, EventArgs e)
@ -96,6 +118,9 @@ namespace WebsitePanel.Portal.ExchangeServer
// rebind grid
gvGroups.DataBind();
// bind stats
BindStats();
}
catch (Exception ex)
{
@ -117,7 +142,10 @@ namespace WebsitePanel.Portal.ExchangeServer
gvGroups.PageSize = Convert.ToInt16(ddlPageSize.SelectedValue);
// rebind grid
gvGroups.DataBind();
gvGroups.DataBind();
// bind stats
BindStats();
}
}

View file

@ -156,5 +156,23 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource odsSecurityGroupsPaged;
/// <summary>
/// locQuota control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locQuota;
/// <summary>
/// groupsQuota control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer groupsQuota;
}
}