case 4522

This commit is contained in:
2023-05-04 00:49:19 +00:00
parent 7efdf58bcf
commit 2116534503
4 changed files with 41 additions and 5 deletions

View File

@@ -20,7 +20,7 @@ namespace AyaNova.Util
/////////// CHANGE THIS ON NEW SCHEMA UPDATE ////////////////////
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!!
private const int DESIRED_SCHEMA_LEVEL = 17;
private const int DESIRED_SCHEMA_LEVEL = 18;
internal const long EXPECTED_COLUMN_COUNT = 1389;
internal const long EXPECTED_INDEX_COUNT = 160;
@@ -1799,7 +1799,7 @@ CREATE OR REPLACE VIEW public.viewpartinventorylist
}
//////////////////////////////////////////////////
//////////////////////////////////////////////////
//
// case 4491
//
@@ -1807,7 +1807,7 @@ CREATE OR REPLACE VIEW public.viewpartinventorylist
{
LogUpdateMessage(log);
//english translations
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'ServerUpdateAvailable', 'New version available' FROM atranslation t where t.baselanguage = 'en'");
@@ -1825,6 +1825,31 @@ CREATE OR REPLACE VIEW public.viewpartinventorylist
}
//////////////////////////////////////////////////
//
// case 4522
//
if (currentSchema < 18)
{
LogUpdateMessage(log);
//english translations
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'LicenseExpirationDays', 'Days before license expires' FROM atranslation t where t.baselanguage = 'en'");
//spanish translations
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'LicenseExpirationDays', 'Días antes de que caduque la licencia' FROM atranslation t where t.baselanguage = 'es'");
//french translations
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'LicenseExpirationDays', 'Jours avant l''expiration de la licence' FROM atranslation t where t.baselanguage = 'fr'");
//german translations
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'LicenseExpirationDays', 'Tage vor Ablauf der Lizenz' FROM atranslation t where t.baselanguage = 'de'");
await SetSchemaLevelAsync(++currentSchema);
}
//#########################################

View File

@@ -271,6 +271,16 @@ namespace AyaNova.Core
}
public int LicenseExpirationDays
{
get
{
if (WillExpire)
return (int)(LicenseExpiration.ToUniversalTime() - DateTime.UtcNow).TotalDays;
else
return -1;//not expiring
}
}
public string LicenseFormat { get; set; }
public string Id { get; set; }