This commit is contained in:
2020-06-17 18:58:37 +00:00
parent fb586e0f5b
commit 305b61045d
6 changed files with 140 additions and 111 deletions

View File

@@ -13,23 +13,21 @@ namespace rockfishCore.Util
//Key generator controller
public static class RavenKeyFactory
{
public const int TRIAL_PERIOD_DAYS = 45;
//Unlicensed token
private const string UNLICENSED_TOKEN = "UNLICENSED";
//REVOKED token
private const string REVOKED_TOKEN = "REVOKED";
//FEATURE NAMES
//Scheduleable users
private const string SERVICE_TECHS_FEATURE_NAME = "ServiceTechs";
//Accounting add-on
private const string ACCOUNTING_FEATURE_NAME = "Accounting";
//This feature name means it's a trial key
private const string TRIAL_FEATURE_NAME = "TrialMode";
public const int TRIAL_PERIOD_DAYS = 45;
//This feature name means it's a SAAS or rental mode key for month to month hosted service
private const string RENTAL_FEATURE_NAME = "ServiceMode";
@@ -63,6 +61,60 @@ namespace rockfishCore.Util
Id = $"00-{sId}";
}
public override string ToString()
{
/*LICENSE DETAILS
Registered to: Montacargas y Equipos Colombia
Fetch address: facordoba@jycexports.com
Fetch code: ZgVySojpHg
Scheduleable resources: Up to 15
Support and updates until: Thursday, August 13, 2020
Plugins:
WBI - Web browser interface support and updates until: Tuesday, June 15, 2021
ExportToXls support and updates until: Tuesday, June 15, 2021
ImportExportCSVDuplicate support and updates until: Friday, July 17, 2020
RI - Responsive Interface support and updates until: Tuesday, June 15, 2021 */
System.Text.StringBuilder sb = new StringBuilder();
sb.AppendLine("LICENSE DETAILS");
sb.AppendLine($"Registered to: {RegisteredTo}");
sb.AppendLine($"Database id: {DbId}");
if (WillExpire)
sb.AppendLine($"License valid until: {LicenseExpiration.ToLongDateString()}");
sb.AppendLine($"Support and updates until: {MaintenanceExpiration.ToLongDateString()}");
foreach (LicenseFeature f in Features)
{
if (f.Feature == TRIAL_FEATURE_NAME)
{
sb.AppendLine("Temporary license for evaluation");
continue;
}
if (f.Feature == RENTAL_FEATURE_NAME)
{
sb.AppendLine("Service / Rental license");
continue;
}
if (f.Feature == ACCOUNTING_FEATURE_NAME)
{
sb.AppendLine("Accounting option");
continue;
}
if (f.Feature == SERVICE_TECHS_FEATURE_NAME)
{
sb.AppendLine($"Scheduleable resources: {f.Count}");
continue;
}
//default for items added later not tokenized
if (f.Count > 0)
sb.AppendLine($"{f.Feature}: {f.Count}");
else
sb.AppendLine($"{f.Feature}");
}
return sb.ToString();
}
public bool IsEmpty
{
get