Lync Module fixes

This commit is contained in:
dev_amdtel 2013-12-10 22:38:02 +04:00
parent f500906c68
commit 323e085b15
8 changed files with 229 additions and 73 deletions

View file

@ -3286,6 +3286,17 @@ namespace WebsitePanel.EnterpriseServer
return reader;
}
public static int GetPackageIPAddressesCount(int packageId, int orgId, int poolId)
{
object obj = SqlHelper.ExecuteScalar(ConnectionString, CommandType.StoredProcedure,
"GetPackageIPAddressesCount",
new SqlParameter("@PackageID", packageId),
new SqlParameter("@OrgID", orgId),
new SqlParameter("@PoolId", poolId));
int res = 0;
int.TryParse(obj.ToString(), out res);
return res;
}
public static void DeallocatePackageIPAddress(int id)
{

View file

@ -1186,6 +1186,11 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
public static int GetPackageIPAddressesCount(int packageId, int orgId, IPAddressPool pool)
{
return DataProvider.GetPackageIPAddressesCount(packageId, orgId, (int)pool);
}
public static List<IPAddressInfo> GetUnallottedIPAddresses(int packageId, string groupName, IPAddressPool pool)
{
// get service ID
@ -1259,6 +1264,9 @@ namespace WebsitePanel.EnterpriseServer
int quotaAllocated = cntx.Quotas[quotaName].QuotaAllocatedValue;
int quotaUsed = cntx.Quotas[quotaName].QuotaUsedValue;
if (pool == IPAddressPool.PhoneNumbers)
quotaUsed = ServerController.GetPackageIPAddressesCount(packageId, orgId, pool);
// check the maximum allowed number
if (quotaAllocated != -1) // check only if not unlimited
{