This commit is contained in:
@@ -107,7 +107,9 @@ namespace AyaNova.Api.Controllers
|
|||||||
|
|
||||||
var ret = new
|
var ret = new
|
||||||
{
|
{
|
||||||
|
//Actual global settings:
|
||||||
SearchCaseSensitiveOnly = AyaNova.Util.ServerGlobalBizSettings.SearchCaseSensitiveOnly,
|
SearchCaseSensitiveOnly = AyaNova.Util.ServerGlobalBizSettings.SearchCaseSensitiveOnly,
|
||||||
|
UseInventory = AyaNova.Util.ServerGlobalBizSettings.UseInventory,
|
||||||
//used to drive UI in case of unlicensed or attention required
|
//used to drive UI in case of unlicensed or attention required
|
||||||
LicenseStatus = AyaNova.Core.License.ActiveKey.Status,
|
LicenseStatus = AyaNova.Core.License.ActiveKey.Status,
|
||||||
MaintenanceExpired = AyaNova.Core.License.ActiveKey.MaintenanceExpired,
|
MaintenanceExpired = AyaNova.Core.License.ActiveKey.MaintenanceExpired,
|
||||||
|
|||||||
@@ -57,20 +57,16 @@ namespace AyaNova.Biz
|
|||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
//UPDATE
|
//UPDATE
|
||||||
//
|
//
|
||||||
|
internal async Task<GlobalBizSettings> PutAsync(GlobalBizSettings putObject)
|
||||||
//put
|
|
||||||
internal async Task<GlobalBizSettings> PutAsync(GlobalBizSettings updatedObject)
|
|
||||||
{
|
{
|
||||||
var dbObject = await ct.GlobalBizSettings.FirstOrDefaultAsync(m => m.Id == 1);
|
var dbObject = await GetAsync(false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
throw new System.Exception("GlobalBizSettingsBiz::ReplaceAsync -> Global settings object not found in database!!");
|
throw new System.Exception("GlobalBizSettingsBiz::PutAsync -> Global settings object not found in database. Contact support immediately!");
|
||||||
CopyObject.Copy(updatedObject, dbObject, "Id");
|
|
||||||
|
|
||||||
ct.Entry(dbObject).OriginalValues["Concurrency"] = updatedObject.Concurrency;
|
Validate(putObject, dbObject);
|
||||||
|
if (HasErrors) return null;
|
||||||
|
ct.Replace(dbObject, putObject);
|
||||||
|
|
||||||
Validate(dbObject);
|
|
||||||
if (HasErrors)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -95,9 +91,8 @@ namespace AyaNova.Biz
|
|||||||
//
|
//
|
||||||
|
|
||||||
//Can save or update?
|
//Can save or update?
|
||||||
private void Validate(GlobalBizSettings inObj)
|
private void Validate(GlobalBizSettings proposedObj, GlobalBizSettings currentObj)
|
||||||
{
|
{
|
||||||
|
|
||||||
//currently nothing to validate
|
//currently nothing to validate
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,24 +6,71 @@ namespace AyaNova.Models
|
|||||||
public class GlobalBizSettings
|
public class GlobalBizSettings
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//This is the replacement for most of the Global object settings in v7 which has been subdivided further in v8 into backup / ops / notification and this general biz
|
||||||
|
//this object is only interested in Business object related settings and configuration specifically
|
||||||
|
|
||||||
|
|
||||||
public long Id { get; set; }//this is always 1 as there is only ever one single global biz object
|
public long Id { get; set; }//this is always 1 as there is only ever one single global biz object
|
||||||
public uint Concurrency { get; set; }
|
public uint Concurrency { get; set; }
|
||||||
|
|
||||||
//Global settings
|
//Global settings
|
||||||
|
//############# NOTE: OTHER AREAS THAT MUST MATCH CHANGES HERE ARE:
|
||||||
|
//GlobalBizSettingsController::GetClientGlobalBizSettings
|
||||||
|
//ServerGlobalBizSettings
|
||||||
|
|
||||||
//Picklist and other searches override the normal case insensitive value
|
//Picklist and other searches override the normal case insensitive value
|
||||||
//this is precautionarily added for non latinate languages where it could be an issue
|
//this is precautionarily added for non latinate languages where it could be an issue
|
||||||
public bool SearchCaseSensitiveOnly { get; set; }
|
public bool SearchCaseSensitiveOnly { get; set; }
|
||||||
|
public bool UseInventory { get; set; }
|
||||||
|
|
||||||
|
|
||||||
// public bool NotificationSystemActive { get; set; }
|
|
||||||
|
|
||||||
public GlobalBizSettings()
|
public GlobalBizSettings()
|
||||||
{
|
{
|
||||||
Id = 1;//always 1
|
Id = 1;//always 1
|
||||||
SearchCaseSensitiveOnly = false;
|
SearchCaseSensitiveOnly = false;
|
||||||
//NO, notification system is *always* active, if they don't want email delivery that's an OPS setting NotificationSystemActive = true;
|
UseInventory = true;
|
||||||
//keeping this in case I forget and try to re-implement
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
CREATE TABLE [dbo].[AGLOBAL](
|
||||||
|
[ACREATED] [datetime] NULL,
|
||||||
|
[AMODIFIED] [datetime] NULL,
|
||||||
|
[ACREATOR] [uniqueidentifier] NULL,
|
||||||
|
[AMODIFIER] [uniqueidentifier] NULL,
|
||||||
|
[ATAXPARTPURCHASEID] [uniqueidentifier] NULL,
|
||||||
|
[ATAXPARTSALEID] [uniqueidentifier] NULL,
|
||||||
|
[ATAXRATESALEID] [uniqueidentifier] NULL,
|
||||||
|
[AALLOWSCHEDULECONFLICTS] [bit] NOT NULL,
|
||||||
|
[ALANGUAGE] [nvarchar](255) NULL,
|
||||||
|
[AUSEREGIONS] [bit] NOT NULL,
|
||||||
|
[AWORKORDERCLOSEDSTATUS] [uniqueidentifier] NULL,
|
||||||
|
[AWORKORDERSUMMARYTEMPLATE] [nvarchar](500) NOT NULL,
|
||||||
|
[AUSEINVENTORY] [bit] NOT NULL,
|
||||||
|
[AUNITNAMEFORMAT] [smallint] NULL,
|
||||||
|
[ASCHEDULEABLEUSERNAMEFORMAT] [smallint] NULL,
|
||||||
|
[ACJKINDEX] [bit] NOT NULL,
|
||||||
|
[APARTFORMAT] [smallint] NULL,
|
||||||
|
[AWORKORDERCLOSEBYAGE] [int] NOT NULL,
|
||||||
|
[AUSENOTIFICATION] [bit] NOT NULL,
|
||||||
|
[ANOTIFYSMTPHOST] [nvarchar](255) NULL,
|
||||||
|
[ANOTIFYSMTPACCOUNT] [nvarchar](255) NULL,
|
||||||
|
[ANOTIFYSMTPPASSWORD] [nvarchar](255) NULL,
|
||||||
|
[ANOTIFYSMTPFROM] [nvarchar](255) NULL,
|
||||||
|
[ACOORDINATESTYLE] [smallint] NULL,
|
||||||
|
[ADEFAULTLATITUDE] [smallint] NULL,
|
||||||
|
[ADEFAULTLONGITUDE] [smallint] NULL,
|
||||||
|
[ADEFAULTSERVICETEMPLATEID] [uniqueidentifier] NULL,
|
||||||
|
[AMAXFILESIZEMB] [int] NULL,
|
||||||
|
[ALABORSCHEDUSERDFLTTIMESPAN] [int] NOT NULL,
|
||||||
|
[ATRAVELDFLTTIMESPAN] [int] NOT NULL,
|
||||||
|
[ANOTIFYENCRYPTION] [nvarchar](255) NULL,
|
||||||
|
[ASMTPRETRY] [bit] NOT NULL,
|
||||||
|
[AFORMCUSTOM] [ntext] NULL,
|
||||||
|
[ASIGNATURETITLE] [ntext] NULL,
|
||||||
|
[ASIGNATUREHEADER] [ntext] NULL,
|
||||||
|
[ASIGNATUREFOOTER] [ntext] NULL,
|
||||||
|
[ASCHEDUSERNONTODAYSTARTTIME] [datetime] NULL,
|
||||||
|
[AMAINGRIDAUTOREFRESH] [bit] NOT NULL
|
||||||
|
*/
|
||||||
@@ -22,7 +22,7 @@ namespace AyaNova.Util
|
|||||||
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
|
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
|
||||||
private const int DESIRED_SCHEMA_LEVEL = 15;
|
private const int DESIRED_SCHEMA_LEVEL = 15;
|
||||||
|
|
||||||
internal const long EXPECTED_COLUMN_COUNT = 699;
|
internal const long EXPECTED_COLUMN_COUNT = 700;
|
||||||
internal const long EXPECTED_INDEX_COUNT = 122;
|
internal const long EXPECTED_INDEX_COUNT = 122;
|
||||||
|
|
||||||
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
|
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
|
||||||
@@ -230,8 +230,10 @@ namespace AyaNova.Util
|
|||||||
LogUpdateMessage(log);
|
LogUpdateMessage(log);
|
||||||
|
|
||||||
//create global biz settings table
|
//create global biz settings table
|
||||||
await ExecQueryAsync("CREATE TABLE aglobalbizsettings (id INTEGER NOT NULL PRIMARY KEY, " +
|
await ExecQueryAsync("CREATE TABLE aglobalbizsettings (id INTEGER NOT NULL PRIMARY KEY, "
|
||||||
"searchcasesensitiveonly BOOL default false)");
|
+ "searchcasesensitiveonly BOOL default false, "
|
||||||
|
+ "useinventory BOOL default true "
|
||||||
|
+ ")");
|
||||||
|
|
||||||
//create global ops BACKUP settings table
|
//create global ops BACKUP settings table
|
||||||
await ExecQueryAsync("CREATE TABLE aglobalopsbackupsettings (id INTEGER NOT NULL PRIMARY KEY, active BOOL NOT NULL, " +
|
await ExecQueryAsync("CREATE TABLE aglobalopsbackupsettings (id INTEGER NOT NULL PRIMARY KEY, active BOOL NOT NULL, " +
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ namespace AyaNova.Util
|
|||||||
{
|
{
|
||||||
|
|
||||||
internal static bool SearchCaseSensitiveOnly { get; set; }
|
internal static bool SearchCaseSensitiveOnly { get; set; }
|
||||||
//NO always active, email delivery is a separate setting but app delivery is always there internal static bool NotificationSystemActive { get; set; }
|
internal static bool UseInventory {get;set;}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Populate and / or create the settings
|
/// Populate and / or create the settings
|
||||||
@@ -40,7 +42,7 @@ namespace AyaNova.Util
|
|||||||
|
|
||||||
//We have the object, now copy the static values here
|
//We have the object, now copy the static values here
|
||||||
SearchCaseSensitiveOnly = global.SearchCaseSensitiveOnly;
|
SearchCaseSensitiveOnly = global.SearchCaseSensitiveOnly;
|
||||||
// NotificationSystemActive = global.NotificationSystemActive;
|
UseInventory = global.UseInventory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user