This commit is contained in:
@@ -400,37 +400,29 @@ namespace Sockeye.Biz
|
|||||||
*/
|
*/
|
||||||
string keyNoWS = System.Text.RegularExpressions.Regex.Replace(StringUtil.Extract(l.Key, "[KEY", "KEY]").Trim(), "(\"(?:[^\"\\\\]|\\\\.)*\")|\\s+", "$1");
|
string keyNoWS = System.Text.RegularExpressions.Regex.Replace(StringUtil.Extract(l.Key, "[KEY", "KEY]").Trim(), "(\"(?:[^\"\\\\]|\\\\.)*\")|\\s+", "$1");
|
||||||
var jKey = JObject.Parse(keyNoWS);
|
var jKey = JObject.Parse(keyNoWS);
|
||||||
|
var jaFeatures = (JArray)jKey.SelectToken("Key.Features");
|
||||||
|
|
||||||
|
|
||||||
var jaFeatures = (JArray)jKey.SelectToken("Key.Features");
|
|
||||||
for (int x = 0; x < jaFeatures.Count; x++)
|
for (int x = 0; x < jaFeatures.Count; x++)
|
||||||
{
|
{
|
||||||
var jFeature = (JObject)jaFeatures[x];
|
var jFeature = (JObject)jaFeatures[x];
|
||||||
var feature = jFeature["Name"].Value<string>();
|
var feature = jFeature["Name"].Value<string>();
|
||||||
int count=0;
|
int count = 0;
|
||||||
if(feature!="TrialMode")
|
|
||||||
count = jFeature["Count"].Value<int>();
|
if (feature != "TrialMode")
|
||||||
|
count = jFeature["Count"].Value<int>();
|
||||||
|
else
|
||||||
|
l.TrialMode = true;
|
||||||
|
|
||||||
|
if (feature == "ActiveInternalUsers")
|
||||||
|
l.Users = count;
|
||||||
|
|
||||||
|
if (feature == "ActiveCustomerUsers")
|
||||||
|
l.CustomerUsers = count;
|
||||||
|
|
||||||
|
if (feature == "MaximumDataGB")
|
||||||
|
l.MaxDataGB = count;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
l.Users = jKey["AyaNovaLicenseKey"]["TotalScheduleableUsers"].Value<int>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
l.DbId = jKey["Key"]["DBID"].Value<string>();
|
|
||||||
l.LicenseExpire = jKey["Key"]["LicenseExpiration"].Value<DateTime>().ToUniversalTime();
|
|
||||||
//if (jKey["Key"]["Perpetual"].Value<bool>())
|
|
||||||
if ((bool?)jKey["Key"]["Perpetual"] ?? true)
|
|
||||||
l.PGroup = ProductGroup.RavenPerpetual;
|
|
||||||
else
|
|
||||||
l.PGroup = ProductGroup.RavenSubscription;
|
|
||||||
l.MaintenanceExpire = jKey["Key"]["MaintenanceExpiration"].Value<DateTime>().ToUniversalTime();
|
|
||||||
}
|
}
|
||||||
return l;
|
return l;
|
||||||
|
|
||||||
|
|||||||
@@ -34,11 +34,11 @@ namespace Sockeye.Models
|
|||||||
|
|
||||||
//v8 dto props
|
//v8 dto props
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public int CustomerUsers { get; set; }//v8
|
public int? CustomerUsers { get; set; }//v8 - subscription only
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public int MaxDataGB { get; set; }//v8
|
public int? MaxDataGB { get; set; }//v8 - subscription only
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public bool TrialMode { get; set; }//v8
|
public bool TrialMode { get; set; } = false;//v8
|
||||||
//shared dto props
|
//shared dto props
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public int Users { get; set; }//v7 scheduled users, v8 internal users
|
public int Users { get; set; }//v7 scheduled users, v8 internal users
|
||||||
|
|||||||
Reference in New Issue
Block a user