This commit is contained in:
@@ -81,6 +81,7 @@ namespace AyaNova.Api.Controllers
|
||||
ret.Add(new KeyValuePair<string, string>("coreview", "All Core AyaNova business object types current user is allowed to view"));
|
||||
ret.Add(new KeyValuePair<string, string>("coreedit", "All Core AyaNova business object types current user is allowed to edit"));
|
||||
ret.Add(new KeyValuePair<string, string>("reportable", "All AyaNova business object types that are reportable"));
|
||||
ret.Add(new KeyValuePair<string, string>("importable", "All AyaNova business object types that are importable"));
|
||||
ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(UiFieldDataType).ToString()), "Types of data used in AyaNova for display and formatting UI purposes"));
|
||||
ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(NotifyEventType).ToString()), "Notification event types"));
|
||||
ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(NotifyDeliveryMethod).ToString()), "Notification delivery methods"));
|
||||
@@ -181,6 +182,36 @@ namespace AyaNova.Api.Controllers
|
||||
ReturnList.Add(new NameIdItem() { Name = name, Id = (long)t });
|
||||
}
|
||||
}
|
||||
} else if (keyNameInLowerCase == "importable")
|
||||
{
|
||||
//importable biz objects for administration -> import selection
|
||||
var values = Enum.GetValues(typeof(AyaType));
|
||||
foreach (AyaType t in values)
|
||||
{
|
||||
if (t.HasAttribute(typeof(ImportableBizObjectAttribute)))
|
||||
{
|
||||
TranslationKeysToFetch.Add(t.ToString());
|
||||
}
|
||||
}
|
||||
var LT = await TranslationBiz.GetSubsetStaticAsync(TranslationKeysToFetch, translationId);
|
||||
|
||||
foreach (AyaType t in values)
|
||||
{
|
||||
if (t.HasAttribute(typeof(ImportableBizObjectAttribute)))
|
||||
{
|
||||
var tName = t.ToString();
|
||||
string name = string.Empty;
|
||||
if (LT.ContainsKey(tName))
|
||||
{
|
||||
name = LT[tName];
|
||||
}
|
||||
else
|
||||
{
|
||||
name = tName;
|
||||
}
|
||||
ReturnList.Add(new NameIdItem() { Name = name, Id = (long)t });
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (keyNameInLowerCase == "coreview")//all core objects user can read
|
||||
{
|
||||
|
||||
@@ -24,13 +24,13 @@ namespace AyaNova.Biz
|
||||
NoType = 0,
|
||||
Global = 1,
|
||||
FormUserOptions = 2,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
[CoreBizObject, ReportableBizObject, ImportableBizObject]
|
||||
User = 3,
|
||||
ServerState = 4,
|
||||
License = 5,
|
||||
LogFile = 6,
|
||||
PickListTemplate = 7,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
[CoreBizObject, ReportableBizObject, ImportableBizObject]
|
||||
Customer = 8,
|
||||
ServerJob = 9,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
@@ -39,14 +39,14 @@ namespace AyaNova.Biz
|
||||
ServerMetrics = 12,
|
||||
Translation = 13,
|
||||
UserOptions = 14,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
[CoreBizObject, ReportableBizObject, ImportableBizObject]
|
||||
HeadOffice = 15,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
[CoreBizObject, ReportableBizObject, ImportableBizObject]
|
||||
LoanUnit = 16,
|
||||
FileAttachment = 17,
|
||||
DataListSavedFilter = 18,
|
||||
FormCustom = 19,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
[CoreBizObject, ReportableBizObject, ImportableBizObject]
|
||||
Part = 20,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
PM = 21,
|
||||
@@ -56,7 +56,7 @@ namespace AyaNova.Biz
|
||||
QuoteItemExpense = 23,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
QuoteItemLabor = 24,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
[CoreBizObject, ReportableBizObject, ImportableBizObject]
|
||||
Project = 25,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
PurchaseOrder = 26,
|
||||
@@ -68,11 +68,11 @@ namespace AyaNova.Biz
|
||||
QuoteItemLoan = 29,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
QuoteItemPart = 30,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
[CoreBizObject, ReportableBizObject, ImportableBizObject]
|
||||
Unit = 31,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
[CoreBizObject, ReportableBizObject, ImportableBizObject]
|
||||
UnitModel = 32,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
[CoreBizObject, ReportableBizObject, ImportableBizObject]
|
||||
Vendor = 33,
|
||||
//--- WorkOrder
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
@@ -107,11 +107,11 @@ namespace AyaNova.Biz
|
||||
Backup = 49,
|
||||
Notification = 50,
|
||||
NotifySubscription = 51,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
[CoreBizObject, ReportableBizObject, ImportableBizObject]
|
||||
Reminder = 52,
|
||||
[ReportableBizObject]
|
||||
UnitMeterReading = 53,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
[CoreBizObject, ReportableBizObject, ImportableBizObject]
|
||||
CustomerServiceRequest = 54,
|
||||
// ServiceBank = 55,
|
||||
OpsNotificationSettings = 56,
|
||||
@@ -119,19 +119,19 @@ namespace AyaNova.Biz
|
||||
DashboardView = 58,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
CustomerNote = 59,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
[CoreBizObject, ReportableBizObject, ImportableBizObject]
|
||||
Memo = 60,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
[CoreBizObject, ReportableBizObject, ImportableBizObject]
|
||||
Review = 61,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
[CoreBizObject, ReportableBizObject, ImportableBizObject]
|
||||
ServiceRate = 62,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
[CoreBizObject, ReportableBizObject, ImportableBizObject]
|
||||
TravelRate = 63,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
[CoreBizObject, ReportableBizObject, ImportableBizObject]
|
||||
TaxCode = 64,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
[CoreBizObject, ReportableBizObject, ImportableBizObject]
|
||||
PartAssembly = 65,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
[CoreBizObject, ReportableBizObject, ImportableBizObject]
|
||||
PartWarehouse = 66,
|
||||
[ReportableBizObject]
|
||||
PartInventory = 67,
|
||||
@@ -139,7 +139,7 @@ namespace AyaNova.Biz
|
||||
PartInventoryRestock = 69,//for list only, synthetic object
|
||||
PartInventoryRequest = 70,//for list only, synthetic object
|
||||
WorkOrderStatus = 71,
|
||||
[ReportableBizObject]
|
||||
[ReportableBizObject, ImportableBizObject]
|
||||
TaskGroup = 72,
|
||||
[CoreBizObject, ReportableBizObject]
|
||||
WorkOrderItemOutsideService = 73,
|
||||
|
||||
15
server/AyaNova/biz/ImportableBizObjectAttribute.cs
Normal file
15
server/AyaNova/biz/ImportableBizObjectAttribute.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace AyaNova.Biz
|
||||
{
|
||||
/// <summary>
|
||||
/// Marker attribute indicating that an object is a importable type
|
||||
/// Used in <see cref="AyaType"/>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public class ImportableBizObjectAttribute : Attribute
|
||||
{
|
||||
//No code required, it's just a marker
|
||||
//https://docs.microsoft.com/en-us/dotnet/standard/attributes/writing-custom-attributes
|
||||
}
|
||||
}//eons
|
||||
Reference in New Issue
Block a user