diff --git a/Service/Security/SecurityUtils.cs b/Service/Security/SecurityUtils.cs index 5b166b28b..e662d88e5 100644 --- a/Service/Security/SecurityUtils.cs +++ b/Service/Security/SecurityUtils.cs @@ -183,7 +183,7 @@ namespace BeWo.Service.Security info.MaxEmployeeCount = 1000; - return info; + //return info; #endif @@ -197,7 +197,7 @@ namespace BeWo.Service.Security #if DEBUG url = ConfigurationManager.AppSettings.Get("LicenseInfoUrl"); - url = url.Replace("[TENANT]", "3522103738"); + url = url.Replace("[TENANT]", "8002913382"); url += "&t=0"; #endif //url = url.Replace("[TENANT]", "1441747891"); @@ -214,12 +214,13 @@ namespace BeWo.Service.Security //} String[] resultArray = result.Split(';'); - int maxLicenses = 0; + int fullLicenses = 0; int midLicenses = 0; + int isHybrid = 0; decimal percentFreeEmployees = 0; if (resultArray.Length > 0) { - Int32.TryParse(resultArray[0], out maxLicenses); + Int32.TryParse(resultArray[0], out fullLicenses); if (resultArray.Length > 1) { Decimal.TryParse(resultArray[1], out percentFreeEmployees); @@ -228,19 +229,22 @@ namespace BeWo.Service.Security { Int32.TryParse(resultArray[2], out midLicenses); } + if (resultArray.Length > 3) + { + Int32.TryParse(resultArray[3], out isHybrid); + } } - if (midLicenses > 0) - { - percentFreeEmployees = 0; - maxLicenses += midLicenses; - } - info.MaxLicenseCount = maxLicenses; - info.PercentFreeEmployee = percentFreeEmployees; + + info.IsHybrid = isHybrid == 1; + info.MaxLicenseCount = info.IsHybrid ? fullLicenses + midLicenses : fullLicenses; // Anzahl max User immer Anzahl voll + Hybrid Lizenzen + info.MaxMidLicenseCount = midLicenses; + info.PercentFreeEmployee = midLicenses > 0 ? 0 : percentFreeEmployees; // Nur für Normale DBs 30 % zusätzlich info.LicenseInUseCount = DAOFactory.GenericDAO.GetAllActive().Count; info.EmployeeCount = DAOFactory.GenericDAO.GetAllActive().Count; - info.MaxEmployeeCount = (int)Math.Ceiling(maxLicenses * ((100 + percentFreeEmployees) / 100)); + info.MaxEmployeeCount = (int)Math.Ceiling((fullLicenses + midLicenses) * ((100 + info.PercentFreeEmployee) / 100)); // Immer voll + Mid/Hybrid + } } catch (Exception) diff --git a/Shared/DataContracts/LicenseInfoDC.cs b/Shared/DataContracts/LicenseInfoDC.cs index 8ca912850..a43572598 100644 --- a/Shared/DataContracts/LicenseInfoDC.cs +++ b/Shared/DataContracts/LicenseInfoDC.cs @@ -18,6 +18,12 @@ namespace BS.Shared.DataContracts [DataMember] public int MaxLicenseCount { get; set; } + [DataMember] + public int MaxMidLicenseCount { get; set; } + + [DataMember] + public bool IsHybrid { get; set; } + [DataMember] public decimal PercentFreeEmployee { get; set; }