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

View File

@@ -363,7 +363,7 @@ namespace rockfishCore.Util
//////////////////////////////////////////////////
//schema 16 RAVEN stuff
if (currentSchema < 16)
{
{
exec("CREATE TABLE trialrequest (" +
"id INTEGER PRIMARY KEY, dbid text not null, companyname text not null, contactname text not null, notes text, email text not null, " +
"emailconfirmcode text not null, emailvalidated boolean default 0 NOT NULL CHECK (emailvalidated IN (0,1)), dtrequested integer, " +
@@ -373,6 +373,7 @@ namespace rockfishCore.Util
exec("alter table site add dbid text default 'v7_no_dbid' NOT NULL");
exec("update site set legacyv7 = 1");
exec("alter table license add dbid text default 'v7_no_dbid' NOT NULL");
exec("alter table license add siteid integer");
exec("alter table purchase add quantity integer default 1 not null");
exec("insert into product (name, productCode, price, renewPrice) values ('TEST RAVEN schedulable resource 1 year subscription license','testfeatscheduser',15900, 5565);");
exec("insert into product (name, productCode, price, renewPrice) values ('TEST RAVEN Accounting 1 year subscription license','testfeatacct',15000, 5250);");