This commit is contained in:
@@ -79,6 +79,7 @@ namespace AyaNova.Api.Controllers
|
||||
ret.Add(new KeyValuePair<string, string>("coreall", "All Core AyaNova business object types"));
|
||||
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>(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"));
|
||||
@@ -149,6 +150,37 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (keyNameInLowerCase == "reportable")
|
||||
{
|
||||
//reportable biz objects for report designer selection
|
||||
var values = Enum.GetValues(typeof(AyaType));
|
||||
foreach (AyaType t in values)
|
||||
{
|
||||
if (t.HasAttribute(typeof(ReportableBizObject)))
|
||||
{
|
||||
TranslationKeysToFetch.Add(t.ToString());
|
||||
}
|
||||
}
|
||||
var LT = await TranslationBiz.GetSubsetStaticAsync(TranslationKeysToFetch, translationId);
|
||||
|
||||
foreach (AyaType t in values)
|
||||
{
|
||||
if (t.HasAttribute(typeof(ReportableBizObject)))
|
||||
{
|
||||
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
|
||||
{
|
||||
|
||||
@@ -231,7 +263,7 @@ namespace AyaNova.Api.Controllers
|
||||
else if (keyNameInLowerCase == StringUtil.TrimTypeName(typeof(AyaType).ToString()).ToLowerInvariant())
|
||||
{
|
||||
//this is intended primarily for developers, not for UI facing so no need to localize or pretty it up
|
||||
//bullshit, it's just extra work not translated and developers only need the number, not the enumeration name which is for here only
|
||||
//bs, it's just extra work not translated and developers only need the number, not the enumeration name which is for here only
|
||||
|
||||
var values = Enum.GetValues(typeof(AyaType));
|
||||
|
||||
|
||||
@@ -23,115 +23,115 @@ namespace AyaNova.Biz
|
||||
|
||||
NoType = 0,
|
||||
Global = 1,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
Widget = 2,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
User = 3,
|
||||
ServerState = 4,
|
||||
License = 5,
|
||||
LogFile = 6,
|
||||
PickListTemplate = 7,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
Customer = 8,
|
||||
ServerJob = 9,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
Contract = 10,
|
||||
TrialSeeder = 11,
|
||||
ServerMetrics = 12,
|
||||
Translation = 13,
|
||||
UserOptions = 14,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
HeadOffice = 15,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
LoanUnit = 16,
|
||||
FileAttachment = 17,
|
||||
DataListSavedFilter = 18,
|
||||
FormCustom = 19,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
Part = 20,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
PM = 21,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
PMItem = 22,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
QuoteItemExpense = 23,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
QuoteItemLabor = 24,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
Project = 25,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
PurchaseOrder = 26,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
Quote = 27,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
QuoteItem = 28,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
QuoteItemLoan = 29,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
QuoteItemPart = 30,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
Unit = 31,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
UnitModel = 32,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
Vendor = 33,
|
||||
//--- WorkOrder
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
WorkOrder = 34,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
WorkOrderItem = 35,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
WorkOrderItemExpense = 36,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
WorkOrderItemLabor = 37,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
WorkOrderItemLoan = 38,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
WorkOrderItemPart = 39,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
WorkOrderItemPartRequest = 40,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
WorkOrderItemScheduledUser = 41,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
WorkOrderItemTask = 42,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
WorkOrderItemTravel = 43,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
WorkOrderItemUnit = 44,
|
||||
//---
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
QuoteItemScheduledUser = 45,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
QuoteItemTask = 46,
|
||||
GlobalOps = 47,//really only used for rights, not an object type of any kind
|
||||
BizMetrics = 48,//deprecate? Not used for anything as of nov 2020
|
||||
Backup = 49,
|
||||
Notification = 50,
|
||||
NotifySubscription = 51,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
Reminder = 52,
|
||||
UnitMeterReading = 53,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
CustomerServiceRequest = 54,
|
||||
// ServiceBank = 55,
|
||||
OpsNotificationSettings = 56,
|
||||
Report = 57,
|
||||
DashboardView = 58,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
CustomerNote = 59,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
Memo = 60,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
Review = 61,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
ServiceRate = 62,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
TravelRate = 63,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
TaxCode = 64,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
PartAssembly = 65,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
PartWarehouse = 66,
|
||||
PartInventory = 67,
|
||||
DataListColumnView = 68,
|
||||
@@ -142,32 +142,34 @@ namespace AyaNova.Biz
|
||||
WorkOrderItemOutsideService = 73,
|
||||
WorkOrderItemPriority = 74,
|
||||
WorkOrderItemStatus = 75,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
QuoteItemTravel = 76,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
QuoteItemUnit = 77,
|
||||
QuoteStatus = 78,
|
||||
QuoteItemOutsideService = 79,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
PMItemExpense = 80,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
PMItemLabor = 81,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
PMItemLoan = 82,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
PMItemPart = 83,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
PMItemPartRequest = 84,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
PMItemScheduledUser = 85,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
PMItemTask = 86,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
PMItemTravel = 87,
|
||||
[CoreBizObject]
|
||||
[CoreBizObject,ReportableBizObject]
|
||||
PMItemUnit = 88,
|
||||
PMItemOutsideService = 89,
|
||||
PartInventoryDataList = 90,//for list/reporting only, synthetic object
|
||||
[ReportableBizObject]
|
||||
PartInventoryDataList = 90,//for list/reporting only, synthetic object
|
||||
[ReportableBizObject]
|
||||
PartInventoryRequestDataList = 91//for list/reporting only, synthetic object
|
||||
|
||||
|
||||
|
||||
15
server/AyaNova/biz/ReportableBizObjectAttribute.cs
Normal file
15
server/AyaNova/biz/ReportableBizObjectAttribute.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace AyaNova.Biz
|
||||
{
|
||||
/// <summary>
|
||||
/// Marker attribute indicating that an object is a reportable type
|
||||
/// Used in <see cref="AyaType"/>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public class ReportableBizObjectAttribute : 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