This commit is contained in:
2020-05-11 15:53:21 +00:00
parent 7c431f1efe
commit aef7c9dbe2

View File

@@ -270,22 +270,22 @@ namespace AyaNova.PlugIn.V8
#region Misc utils
//Used to ensure a unique name generated by appending -nnn is within length requirements by splitting and chopping part of text to keep name
public static string UniqueNameBuilder(string oldName, long appendValue, int maxLength)
{
//deadman switch
if (appendValue > int.MaxValue)
{
throw new System.OverflowException("UniqueNameBuilder: Unique name could not be generated for item \""+oldName+"\" after "+int.MaxValue.ToString()+" attempts");
}
var appendString = "-" + appendValue.ToString();
string ret = oldName + appendString;
var diff = maxLength - ret.Length;
if (diff < 0)
{
ret = oldName.Substring(0, Math.Abs(diff)) + appendString;
}
return ret;
//Used to ensure a unique name generated by appending -nnn is within length requirements by splitting and chopping part of text to keep name
public static string UniqueNameBuilder(string oldName, long appendValue, int maxLength)
{
//deadman switch
if (appendValue > int.MaxValue)
{
throw new System.OverflowException("UniqueNameBuilder: Unique name could not be generated for item \""+oldName+"\" after "+int.MaxValue.ToString()+" attempts");
}
var appendString = "-" + appendValue.ToString();
string ret = oldName + appendString;
var diff = maxLength - ret.Length;
if (diff < 0)
{
ret = oldName.Substring(0, Math.Abs(diff)) + appendString;
}
return ret;
}
//used to set nonsense values from imported user login and password
@@ -415,68 +415,87 @@ namespace AyaNova.PlugIn.V8
//***IMPORTANT: Also need to add translations for any new biz objects added that don't match exactly the name here in the key
//because enumlist gets it that way, i.e. "Global" would be the expected key
NoType = 0,
Global = 1,
//Corebiz
Widget = 2,//attachable, wikiable, reviewable
//Corebiz
User = 3,//attachable, wikiable, reviewable
ServerState = 4,
License = 5,
LogFile = 6,
PickListTemplate = 7,
//Corebiz
Customer = 8,
ServerJob = 9,
//Corebiz
Contract = 10,
TrialSeeder = 11,
Metrics = 12,
Translation = 13,
UserOptions = 14,
//Corebiz
HeadOffice = 15,
//Corebiz
LoanUnit = 16,
FileAttachment = 17,
DataListView = 18,
FormCustom = 19,
//Corebiz
Part = 20,
//Corebiz
PM = 21,
//Corebiz
PMItem = 22,
//Corebiz
PMTemplate = 23,
//Corebiz
PMTemplateItem = 24,
//Corebiz
Project = 25,
//Corebiz
PurchaseOrder = 26,
//Corebiz
Quote = 27,
//Corebiz
QuoteItem = 28,
//Corebiz
QuoteTemplate = 29,
//Corebiz
QuoteTemplateItem = 30,
//Corebiz
Unit = 31,
//Corebiz
UnitModel = 32,
//Corebiz
Vendor = 33,
//Corebiz
WorkOrder = 34,
//Corebiz
WorkOrderItem = 35,
//Corebiz
WorkOrderTemplate = 36,
//Corebiz
WorkOrderTemplateItem = 37
NoType = 0,
Global = 1,
//
Widget = 2,//attachable, wikiable, reviewable
//
User = 3,//attachable, wikiable, reviewable
ServerState = 4,
License = 5,
LogFile = 6,
PickListTemplate = 7,
//
Customer = 8,
ServerJob = 9,
//
Contract = 10,
TrialSeeder = 11,
Metrics = 12,
Translation = 13,
UserOptions = 14,
//
HeadOffice = 15,
//
LoanUnit = 16,
FileAttachment = 17,
DataListView = 18,
FormCustom = 19,
//
Part = 20,
//
PM = 21,
//
PMItem = 22,
//
PMTemplate = 23,
//
PMTemplateItem = 24,
//
Project = 25,
//
PurchaseOrder = 26,
//
Quote = 27,
//
QuoteItem = 28,
//
QuoteTemplate = 29,
//
QuoteTemplateItem = 30,
//
Unit = 31,
//
UnitModel = 32,
//
Vendor = 33,
//
WorkOrder = 34,
//
WorkOrderItem = 35,
//
WorkOrderItemLabor = 36,
//
WorkOrderItemPart = 37,
//
WorkOrderItemPartRequest = 38,
//
WorkOrderItemScheduledUser = 39,
//
WorkOrderItemExpense = 40,
//
WorkOrderItemTravel = 41,
//
WorkOrderItemTask = 42,
//
WorkOrderItemLoan = 43,
//
WorkOrderItemUnit = 44,
//
WorkOrderTemplate = 45,
//
WorkOrderTemplateItem = 46
//NOTE: New objects added here need to also be added to the following classes: