rename all variants of naming that hold an AyaType value to "aType" (parameter) / "AType" (not parameter) everywhere front and back; "ayType", "objectType", "oType" all are used in various areas

This commit is contained in:
2021-03-23 17:06:05 +00:00
parent dfef3f7934
commit dde1b8bb8c
113 changed files with 450 additions and 450 deletions

View File

@@ -41,23 +41,23 @@ namespace AyaNova.Api.ControllerHelpers
/// any access at all?
/// </summary>
/// <param name="HttpContextItems"></param>
/// <param name="objectType"></param>
/// <param name="aType"></param>
/// <returns></returns>
internal static bool HasAnyRole(IDictionary<object, object> HttpContextItems, AyaType objectType)
internal static bool HasAnyRole(IDictionary<object, object> HttpContextItems, AyaType aType)
{
AuthorizationRoles currentUserRoles = UserRolesFromContext.Roles(HttpContextItems);
return HasAnyRole(currentUserRoles, objectType);
return HasAnyRole(currentUserRoles, aType);
}
/// <summary>
/// User has any access at all to this object?
/// </summary>
/// <param name="currentUserRoles"></param>
/// <param name="objectType"></param>
/// <param name="aType"></param>
/// <returns></returns>
internal static bool HasAnyRole(AuthorizationRoles currentUserRoles, AyaType objectType)
internal static bool HasAnyRole(AuthorizationRoles currentUserRoles, AyaType aType)
{
var RoleSet = BizRoles.GetRoleSet(objectType);
var RoleSet = BizRoles.GetRoleSet(aType);
if (RoleSet == null) return false;
var AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change | RoleSet.Select;
return currentUserRoles.HasAnyFlags(AllowedRoles);
@@ -67,23 +67,23 @@ namespace AyaNova.Api.ControllerHelpers
/// READ FULL RECORD (not just name and id)
/// </summary>
/// <param name="HttpContextItems"></param>
/// <param name="objectType"></param>
/// <param name="aType"></param>
/// <returns></returns>
internal static bool HasSelectRole(IDictionary<object, object> HttpContextItems, AyaType objectType)
internal static bool HasSelectRole(IDictionary<object, object> HttpContextItems, AyaType aType)
{
AuthorizationRoles currentUserRoles = UserRolesFromContext.Roles(HttpContextItems);
return HasSelectRole(currentUserRoles, objectType);
return HasSelectRole(currentUserRoles, aType);
}
/// <summary>
/// SELECT BY NAME
/// </summary>
/// <param name="currentUserRoles"></param>
/// <param name="objectType"></param>
/// <param name="aType"></param>
/// <returns></returns>
internal static bool HasSelectRole(AuthorizationRoles currentUserRoles, AyaType objectType)
internal static bool HasSelectRole(AuthorizationRoles currentUserRoles, AyaType aType)
{
var RoleSet = BizRoles.GetRoleSet(objectType);
var RoleSet = BizRoles.GetRoleSet(aType);
if (RoleSet == null) return false;
//NOTE: this assumes that if you can change you can read
@@ -104,24 +104,24 @@ namespace AyaNova.Api.ControllerHelpers
/// READ FULL RECORD (not just name and id)
/// </summary>
/// <param name="HttpContextItems"></param>
/// <param name="objectType"></param>
/// <param name="aType"></param>
/// <returns></returns>
internal static bool HasReadFullRole(IDictionary<object, object> HttpContextItems, AyaType objectType)
internal static bool HasReadFullRole(IDictionary<object, object> HttpContextItems, AyaType aType)
{
AuthorizationRoles currentUserRoles = UserRolesFromContext.Roles(HttpContextItems);
return HasReadFullRole(currentUserRoles, objectType);
return HasReadFullRole(currentUserRoles, aType);
}
/// <summary>
/// READ FULL RECORD (not just name and id)
/// </summary>
/// <param name="currentUserRoles"></param>
/// <param name="objectType"></param>
/// <param name="aType"></param>
/// <returns></returns>
internal static bool HasReadFullRole(AuthorizationRoles currentUserRoles, AyaType objectType)
internal static bool HasReadFullRole(AuthorizationRoles currentUserRoles, AyaType aType)
{
//NOTE: this assumes that if you can change you can read
var RoleSet = BizRoles.GetRoleSet(objectType);
var RoleSet = BizRoles.GetRoleSet(aType);
if (RoleSet == null) return false;
var AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
return currentUserRoles.HasAnyFlags(AllowedRoles);
@@ -133,23 +133,23 @@ namespace AyaNova.Api.ControllerHelpers
/// CREATE
/// </summary>
/// <param name="HttpContextItems"></param>
/// <param name="objectType"></param>
/// <param name="aType"></param>
/// <returns></returns>
internal static bool HasCreateRole(IDictionary<object, object> HttpContextItems, AyaType objectType)
internal static bool HasCreateRole(IDictionary<object, object> HttpContextItems, AyaType aType)
{
AuthorizationRoles currentUserRoles = UserRolesFromContext.Roles(HttpContextItems);
return HasCreateRole(currentUserRoles, objectType);
return HasCreateRole(currentUserRoles, aType);
}
/// <summary>
/// CREATE
/// </summary>
/// <param name="currentUserRoles"></param>
/// <param name="objectType"></param>
/// <param name="aType"></param>
/// <returns></returns>
internal static bool HasCreateRole(AuthorizationRoles currentUserRoles, AyaType objectType)
internal static bool HasCreateRole(AuthorizationRoles currentUserRoles, AyaType aType)
{
var RoleSet = BizRoles.GetRoleSet(objectType);
var RoleSet = BizRoles.GetRoleSet(aType);
if (RoleSet == null) return false;
if (currentUserRoles.HasAnyFlags(RoleSet.Change))
return true;
@@ -161,13 +161,13 @@ namespace AyaNova.Api.ControllerHelpers
/// MODIFY
/// </summary>
/// <param name="HttpContextItems"></param>
/// <param name="objectType"></param>
/// <param name="aType"></param>
/// <returns></returns>
internal static bool HasModifyRole(IDictionary<object, object> HttpContextItems, AyaType objectType)
internal static bool HasModifyRole(IDictionary<object, object> HttpContextItems, AyaType aType)
{
AuthorizationRoles currentUserRoles = UserRolesFromContext.Roles(HttpContextItems);
return HasModifyRole(currentUserRoles, objectType);
return HasModifyRole(currentUserRoles, aType);
}
@@ -175,11 +175,11 @@ namespace AyaNova.Api.ControllerHelpers
/// MODIFY
/// </summary>
/// <param name="currentUserRoles"></param>
/// <param name="objectType"></param>
/// <param name="aType"></param>
/// <returns></returns>
internal static bool HasModifyRole(AuthorizationRoles currentUserRoles, AyaType objectType)
internal static bool HasModifyRole(AuthorizationRoles currentUserRoles, AyaType aType)
{
var RoleSet = BizRoles.GetRoleSet(objectType);
var RoleSet = BizRoles.GetRoleSet(aType);
if (RoleSet == null) return false;
if (currentUserRoles.HasAnyFlags(RoleSet.Change))
return true;
@@ -193,14 +193,14 @@ namespace AyaNova.Api.ControllerHelpers
/// DELETE
/// </summary>
/// <param name="HttpContextItems"></param>
/// <param name="objectType"></param>
/// <param name="aType"></param>
/// <returns></returns>
//For now just going to treat as a modify, but for maximum flexibility keeping this as a separate method in case we change our minds in future
internal static bool HasDeleteRole(IDictionary<object, object> HttpContextItems, AyaType objectType)
internal static bool HasDeleteRole(IDictionary<object, object> HttpContextItems, AyaType aType)
{
AuthorizationRoles currentUserRoles = UserRolesFromContext.Roles(HttpContextItems);
long currentUserId = UserIdFromContext.Id(HttpContextItems);
return HasDeleteRole(currentUserRoles, objectType);
return HasDeleteRole(currentUserRoles, aType);
}
@@ -208,12 +208,12 @@ namespace AyaNova.Api.ControllerHelpers
/// DELETE
/// </summary>
/// <param name="currentUserRoles"></param>
/// <param name="objectType"></param>
/// <param name="aType"></param>
/// <returns></returns>
//For now just going to treat as a modify, but for maximum flexibility keeping this as a separate method in case we change our minds in future
internal static bool HasDeleteRole(AuthorizationRoles currentUserRoles, AyaType objectType)
internal static bool HasDeleteRole(AuthorizationRoles currentUserRoles, AyaType aType)
{
var RoleSet = BizRoles.GetRoleSet(objectType);
var RoleSet = BizRoles.GetRoleSet(aType);
if (RoleSet == null) return false;
if (currentUserRoles.HasAnyFlags(RoleSet.Change))
return true;

View File

@@ -86,7 +86,7 @@ namespace AyaNova.Api.Controllers
long UserId = UserIdFromContext.Id(HttpContext.Items);
if (!Authorized.HasModifyRole(HttpContext.Items, dbObject.AttachToObjectType))
if (!Authorized.HasModifyRole(HttpContext.Items, dbObject.AttachToAType))
{
return StatusCode(403, new ApiNotAuthorizedResponse());
}
@@ -115,7 +115,7 @@ namespace AyaNova.Api.Controllers
ct.Entry(dbObject).OriginalValues["Concurrency"] = inObj.Concurrency;
//Log event and save context
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.AttachToObjectId, dbObject.AttachToObjectType, AyaEvent.AttachmentModified, ChangeTextra), ct);
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.AttachToObjectId, dbObject.AttachToAType, AyaEvent.AttachmentModified, ChangeTextra), ct);
@@ -133,7 +133,7 @@ namespace AyaNova.Api.Controllers
}
//Normallyh wouldn't return a whole list but in this case the UI demands it because of reactivity issues
var ret = await GetFileListForObjectAsync(dbObject.AttachToObjectType, dbObject.AttachToObjectId);
var ret = await GetFileListForObjectAsync(dbObject.AttachToAType, dbObject.AttachToObjectId);
return Ok(ApiOkResponse.Response(ret));
}
@@ -189,7 +189,7 @@ namespace AyaNova.Api.Controllers
return NotFound();
return Ok(ApiOkResponse.Response(new { id = at.AttachToObjectId, type = at.AttachToObjectType }));
return Ok(ApiOkResponse.Response(new { id = at.AttachToObjectId, type = at.AttachToAType }));
}
@@ -224,7 +224,7 @@ namespace AyaNova.Api.Controllers
bool badRequest = false;
string AttachToObjectType = string.Empty;
string AttachToAType = string.Empty;
string AttachToObjectId = string.Empty;
string errorMessage = string.Empty;
string Notes = string.Empty;
@@ -239,15 +239,15 @@ namespace AyaNova.Api.Controllers
if (!badRequest
&& (!uploadFormData.FormFieldData.ContainsKey("FileData")
|| !uploadFormData.FormFieldData.ContainsKey("AttachToObjectType")
|| !uploadFormData.FormFieldData.ContainsKey("AttachToAType")
|| !uploadFormData.FormFieldData.ContainsKey("AttachToObjectId")))
{
badRequest = true;
errorMessage = "Missing one or more required FormFieldData values: AttachToObjectType, AttachToObjectId, FileData";
errorMessage = "Missing one or more required FormFieldData values: AttachToAType, AttachToObjectId, FileData";
}
if (!badRequest)
{
AttachToObjectType = uploadFormData.FormFieldData["AttachToObjectType"].ToString();
AttachToAType = uploadFormData.FormFieldData["AttachToAType"].ToString();
AttachToObjectId = uploadFormData.FormFieldData["AttachToObjectId"].ToString();
if (uploadFormData.FormFieldData.ContainsKey("Notes"))
Notes = uploadFormData.FormFieldData["Notes"].ToString();
@@ -255,10 +255,10 @@ namespace AyaNova.Api.Controllers
//"[{\"name\":\"Client.csv\",\"lastModified\":1582822079618},{\"name\":\"wmi4fu06nrs41.jpg\",\"lastModified\":1586900220990}]"
FileData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<UploadFileData>>(uploadFormData.FormFieldData["FileData"].ToString());
if (string.IsNullOrWhiteSpace(AttachToObjectType) || string.IsNullOrWhiteSpace(AttachToObjectId))
if (string.IsNullOrWhiteSpace(AttachToAType) || string.IsNullOrWhiteSpace(AttachToObjectId))
{
badRequest = true;
errorMessage = "AttachToObjectType and / or AttachToObjectId are empty and are required";
errorMessage = "AttachToAType and / or AttachToObjectId are empty and are required";
}
}
@@ -267,11 +267,11 @@ namespace AyaNova.Api.Controllers
if (!badRequest)
{
attachToObject = new AyaTypeId(AttachToObjectType, AttachToObjectId);
attachToObject = new AyaTypeId(AttachToAType, AttachToObjectId);
if (attachToObject.IsEmpty)
{
badRequest = true;
errorMessage = "AttachToObjectType and / or AttachToObjectId are not valid and are required";
errorMessage = "AttachToAType and / or AttachToObjectId are not valid and are required";
}
}
@@ -281,7 +281,7 @@ namespace AyaNova.Api.Controllers
if (!attachToObject.IsCoreBizObject)
{
badRequest = true;
errorMessage = attachToObject.ObjectType.ToString() + " - AttachToObjectType does not support attachments";
errorMessage = attachToObject.AType.ToString() + " - AttachToAType does not support attachments";
}
}
@@ -290,7 +290,7 @@ namespace AyaNova.Api.Controllers
if (!badRequest)
{
//check if object exists
if (!await BizObjectExistsInDatabase.ExistsAsync(attachToObject.ObjectType, attachToObject.ObjectId, ct))
if (!await BizObjectExistsInDatabase.ExistsAsync(attachToObject.AType, attachToObject.ObjectId, ct))
{
badRequest = true;
errorMessage = "Invalid attach object";
@@ -298,7 +298,7 @@ namespace AyaNova.Api.Controllers
else
{
// User needs modify rights to the object type in question
if (!Authorized.HasModifyRole(HttpContext.Items, attachToObject.ObjectType))
if (!Authorized.HasModifyRole(HttpContext.Items, attachToObject.AType))
{
//delete temp files
ApiUploadProcessor.DeleteTempUploadFile(uploadFormData);
@@ -354,7 +354,7 @@ namespace AyaNova.Api.Controllers
var v = await FileUtil.StoreFileAttachmentAsync(a.InitialUploadedPathName, a.MimeType, a.OriginalFileName, theDate, attachToObject, Notes, ct);
//EVENT LOG
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, attachToObject.ObjectId, attachToObject.ObjectType, AyaEvent.AttachmentCreate, v.DisplayFileName), ct);
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, attachToObject.ObjectId, attachToObject.AType, AyaEvent.AttachmentCreate, v.DisplayFileName), ct);
//SEARCH INDEXING
var SearchParams = new Search.SearchIndexProcessObjectParameters(UserTranslationIdFromContext.Id(HttpContext.Items), v.Id, AyaType.FileAttachment);
@@ -363,7 +363,7 @@ namespace AyaNova.Api.Controllers
}
}
ret = await GetFileListForObjectAsync(attachToObject.ObjectType, attachToObject.ObjectId);
ret = await GetFileListForObjectAsync(attachToObject.AType, attachToObject.ObjectId);
}
catch (InvalidDataException ex)
{
@@ -415,7 +415,7 @@ namespace AyaNova.Api.Controllers
long UserId = UserIdFromContext.Id(HttpContext.Items);
if (!Authorized.HasDeleteRole(HttpContext.Items, dbObject.AttachToObjectType))
if (!Authorized.HasDeleteRole(HttpContext.Items, dbObject.AttachToAType))
{
return StatusCode(403, new ApiNotAuthorizedResponse());
}
@@ -425,7 +425,7 @@ namespace AyaNova.Api.Controllers
await FileUtil.DeleteFileAttachmentAsync(dbObject, ct);
//Event log process delete
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.AttachToObjectId, dbObject.AttachToObjectType, AyaEvent.AttachmentDelete, dbObject.DisplayFileName), ct);
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.AttachToObjectId, dbObject.AttachToAType, AyaEvent.AttachmentDelete, dbObject.DisplayFileName), ct);
//Delete search index
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, AyaType.FileAttachment, ct);
@@ -461,7 +461,7 @@ namespace AyaNova.Api.Controllers
await FileUtil.DeleteFileAttachmentAsync(dbObject, ct);
//Event log process delete
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.AttachToObjectId, dbObject.AttachToObjectType, AyaEvent.AttachmentDelete, dbObject.DisplayFileName), ct);
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.AttachToObjectId, dbObject.AttachToAType, AyaEvent.AttachmentDelete, dbObject.DisplayFileName), ct);
//Delete search index
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, AyaType.FileAttachment, ct);
@@ -495,13 +495,13 @@ namespace AyaNova.Api.Controllers
continue;
//do the move
var msg = $"{dbObject.DisplayFileName} moved from {dbObject.AttachToObjectType}-{dbObject.AttachToObjectId} to {dt.ToType}-{dt.ToId} ";
var msg = $"{dbObject.DisplayFileName} moved from {dbObject.AttachToAType}-{dbObject.AttachToObjectId} to {dt.ToType}-{dt.ToId} ";
dbObject.AttachToObjectId = dt.ToId;
dbObject.AttachToObjectType = dt.ToType;
dbObject.AttachToAType = dt.ToType;
await ct.SaveChangesAsync();
//Event log process move
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.AttachToObjectId, dbObject.AttachToObjectType, AyaEvent.AttachmentModified, msg), ct);
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.AttachToObjectId, dbObject.AttachToAType, AyaEvent.AttachmentModified, msg), ct);
}
return NoContent();
@@ -546,7 +546,7 @@ namespace AyaNova.Api.Controllers
}
//is this allowed?
if (!Authorized.HasReadFullRole(DownloadUser.Roles, dbObject.AttachToObjectType))
if (!Authorized.HasReadFullRole(DownloadUser.Roles, dbObject.AttachToAType))
{
await Task.Delay(AyaNova.Util.ServerBootConfig.FAILED_AUTH_DELAY);//DOS protection
return StatusCode(403, new ApiNotAuthorizedResponse());
@@ -568,7 +568,7 @@ namespace AyaNova.Api.Controllers
}
//Log
await EventLogProcessor.LogEventToDatabaseAsync(new Event(DownloadUser.Id, dbObject.AttachToObjectId, dbObject.AttachToObjectType, AyaEvent.AttachmentDownload, dbObject.DisplayFileName), ct);
await EventLogProcessor.LogEventToDatabaseAsync(new Event(DownloadUser.Id, dbObject.AttachToObjectId, dbObject.AttachToAType, AyaEvent.AttachmentDownload, dbObject.DisplayFileName), ct);
return PhysicalFile(filePath, mimetype, dbObject.DisplayFileName);
@@ -579,7 +579,7 @@ namespace AyaNova.Api.Controllers
async private Task<object> GetFileListForObjectAsync(AyaType ayaType, long ayaId)
{
return await ct.FileAttachment.AsNoTracking().Where(z => z.AttachToObjectId == ayaId && z.AttachToObjectType == ayaType).OrderBy(z => z.DisplayFileName)
return await ct.FileAttachment.AsNoTracking().Where(z => z.AttachToObjectId == ayaId && z.AttachToAType == ayaType).OrderBy(z => z.DisplayFileName)
.Select(z => new { z.Id, z.Concurrency, z.ContentType, z.DisplayFileName, z.LastModified, z.Notes })
.ToArrayAsync();
// var v = l.OrderBy(z => z.DisplayFileName);
@@ -604,7 +604,7 @@ namespace AyaNova.Api.Controllers
var JobName = $"Attachment maintenance (demand) LT:User {UserNameFromContext.Name(HttpContext.Items)}";
OpsJob j = new OpsJob();
j.Name = JobName;
j.ObjectType = AyaType.FileAttachment;
j.AType = AyaType.FileAttachment;
j.JobType = JobType.AttachmentMaintenance;
j.SubType = JobSubType.NotSet;
j.Exclusive = true;

View File

@@ -66,7 +66,7 @@ namespace AyaNova.Api.Controllers
var JobName = $"LT:BackupNow LT:User {UserNameFromContext.Name(HttpContext.Items)}";
OpsJob j = new OpsJob();
j.Name = JobName;
j.ObjectType = AyaType.NoType;
j.AType = AyaType.NoType;
j.JobType = JobType.Backup;
j.SubType = JobSubType.NotSet;
j.Exclusive = true;

View File

@@ -184,9 +184,9 @@ namespace AyaNova.Api.Controllers
public sealed class UserEventLogItem
{
//DateTime, ObjectType, ObjectId, Event, Textra
//DateTime, AType, ObjectId, Event, Textra
public DateTime Date { get; set; }
public AyaType ObjectType { get; set; }
public AyaType AType { get; set; }
public long ObjectId { get; set; }
public string Name { get; set; }
public AyaEvent Event { get; set; }

View File

@@ -61,7 +61,7 @@ namespace AyaNova.Api.Controllers
if (selectedRequest == null)
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, null, "DataListSelectedRequest is required"));
if (!Authorized.HasReadFullRole(HttpContext.Items, selectedRequest.ObjectType))
if (!Authorized.HasReadFullRole(HttpContext.Items, selectedRequest.AType))
return StatusCode(403, new ApiNotAuthorizedResponse());
if (string.IsNullOrWhiteSpace(format))
@@ -86,12 +86,12 @@ namespace AyaNova.Api.Controllers
UserTranslationId);
log.LogDebug($"Instantiating biz object handler for {selectedRequest.ObjectType}");
var biz = BizObjectFactory.GetBizObject(selectedRequest.ObjectType, ct, UserId, UserRoles, UserTranslationId);
log.LogDebug($"Fetching data for {selectedRequest.SelectedRowIds.Length} {selectedRequest.ObjectType} items");
log.LogDebug($"Instantiating biz object handler for {selectedRequest.AType}");
var biz = BizObjectFactory.GetBizObject(selectedRequest.AType, ct, UserId, UserRoles, UserTranslationId);
log.LogDebug($"Fetching data for {selectedRequest.SelectedRowIds.Length} {selectedRequest.AType} items");
// var TheData = await ((IExportAbleObject)biz).GetJSONExportData(dataListSelection.SelectedRowIds);
string baseFileName = FileUtil.StringToSafeFileName($"{selectedRequest.ObjectType.ToString().ToLowerInvariant()}-{format}-{FileUtil.GetSafeDateFileName()}");
string baseFileName = FileUtil.StringToSafeFileName($"{selectedRequest.AType.ToString().ToLowerInvariant()}-{format}-{FileUtil.GetSafeDateFileName()}");
// string outputRandomFileNameNoExtension = StringUtil.ReplaceLastOccurrence(FileUtil.NewRandomFileName, ".", "");
string outputSourceFileName = baseFileName + "." + format;

View File

@@ -70,7 +70,7 @@ namespace AyaNova.Api.Controllers
// uploadFormData = await ApiUploadProcessor.ProcessUploadAsync(HttpContext);xx
string UploadObjectType = string.Empty;
string UploadAType = string.Empty;
string errorMessage = string.Empty;
string Notes = string.Empty;
@@ -100,10 +100,10 @@ namespace AyaNova.Api.Controllers
return BadRequest(new ApiErrorResponse(ApiErrorCode.INVALID_OPERATION, null, "Missing required FormFieldData value: FileData"));
if (uploadFormData.FormFieldData.ContainsKey("ObjectType"))
UploadObjectType = uploadFormData.FormFieldData["ObjectType"].ToString();
if (uploadFormData.FormFieldData.ContainsKey("AType"))
UploadAType = uploadFormData.FormFieldData["AType"].ToString();
else
return BadRequest(new ApiErrorResponse(ApiErrorCode.INVALID_OPERATION, null, "Missing required FormFieldData value: ObjectType"));
return BadRequest(new ApiErrorResponse(ApiErrorCode.INVALID_OPERATION, null, "Missing required FormFieldData value: AType"));
//fileData in JSON stringify format which contains the actual last modified dates etc
//"[{\"name\":\"Client.csv\",\"lastModified\":1582822079618},{\"name\":\"wmi4fu06nrs41.jpg\",\"lastModified\":1586900220990}]"
@@ -112,7 +112,7 @@ namespace AyaNova.Api.Controllers
//Instantiate the business object handler
AyaType TheType = System.Enum.Parse<AyaType>(UploadObjectType, true);
AyaType TheType = System.Enum.Parse<AyaType>(UploadAType, true);
log.LogDebug($"Instantiating biz object handler for {TheType}");
var biz = BizObjectFactory.GetBizObject(TheType, ct);

View File

@@ -207,7 +207,7 @@ namespace AyaNova.Api.Controllers
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, null, "DataListSelectedRequest is required"));
if (!Authorized.HasDeleteRole(HttpContext.Items, selectedRequest.ObjectType))
if (!Authorized.HasDeleteRole(HttpContext.Items, selectedRequest.AType))
return StatusCode(403, new ApiNotAuthorizedResponse());
//Rehydrate id list if necessary
@@ -220,7 +220,7 @@ namespace AyaNova.Api.Controllers
UserIdFromContext.Id(HttpContext.Items),
UserTranslationIdFromContext.Id(HttpContext.Items));
var JobName = $"LT:BatchDeleteJob - LT:{selectedRequest.ObjectType} ({selectedRequest.SelectedRowIds.LongLength}) LT:User {UserNameFromContext.Name(HttpContext.Items)}";
var JobName = $"LT:BatchDeleteJob - LT:{selectedRequest.AType} ({selectedRequest.SelectedRowIds.LongLength}) LT:User {UserNameFromContext.Name(HttpContext.Items)}";
JObject o = JObject.FromObject(new
{
idList = selectedRequest.SelectedRowIds
@@ -228,7 +228,7 @@ namespace AyaNova.Api.Controllers
OpsJob j = new OpsJob();
j.Name = JobName;
j.ObjectType = selectedRequest.ObjectType;
j.AType = selectedRequest.AType;
j.JobType = JobType.BatchCoreObjectOperation;
j.SubType = JobSubType.Delete;
j.Exclusive = false;

View File

@@ -40,22 +40,22 @@ namespace AyaNova.Api.Controllers
/// not all business objects have names some may return '-' or simply the type name
/// if that is the case
/// </summary>
/// <param name="ayType">AyaType</param>
/// <param name="aType">AyaType</param>
/// <param name="id">Non zero id, if zero returns type name</param>
/// <returns>Name</returns>
[HttpGet("{ayType}/{id}")]
public ActionResult GetName([FromRoute] AyaType ayType, [FromRoute] long id)
[HttpGet("{aType}/{id}")]
public ActionResult GetName([FromRoute] AyaType aType, [FromRoute] long id)
{
if (!serverState.IsOpen)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
if (!Authorized.HasSelectRole(HttpContext.Items, ayType))
if (!Authorized.HasSelectRole(HttpContext.Items, aType))
return StatusCode(403, new ApiNotAuthorizedResponse());
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));
if (id == 0)
return Ok(ApiOkResponse.Response(ayType.ToString()));
return Ok(ApiOkResponse.Response(aType.ToString()));
return Ok(ApiOkResponse.Response(BizObjectNameFetcherDirect.Name(ayType, id, ct)));
return Ok(ApiOkResponse.Response(BizObjectNameFetcherDirect.Name(aType, id, ct)));
}

View File

@@ -160,10 +160,10 @@ namespace AyaNova.Api.Controllers
/// <summary>
/// Get Report list for object
/// </summary>
/// <param name="ayType">Type of object</param>
/// <param name="aType">Type of object</param>
/// <returns>Name / id report list of allowed reports for role of requester</returns>
[HttpGet("list/{ayType}")]
public async Task<IActionResult> GetReportList([FromRoute] AyaType ayType)
[HttpGet("list/{aType}")]
public async Task<IActionResult> GetReportList([FromRoute] AyaType aType)
{
if (!serverState.IsOpen)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
@@ -171,11 +171,11 @@ namespace AyaNova.Api.Controllers
if (!Authorized.HasReadFullRole(HttpContext.Items, biz.BizType))
return StatusCode(403, new ApiNotAuthorizedResponse());
//extra check if they have rights to the type of object in question, this nips it in the bud before they even get to the fetch data stage later
if (!Authorized.HasReadFullRole(HttpContext.Items, ayType))
if (!Authorized.HasReadFullRole(HttpContext.Items, aType))
return StatusCode(403, new ApiNotAuthorizedResponse());
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));
var o = await biz.GetReportListAsync(ayType);
var o = await biz.GetReportListAsync(aType);
if (o == null) return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
return Ok(ApiOkResponse.Response(o));
}

View File

@@ -140,7 +140,7 @@ namespace AyaNova.Api.Controllers
case AyaType.WorkOrderItemTask:
case AyaType.WorkOrderItemTravel:
AyaTypeId TypeId = await WorkOrderBiz.GetAncestor(ayaType, id, ct);
return Ok(ApiOkResponse.Response(new { AyaType = TypeId.ObjectTypeAsInt, Id = TypeId.ObjectId }));
return Ok(ApiOkResponse.Response(new { AyaType = TypeId.ATypeAsInt, Id = TypeId.ObjectId }));
default:
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_INVALID_VALUE, null, "Only types with ancestors are valid"));

View File

@@ -90,10 +90,10 @@ namespace AyaNova.Api.Controllers
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));
if (!selectedRequest.ObjectType.HasAttribute(typeof(CoreBizObjectAttribute)))
if (!selectedRequest.AType.HasAttribute(typeof(CoreBizObjectAttribute)))
return BadRequest(new ApiErrorResponse(ApiErrorCode.INVALID_OPERATION, null, "Not a taggable object type"));
if (!Authorized.HasModifyRole(HttpContext.Items, selectedRequest.ObjectType))
if (!Authorized.HasModifyRole(HttpContext.Items, selectedRequest.AType))
return StatusCode(403, new ApiNotAuthorizedResponse());
tag = TagBiz.NormalizeTag(tag);
@@ -110,7 +110,7 @@ namespace AyaNova.Api.Controllers
UserIdFromContext.Id(HttpContext.Items),
UserTranslationIdFromContext.Id(HttpContext.Items));
var JobName = $"LT:BatchJob LT:Add LT:Tag \"{tag}\" LT:{selectedRequest.ObjectType} ({selectedRequest.SelectedRowIds.LongLength}) LT:User {UserNameFromContext.Name(HttpContext.Items)}";
var JobName = $"LT:BatchJob LT:Add LT:Tag \"{tag}\" LT:{selectedRequest.AType} ({selectedRequest.SelectedRowIds.LongLength}) LT:User {UserNameFromContext.Name(HttpContext.Items)}";
JObject o = JObject.FromObject(new
{
idList = selectedRequest.SelectedRowIds,
@@ -119,7 +119,7 @@ namespace AyaNova.Api.Controllers
OpsJob j = new OpsJob();
j.Name = JobName;
j.ObjectType = selectedRequest.ObjectType;
j.AType = selectedRequest.AType;
j.JobType = JobType.BatchCoreObjectOperation;
j.SubType = JobSubType.TagAdd;
j.Exclusive = false;
@@ -159,7 +159,7 @@ namespace AyaNova.Api.Controllers
OpsJob j = new OpsJob();
j.Name = JobName;
j.ObjectType = ayaType;
j.AType = ayaType;
j.JobType = JobType.BatchCoreObjectOperation;
j.SubType = JobSubType.TagAddAny;
j.Exclusive = false;
@@ -183,9 +183,9 @@ namespace AyaNova.Api.Controllers
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));
if (!selectedRequest.ObjectType.HasAttribute(typeof(CoreBizObjectAttribute)))
if (!selectedRequest.AType.HasAttribute(typeof(CoreBizObjectAttribute)))
return BadRequest(new ApiErrorResponse(ApiErrorCode.INVALID_OPERATION, null, "Not a taggable object type"));
if (!Authorized.HasModifyRole(HttpContext.Items, selectedRequest.ObjectType))
if (!Authorized.HasModifyRole(HttpContext.Items, selectedRequest.AType))
return StatusCode(403, new ApiNotAuthorizedResponse());
tag = TagBiz.NormalizeTag(tag);
@@ -202,7 +202,7 @@ namespace AyaNova.Api.Controllers
UserIdFromContext.Id(HttpContext.Items),
UserTranslationIdFromContext.Id(HttpContext.Items));
var JobName = $"LT:BatchJob LT:Remove LT:Tag \"{tag}\" LT:{selectedRequest.ObjectType} ({selectedRequest.SelectedRowIds.LongLength}) LT:User {UserNameFromContext.Name(HttpContext.Items)}";
var JobName = $"LT:BatchJob LT:Remove LT:Tag \"{tag}\" LT:{selectedRequest.AType} ({selectedRequest.SelectedRowIds.LongLength}) LT:User {UserNameFromContext.Name(HttpContext.Items)}";
JObject o = JObject.FromObject(new
{
idList = selectedRequest.SelectedRowIds,
@@ -211,7 +211,7 @@ namespace AyaNova.Api.Controllers
OpsJob j = new OpsJob();
j.Name = JobName;
j.ObjectType = selectedRequest.ObjectType;
j.AType = selectedRequest.AType;
j.JobType = JobType.BatchCoreObjectOperation;
j.SubType = JobSubType.TagRemove;
j.Exclusive = false;
@@ -252,7 +252,7 @@ namespace AyaNova.Api.Controllers
OpsJob j = new OpsJob();
j.Name = JobName;
j.ObjectType = ayaType;
j.AType = ayaType;
j.SubType = JobSubType.TagRemoveAny;
j.JobType = JobType.BatchCoreObjectOperation;
j.Exclusive = false;
@@ -278,9 +278,9 @@ namespace AyaNova.Api.Controllers
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));
if (!selectedRequest.ObjectType.HasAttribute(typeof(CoreBizObjectAttribute)))
if (!selectedRequest.AType.HasAttribute(typeof(CoreBizObjectAttribute)))
return BadRequest(new ApiErrorResponse(ApiErrorCode.INVALID_OPERATION, null, "Not a taggable object type"));
if (!Authorized.HasModifyRole(HttpContext.Items, selectedRequest.ObjectType))
if (!Authorized.HasModifyRole(HttpContext.Items, selectedRequest.AType))
return StatusCode(403, new ApiNotAuthorizedResponse());
fromTag = TagBiz.NormalizeTag(fromTag);
if (string.IsNullOrWhiteSpace(fromTag))
@@ -299,7 +299,7 @@ namespace AyaNova.Api.Controllers
UserIdFromContext.Id(HttpContext.Items),
UserTranslationIdFromContext.Id(HttpContext.Items));
var JobName = $"LT:BatchJob LT:Replace LT:Tag \"{fromTag}\" -> LT:Tag \"{toTag}\" LT:{selectedRequest.ObjectType} ({selectedRequest.SelectedRowIds.LongLength}) LT:User {UserNameFromContext.Name(HttpContext.Items)}";
var JobName = $"LT:BatchJob LT:Replace LT:Tag \"{fromTag}\" -> LT:Tag \"{toTag}\" LT:{selectedRequest.AType} ({selectedRequest.SelectedRowIds.LongLength}) LT:User {UserNameFromContext.Name(HttpContext.Items)}";
JObject o = JObject.FromObject(new
{
idList = selectedRequest.SelectedRowIds,
@@ -308,7 +308,7 @@ namespace AyaNova.Api.Controllers
});
OpsJob j = new OpsJob();
j.ObjectType = selectedRequest.ObjectType;
j.AType = selectedRequest.AType;
j.Name = JobName;
j.JobType = JobType.BatchCoreObjectOperation;
j.SubType = JobSubType.TagReplace;
@@ -355,7 +355,7 @@ namespace AyaNova.Api.Controllers
OpsJob j = new OpsJob();
j.Name = JobName;
j.ObjectType = ayaType;
j.AType = ayaType;
j.JobType = JobType.BatchCoreObjectOperation;
j.SubType = JobSubType.TagReplaceAny;
j.Exclusive = false;

View File

@@ -336,7 +336,7 @@ namespace AyaNova.Api.Controllers
bool badRequest = false;
string UploadObjectType = string.Empty;
string UploadAType = string.Empty;
string UploadObjectId = string.Empty;
string errorMessage = string.Empty;
string Notes = string.Empty;
@@ -371,8 +371,8 @@ namespace AyaNova.Api.Controllers
}
if (!badRequest)
{
if (uploadFormData.FormFieldData.ContainsKey("ObjectType"))
UploadObjectType = uploadFormData.FormFieldData["ObjectType"].ToString();
if (uploadFormData.FormFieldData.ContainsKey("AType"))
UploadAType = uploadFormData.FormFieldData["AType"].ToString();
if (uploadFormData.FormFieldData.ContainsKey("ObjectId"))
UploadObjectId = uploadFormData.FormFieldData["ObjectId"].ToString();
if (uploadFormData.FormFieldData.ContainsKey("Notes"))

View File

@@ -6,9 +6,9 @@ namespace AyaNova.DataList
{
public AttachmentDataList()
{
DefaultListObjectType = AyaType.FileAttachment;
DefaultListAType = AyaType.FileAttachment;
SQLFrom = "from afileattachment";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "displayfilename", "object", "size", "notes", "exists" };
DefaultSortBy = new Dictionary<string, string>() { { "displayfilename", "+" }, { "size", "-" } };
@@ -20,7 +20,7 @@ namespace AyaNova.DataList
{
TKey = "FileAttachment",
FieldKey = "displayfilename",
AyaObjectType = (int)AyaType.FileAttachment,
AType = (int)AyaType.FileAttachment,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "afileattachment.id",
SqlValueColumnName = "afileattachment.displayfilename",
@@ -41,8 +41,8 @@ namespace AyaNova.DataList
FieldKey = "object",
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "afileattachment.AttachToObjectid",
SqlValueColumnName = "AYGETNAME(afileattachment.AttachToObjectid, afileattachment.attachtoobjecttype)",
SqlAyTypeColumnName = "afileattachment.attachtoobjecttype"
SqlValueColumnName = "AYGETNAME(afileattachment.AttachToObjectid, afileattachment.attachtoatype)",
SqlATypeColumnName = "afileattachment.attachtoatype"
});
FieldDefinitions.Add(new DataListFieldDefinition

View File

@@ -6,9 +6,9 @@ namespace AyaNova.DataList
{
public ContractDataList()
{
DefaultListObjectType = AyaType.Contract;
DefaultListAType = AyaType.Contract;
SQLFrom = "from acontract";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "contractname", "contractactive" };
DefaultSortBy = new Dictionary<string, string>() { { "contractname", "+" } };
@@ -18,7 +18,7 @@ namespace AyaNova.DataList
{
TKey = "ContractName",
FieldKey = "contractname",
AyaObjectType = (int)AyaType.Contract,
AType = (int)AyaType.Contract,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "acontract.id",
SqlValueColumnName = "acontract.name",

View File

@@ -6,9 +6,9 @@ namespace AyaNova.DataList
{
public CustomerDataList()
{
DefaultListObjectType = AyaType.Customer;
DefaultListAType = AyaType.Customer;
SQLFrom = "from acustomer left join aheadoffice on (acustomer.headofficeid=aheadoffice.id) left join acontract on (acustomer.contractid=acontract.id)";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "customername", "customerphone1", "customeremail", "customerheadoffice" };
DefaultSortBy = new Dictionary<string, string>() { { "customername", "+" } };
@@ -19,7 +19,7 @@ namespace AyaNova.DataList
{
TKey = "CustomerName",
FieldKey = "customername",
AyaObjectType = (int)AyaType.Customer,
AType = (int)AyaType.Customer,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "acustomer.id",
SqlValueColumnName = "acustomer.name",
@@ -71,7 +71,7 @@ namespace AyaNova.DataList
TKey = "HeadOffice",
FieldKey = "customerheadoffice",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.HeadOffice,
AType = (int)AyaType.HeadOffice,
SqlIdColumnName = "aheadoffice.id",
SqlValueColumnName = "aheadoffice.name"
});
@@ -113,7 +113,7 @@ namespace AyaNova.DataList
TKey = "Contract",
FieldKey = "customercontract",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.Contract,
AType = (int)AyaType.Contract,
SqlIdColumnName = "acontract.id",
SqlValueColumnName = "acontract.name"
});

View File

@@ -8,9 +8,9 @@ namespace AyaNova.DataList
{
public CustomerNoteDataList()
{
DefaultListObjectType = AyaType.CustomerNote;
DefaultListAType = AyaType.CustomerNote;
SQLFrom = "from acustomernote left join auser on (acustomernote.userid=auser.id)";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "notedate", "notes", "username" };
DefaultSortBy = new Dictionary<string, string>() { { "notedate", "-" } };
@@ -21,7 +21,7 @@ namespace AyaNova.DataList
{
TKey = "User",
FieldKey = "username",
AyaObjectType = (int)AyaType.User,
AType = (int)AyaType.User,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "auser.id",
SqlValueColumnName = "auser.name",
@@ -33,7 +33,7 @@ namespace AyaNova.DataList
{
TKey = "CustomerNoteNotes",
FieldKey = "notes",
AyaObjectType = (int)AyaType.CustomerNote,
AType = (int)AyaType.CustomerNote,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "acustomernote.id",
SqlValueColumnName = "acustomernote.notes",

View File

@@ -6,14 +6,14 @@ namespace AyaNova.DataList
{
public CustomerServiceRequestDataList()
{
DefaultListObjectType = AyaType.CustomerServiceRequest;
DefaultListAType = AyaType.CustomerServiceRequest;
SQLFrom = "from acustomerservicerequest " +
"left join acustomer on (acustomerservicerequest.customerid=acustomer.id) " +
"left join auser on (acustomerservicerequest.requestedbyuserid=auser.id) " +
"left join aunit on (acustomerservicerequest.unitid = aunit.id) " +
"left join aworkorderitem as wi on (acustomerservicerequest.workorderitemid=wi.id) " +
"left join aworkorder as w on (wi.workorderid=w.id)";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "Created", "Customer", "CustomerServiceRequestTitle", "CustomerServiceRequestPriority", "CustomerServiceRequestStatus" };
DefaultSortBy = new Dictionary<string, string>() { { "Created", "-" } };
@@ -24,7 +24,7 @@ namespace AyaNova.DataList
{
TKey = "CustomerServiceRequestTitle",
FieldKey = "CustomerServiceRequestTitle",
AyaObjectType = (int)AyaType.CustomerServiceRequest,
AType = (int)AyaType.CustomerServiceRequest,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "acustomerservicerequest.id",
SqlValueColumnName = "acustomerservicerequest.name",
@@ -60,7 +60,7 @@ namespace AyaNova.DataList
FieldKey = "Customer",
TKey = "Customer",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.Customer,
AType = (int)AyaType.Customer,
SqlIdColumnName = "acustomer.id",
SqlValueColumnName = "acustomer.name"
});
@@ -70,7 +70,7 @@ namespace AyaNova.DataList
FieldKey = "CustomerServiceRequestItemUnitID",
TKey = "CustomerServiceRequestItemUnitID",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.Unit,
AType = (int)AyaType.Unit,
SqlIdColumnName = "aunit.id",
SqlValueColumnName = "aunit.serial"
});
@@ -80,7 +80,7 @@ namespace AyaNova.DataList
FieldKey = "WorkOrder",
TKey = "WorkOrder",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.WorkOrderItem,
AType = (int)AyaType.WorkOrderItem,
SqlIdColumnName = "wi.id",
SqlValueColumnName = "w.serial"
});
@@ -90,7 +90,7 @@ namespace AyaNova.DataList
FieldKey = "CustomerServiceRequestRequestedBy",
TKey = "CustomerServiceRequestRequestedBy",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.User,
AType = (int)AyaType.User,
SqlIdColumnName = "auser.id",
SqlValueColumnName = "auser.name"
});

View File

@@ -120,9 +120,9 @@ namespace AyaNova.DataList
AyaField.i = dr.GetInt64(ordinal);
}
if (f.SqlAyTypeColumnName != null)
if (f.SqlATypeColumnName != null)
{
var ordinal = qSelect.map[f.SqlAyTypeColumnName];
var ordinal = qSelect.map[f.SqlATypeColumnName];
if (!await dr.IsDBNullAsync(ordinal))
AyaField.ot = dr.GetInt32(ordinal);
}

View File

@@ -36,7 +36,7 @@ namespace AyaNova.DataList
public bool IsRowId { get; set; }
//CLIENT / SERVER - client display and to indicate what object to open , Server for formatting return object
public int AyaObjectType { get; set; }
public int AType { get; set; }
//SERVER - for building sql queries
//don't return these properties when api user fetches field list definitions in DataListController
@@ -45,7 +45,7 @@ namespace AyaNova.DataList
[JsonIgnore]
public string SqlValueColumnName { get; set; }
[JsonIgnore]
public string SqlAyTypeColumnName { get; set; }//column to fetch the AyaType openabel for this field to set it dynamically instead of preset
public string SqlATypeColumnName { get; set; }//column to fetch the AyaType openabel for this field to set it dynamically instead of preset
[JsonIgnore]
public string SqlColorColumnName { get; set; }//column to fetch the color if applicable to this field
@@ -58,8 +58,8 @@ namespace AyaNova.DataList
IsRowId = false;
IsMeta = false;
//Set openable object type to no type which is the default and means it's not a link to another object
AyaObjectType = (int)AyaType.NoType;
SqlAyTypeColumnName = null;//must be null as that is checked against specifically
AType = (int)AyaType.NoType;
SqlATypeColumnName = null;//must be null as that is checked against specifically
SqlColorColumnName = null;//must be null to be ignored properly
}

View File

@@ -29,7 +29,7 @@ namespace AyaNova.DataList
public string SQLFrom { get; set; }
public List<DataListFieldDefinition> FieldDefinitions { get; set; }
public AuthorizationRoles AllowedRoles { get; set; }
public AyaType DefaultListObjectType { get; set; }
public AyaType DefaultListAType { get; set; }
public long CurrentUserId { get; set; }
public List<string> DefaultColumns { get; set; }
public Dictionary<string, string> DefaultSortBy { get; set; }
@@ -112,9 +112,9 @@ namespace AyaNova.DataList
}
}
//Has a AyObjectType? (linkable / openable)
if (o.AyaObjectType != 0)
sb.Append($",\"ay\":{(int)o.AyaObjectType}");
//Has a AyAType? (linkable / openable)
if (o.AType != 0)
sb.Append($",\"ay\":{(int)o.AType}");
//Row ID column?
if (o.IsRowId)

View File

@@ -78,7 +78,7 @@ namespace AyaNova.DataList
}
//does it also have an openable AyaType column?
var ayaTypeColumnName = o.SqlAyTypeColumnName;
var ayaTypeColumnName = o.SqlATypeColumnName;
if (!string.IsNullOrWhiteSpace(ayaTypeColumnName))
{
if (!map.ContainsKey(ayaTypeColumnName))

View File

@@ -7,9 +7,9 @@ namespace AyaNova.DataList
public EventDataList()
{
//NOTE: used this type because it's full BizFull and read only BizLimited only which is appropriate and there is no event type
DefaultListObjectType = AyaType.Global;
DefaultListAType = AyaType.Global;
SQLFrom = "from aevent left join auser on (aevent.userid=auser.id)";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "eventcreated", "event", "object", "AyaType", "username", "textra" };
DefaultSortBy = new Dictionary<string, string>() { { "eventcreated", "-" } };
@@ -49,7 +49,7 @@ namespace AyaNova.DataList
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "aevent.ayid",
SqlValueColumnName = "AYGETNAME(aevent.ayid, aevent.ayatype)",
SqlAyTypeColumnName = "aevent.ayatype"
SqlATypeColumnName = "aevent.ayatype"
});
FieldDefinitions.Add(new DataListFieldDefinition
@@ -57,7 +57,7 @@ namespace AyaNova.DataList
FieldKey = "username",
TKey = "User",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.User,
AType = (int)AyaType.User,
SqlIdColumnName = "auser.id",
SqlValueColumnName = "auser.name"
});

View File

@@ -6,9 +6,9 @@ namespace AyaNova.DataList
{
public HeadOfficeDataList()
{
DefaultListObjectType = AyaType.HeadOffice;
DefaultListAType = AyaType.HeadOffice;
SQLFrom = "from aheadoffice left join acontract on (aheadoffice.contractid=acontract.id)";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "headofficename", "headofficephone1", "headofficeemail" };
DefaultSortBy = new Dictionary<string, string>() { { "headofficename", "+" } };
@@ -19,7 +19,7 @@ namespace AyaNova.DataList
{
TKey = "HeadOfficeName",
FieldKey = "headofficename",
AyaObjectType = (int)AyaType.HeadOffice,
AType = (int)AyaType.HeadOffice,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "aheadoffice.id",
SqlValueColumnName = "aheadoffice.name",
@@ -80,7 +80,7 @@ namespace AyaNova.DataList
TKey = "Contract",
FieldKey = "headofficecontract",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.Contract,
AType = (int)AyaType.Contract,
SqlIdColumnName = "acontract.id",
SqlValueColumnName = "acontract.name"
});

View File

@@ -11,7 +11,7 @@ namespace AyaNova.DataList
//allowed roles to access this list
AuthorizationRoles AllowedRoles { get; set; }
//Default object type to open for rows of this list (use no object if no)
AyaType DefaultListObjectType { get; set; }
AyaType DefaultListAType { get; set; }
//Defaults when none is specified (see DataListOptions for formats and notes)
List<string> DefaultColumns { get; set; }
Dictionary<string, string> DefaultSortBy { get; set; }

View File

@@ -9,9 +9,9 @@ namespace AyaNova.DataList
public InsideUserDataList()
{
DefaultListObjectType = AyaType.User;
DefaultListAType = AyaType.User;
SQLFrom = "from auser left join avendor on (auser.vendorid=avendor.id)";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "name", "employeenumber", "active", "usertype", "lastlogin" };
DefaultSortBy = new Dictionary<string, string>() { { "name", "+" } };
@@ -21,7 +21,7 @@ namespace AyaNova.DataList
{
TKey = "User",
FieldKey = "name",
AyaObjectType = (int)AyaType.User,
AType = (int)AyaType.User,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "auser.id",
SqlValueColumnName = "auser.name",
@@ -77,7 +77,7 @@ namespace AyaNova.DataList
TKey = "Vendor",
FieldKey = "uservendor",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.Vendor,
AType = (int)AyaType.Vendor,
SqlIdColumnName = "avendor.id",
SqlValueColumnName = "avendor.name"
});

View File

@@ -6,7 +6,7 @@ namespace AyaNova.DataList
{
public LoanUnitDataList()
{
DefaultListObjectType = AyaType.LoanUnit;
DefaultListAType = AyaType.LoanUnit;
SQLFrom = "from aloanunit " +
"left join aunit as shadowunit on (aloanunit.unitid=shadowunit.id) " +
"left join aworkorderitemloan as wil on (aloanunit.workorderitemloanid=wil.id) " +
@@ -14,7 +14,7 @@ namespace AyaNova.DataList
"left join aworkorder as w on (wi.workorderid=w.id)";
//MIGRATE_OUTSTANDING awaiting workorderitemloan coding
//todo: look at loanitemlist in v7 it surfaces due date, out date etc in the list and should here too once those fields are coded for
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "LoanUnitName", "LoanUnitSerial", "Tags" };
DefaultSortBy = new Dictionary<string, string>() { { "LoanUnitName", "+" } };
@@ -24,7 +24,7 @@ namespace AyaNova.DataList
{
TKey = "LoanUnitName",
FieldKey = "LoanUnitName",
AyaObjectType = (int)AyaType.LoanUnit,
AType = (int)AyaType.LoanUnit,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "aloanunit.id",
SqlValueColumnName = "aloanunit.name",
@@ -68,7 +68,7 @@ namespace AyaNova.DataList
FieldKey = "LoanUnitCurrentWorkOrderItemLoan",
TKey = "LoanUnitCurrentWorkOrderItemLoan",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.WorkOrderItemLoan,
AType = (int)AyaType.WorkOrderItemLoan,
SqlIdColumnName = "wil.id",
SqlValueColumnName = "w.serial"
});
@@ -135,7 +135,7 @@ namespace AyaNova.DataList
FieldKey = "LoanUnitShadowUnit",
TKey = "LoanUnitShadowUnit",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.Unit,
AType = (int)AyaType.Unit,
SqlIdColumnName = "shadowunit.id",
SqlValueColumnName = "shadowunit.serial"
});

View File

@@ -8,9 +8,9 @@ namespace AyaNova.DataList
public MemoDataList()
{
DefaultListObjectType = AyaType.Memo;
DefaultListAType = AyaType.Memo;
SQLFrom = "from amemo left join auser on (amemo.fromid=auser.id)";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "MemoSubject", "MemoFromID", "MemoSent", "MemoViewed" };
DefaultSortBy = new Dictionary<string, string>() { { "MemoSent", "-" } };
@@ -20,7 +20,7 @@ namespace AyaNova.DataList
{
TKey = "MemoSubject",
FieldKey = "MemoSubject",
AyaObjectType = (int)AyaType.Memo,
AType = (int)AyaType.Memo,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "amemo.id",
SqlValueColumnName = "amemo.name",
@@ -39,7 +39,7 @@ namespace AyaNova.DataList
{
TKey = "MemoFromID",
FieldKey = "MemoFromID",
AyaObjectType = (int)AyaType.User,
AType = (int)AyaType.User,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "auser.id",
SqlValueColumnName = "auser.name",

View File

@@ -8,9 +8,9 @@ namespace AyaNova.DataList
public OutsideUserDataList()
{
DefaultListObjectType = AyaType.Customer;
DefaultListAType = AyaType.Customer;
SQLFrom = "from auser left join aheadoffice on (auser.headofficeid=aheadoffice.id) left join acustomer on (auser.customerid=acustomer.id)";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "name", "active", "usercustomer", "userheadoffice", "lastlogin" };
DefaultSortBy = new Dictionary<string, string>() { { "name", "+" } };
@@ -20,7 +20,7 @@ namespace AyaNova.DataList
{
TKey = "User",
FieldKey = "name",
AyaObjectType = (int)AyaType.User,
AType = (int)AyaType.User,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "auser.id",
SqlValueColumnName = "auser.name",
@@ -75,7 +75,7 @@ namespace AyaNova.DataList
TKey = "HeadOffice",
FieldKey = "userheadoffice",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.HeadOffice,
AType = (int)AyaType.HeadOffice,
SqlIdColumnName = "aheadoffice.id",
SqlValueColumnName = "aheadoffice.name"
});
@@ -85,7 +85,7 @@ namespace AyaNova.DataList
TKey = "Customer",
FieldKey = "usercustomer",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.Customer,
AType = (int)AyaType.Customer,
SqlIdColumnName = "acustomer.id",
SqlValueColumnName = "acustomer.name"
});

View File

@@ -6,9 +6,9 @@ namespace AyaNova.DataList
{
public PartAssemblyDataList()
{
DefaultListObjectType = AyaType.PartAssembly;
DefaultListAType = AyaType.PartAssembly;
SQLFrom = "from apartassembly";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "partassemblyname" };
DefaultSortBy = new Dictionary<string, string>() { { "partassemblyname", "+" } };
@@ -18,7 +18,7 @@ namespace AyaNova.DataList
{
TKey = "PartAssemblyName",
FieldKey = "partassemblyname",
AyaObjectType = (int)AyaType.PartAssembly,
AType = (int)AyaType.PartAssembly,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "apartassembly.id",
SqlValueColumnName = "apartassembly.name",

View File

@@ -6,12 +6,12 @@ namespace AyaNova.DataList
{
public PartDataList()
{
DefaultListObjectType = AyaType.Part;
DefaultListAType = AyaType.Part;
SQLFrom = "from apart "
+ "left join avendor as aman on (apart.manufacturerid=aman.id) "
+ "left join avendor as awhole on (apart.wholesalerid=awhole.id) "
+ "left join avendor as aaltwhole on (apart.alternativewholesalerid=aaltwhole.id)";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "PartPartNumber", "PartName", "PartManufacturerID", "PartWholesalerID", "Tags" };
DefaultSortBy = new Dictionary<string, string>() { { "PartPartNumber", "+" } };
@@ -21,7 +21,7 @@ namespace AyaNova.DataList
{
TKey = "PartPartNumber",
FieldKey = "PartPartNumber",
AyaObjectType = (int)AyaType.Part,
AType = (int)AyaType.Part,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "apart.id",
SqlValueColumnName = "apart.partnumber",
@@ -81,7 +81,7 @@ namespace AyaNova.DataList
FieldKey = "PartManufacturerID",
TKey = "PartManufacturerID",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.Vendor,
AType = (int)AyaType.Vendor,
SqlIdColumnName = "aman.id",
SqlValueColumnName = "aman.name"
});
@@ -91,7 +91,7 @@ namespace AyaNova.DataList
FieldKey = "PartWholesalerID",
TKey = "PartWholesalerID",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.Vendor,
AType = (int)AyaType.Vendor,
SqlIdColumnName = "awhole.id",
SqlValueColumnName = "awhole.name"
});
@@ -101,7 +101,7 @@ namespace AyaNova.DataList
FieldKey = "PartAlternativeWholesalerID",
TKey = "PartAlternativeWholesalerID",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.Vendor,
AType = (int)AyaType.Vendor,
SqlIdColumnName = "aaltwhole.id",
SqlValueColumnName = "aaltwhole.name"
});

View File

@@ -9,13 +9,13 @@ namespace AyaNova.DataList
{
public PartInventoryDataList()
{
DefaultListObjectType = AyaType.PartInventory;
DefaultListAType = AyaType.PartInventory;
SQLFrom = "from vpartinventorylist "
+ "LEFT JOIN apart ON (vpartinventorylist.partid = apart.id) "
+ "LEFT JOIN apartwarehouse ON (vpartinventorylist.partwarehouseid = apartwarehouse.id) ";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "PartPartNumber", "PartWarehouseName", "PartInventoryBalance", "PartByWarehouseInventoryQuantityOnOrder", "PartByWarehouseInventoryQtyOnOrderCommitted" };
DefaultSortBy = new Dictionary<string, string>() { { "PartPartNumber", "+" }, { "PartWarehouseName", "+" } };
@@ -25,7 +25,7 @@ namespace AyaNova.DataList
{
TKey = "PartPartNumber",
FieldKey = "PartPartNumber",
AyaObjectType = (int)AyaType.Part,
AType = (int)AyaType.Part,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "apart.id",
SqlValueColumnName = "apart.partnumber"
@@ -35,7 +35,7 @@ namespace AyaNova.DataList
{
TKey = "PartName",
FieldKey = "PartName",
AyaObjectType = (int)AyaType.Part,
AType = (int)AyaType.Part,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "apart.id",
SqlValueColumnName = "apart.name"
@@ -45,7 +45,7 @@ namespace AyaNova.DataList
{
TKey = "PartWarehouseName",
FieldKey = "PartWarehouseName",
AyaObjectType = (int)AyaType.PartWarehouse,
AType = (int)AyaType.PartWarehouse,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "apartwarehouse.id",
SqlValueColumnName = "apartwarehouse.name"
@@ -55,7 +55,7 @@ namespace AyaNova.DataList
{
TKey = "PartInventoryTransactionDescription",
FieldKey = "PartInventoryTransactionDescription",
AyaObjectType = (int)AyaType.PartInventory,
AType = (int)AyaType.PartInventory,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "vpartinventorylist.id",
SqlValueColumnName = "vpartinventorylist.description",

View File

@@ -9,11 +9,11 @@ namespace AyaNova.DataList
{
public PartInventoryTransactionsDataList()
{
DefaultListObjectType = AyaType.PartInventory;
DefaultListAType = AyaType.PartInventory;
SQLFrom = "from apartinventory "
+ "left join apart on (apartinventory.partid=apart.id) "
+ "left join apartwarehouse on (apartinventory.partwarehouseid=apartwarehouse.id) ";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() {
"PartInventoryTransactionEntryDate", "PartPartNumber", "PartWarehouseName", "PartInventoryTransactionQuantity",
@@ -29,14 +29,14 @@ namespace AyaNova.DataList
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "apartinventory.sourceid",
SqlValueColumnName = "AYGETNAME(apartinventory.sourceid, apartinventory.sourcetype)",
SqlAyTypeColumnName = "apartinventory.sourcetype"
SqlATypeColumnName = "apartinventory.sourcetype"
});
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "PartPartNumber",
FieldKey = "PartPartNumber",
AyaObjectType = (int)AyaType.Part,
AType = (int)AyaType.Part,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "apart.id",
SqlValueColumnName = "apart.partnumber"
@@ -46,7 +46,7 @@ namespace AyaNova.DataList
{
TKey = "PartWarehouseName",
FieldKey = "PartWarehouseName",
AyaObjectType = (int)AyaType.PartWarehouse,
AType = (int)AyaType.PartWarehouse,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "apartwarehouse.id",
SqlValueColumnName = "apartwarehouse.name"
@@ -56,7 +56,7 @@ namespace AyaNova.DataList
{
TKey = "PartInventoryTransactionDescription",
FieldKey = "PartInventoryTransactionDescription",
AyaObjectType = (int)AyaType.PartInventory,
AType = (int)AyaType.PartInventory,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "apartinventory.id",
SqlValueColumnName = "apartinventory.description",

View File

@@ -14,9 +14,9 @@ namespace AyaNova.DataList
// + "apartstocklevel.minimumquantity, vpartinventorynow.balance, COALESCE(vpartsonorder.quantityonorder,0) AS onorderquantity, "
// + "apartstocklevel.minimumquantity - (COALESCE(vpartinventorynow.balance, 0) + COALESCE(vpartsonorder.quantityonorder, 0)) AS requiredquantity "
DefaultListObjectType = AyaType.PartInventoryRestock;
DefaultListAType = AyaType.PartInventoryRestock;
SQLFrom = "FROM vrestockrequired";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() {
"PartPartNumber", "PartWarehouseName", "PartWholesalerID","PartAlternativeWholesalerID","PartManufacturerID", "PartByWarehouseInventoryMinStockLevel",
@@ -30,7 +30,7 @@ namespace AyaNova.DataList
{
TKey = "PartPartNumber",
FieldKey = "PartPartNumber",
AyaObjectType = (int)AyaType.Part,
AType = (int)AyaType.Part,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "partid",
SqlValueColumnName = "partnumber"
@@ -40,7 +40,7 @@ namespace AyaNova.DataList
{
TKey = "PartWarehouseName",
FieldKey = "PartWarehouseName",
AyaObjectType = (int)AyaType.PartWarehouse,
AType = (int)AyaType.PartWarehouse,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "partwarehouseid",
SqlValueColumnName = "displaywarehouse"
@@ -51,7 +51,7 @@ namespace AyaNova.DataList
FieldKey = "PartManufacturerID",
TKey = "PartManufacturerID",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.Vendor,
AType = (int)AyaType.Vendor,
SqlIdColumnName = "manufactureid",
SqlValueColumnName = "displaymanufacturer"
});
@@ -61,7 +61,7 @@ namespace AyaNova.DataList
FieldKey = "PartWholesalerID",
TKey = "PartWholesalerID",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.Vendor,
AType = (int)AyaType.Vendor,
SqlIdColumnName = "wholesalerid",
SqlValueColumnName = "displaywholesaler"
});
@@ -71,7 +71,7 @@ namespace AyaNova.DataList
FieldKey = "PartAlternativeWholesalerID",
TKey = "PartAlternativeWholesalerID",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.Vendor,
AType = (int)AyaType.Vendor,
SqlIdColumnName = "alternativewholesalerid",
SqlValueColumnName = "displayalternativewholesaler"
});

View File

@@ -6,9 +6,9 @@ namespace AyaNova.DataList
{
public PartWarehouseDataList()
{
DefaultListObjectType = AyaType.PartWarehouse;
DefaultListAType = AyaType.PartWarehouse;
SQLFrom = "from apartwarehouse";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "PartWarehouseName", "Active", "Tags" };
DefaultSortBy = new Dictionary<string, string>() { { "PartWarehouseName", "+" } };
@@ -18,7 +18,7 @@ namespace AyaNova.DataList
{
TKey = "PartWarehouseName",
FieldKey = "PartWarehouseName",
AyaObjectType = (int)AyaType.PartWarehouse,
AType = (int)AyaType.PartWarehouse,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "apartwarehouse.id",
SqlValueColumnName = "apartwarehouse.name",

View File

@@ -6,9 +6,9 @@ namespace AyaNova.DataList
{
public ProjectDataList()
{
DefaultListObjectType = AyaType.Project;
DefaultListAType = AyaType.Project;
SQLFrom = "from aproject left join auser on (aproject.projectoverseerid=auser.id)";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "projectname", "ProjectProjectOverseerID", "ProjectDateStarted", "ProjectDateCompleted",
"ProjectAccountNumber", "projectactive", "projecttags" };
@@ -19,7 +19,7 @@ namespace AyaNova.DataList
{
TKey = "ProjectName",
FieldKey = "projectname",
AyaObjectType = (int)AyaType.Project,
AType = (int)AyaType.Project,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "aproject.id",
SqlValueColumnName = "aproject.name",
@@ -63,7 +63,7 @@ namespace AyaNova.DataList
FieldKey = "ProjectProjectOverseerID",
TKey = "ProjectProjectOverseerID",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.User,
AType = (int)AyaType.User,
SqlIdColumnName = "auser.id",
SqlValueColumnName = "auser.name"
});

View File

@@ -6,13 +6,13 @@ namespace AyaNova.DataList
{
public PurchaseOrderDataList()
{
DefaultListObjectType = AyaType.PurchaseOrder;
DefaultListAType = AyaType.PurchaseOrder;
SQLFrom = "from apurchaseorder " +
"left join avendor on (apurchaseorder.vendorid=avendor.id)" +
"left join acustomer on (apurchaseorder.dropshiptocustomerid=acustomer.id)" +
"left join aproject on (apurchaseorder.projectid=aproject.id)";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "PurchaseOrderPONumber", "Vendor", "PurchaseOrderOrderedDate", "PurchaseOrderStatus",
"PurchaseOrderExpectedReceiveDate" };
@@ -23,7 +23,7 @@ namespace AyaNova.DataList
{
TKey = "PurchaseOrderPONumber",
FieldKey = "PurchaseOrderPONumber",
AyaObjectType = (int)AyaType.PurchaseOrder,
AType = (int)AyaType.PurchaseOrder,
UiFieldDataType = (int)UiFieldDataType.Integer,
SqlIdColumnName = "apurchaseorder.id",
SqlValueColumnName = "apurchaseorder.serial",
@@ -59,7 +59,7 @@ namespace AyaNova.DataList
FieldKey = "PurchaseOrderDropShipToCustomerID",
TKey = "PurchaseOrderDropShipToCustomerID",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.User,
AType = (int)AyaType.User,
SqlIdColumnName = "acustomer.id",
SqlValueColumnName = "acustomer.name"
});
@@ -77,7 +77,7 @@ namespace AyaNova.DataList
FieldKey = "Vendor",
TKey = "Vendor",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.User,
AType = (int)AyaType.User,
SqlIdColumnName = "avendor.id",
SqlValueColumnName = "avendor.name"
});
@@ -112,7 +112,7 @@ namespace AyaNova.DataList
FieldKey = "Project",
TKey = "Project",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.User,
AType = (int)AyaType.User,
SqlIdColumnName = "aproject.id",
SqlValueColumnName = "aproject.name"
});

View File

@@ -7,9 +7,9 @@ namespace AyaNova.DataList
{
public ReminderDataList()
{
DefaultListObjectType = AyaType.Reminder;
DefaultListAType = AyaType.Reminder;
SQLFrom = "from areminder";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "ReminderName", "ReminderNotes", "ReminderStopDate", "ReminderStartDate" };
DefaultSortBy = new Dictionary<string, string>() { { "ReminderStopDate", "-" } };
@@ -19,7 +19,7 @@ namespace AyaNova.DataList
{
TKey = "ReminderName",
FieldKey = "ReminderName",
AyaObjectType = (int)AyaType.Reminder,
AType = (int)AyaType.Reminder,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "areminder.id",
SqlValueColumnName = "areminder.name",

View File

@@ -6,11 +6,11 @@ namespace AyaNova.DataList
{
public ReportDataList()
{
DefaultListObjectType = AyaType.Report;
DefaultListAType = AyaType.Report;
SQLFrom = "from aReport";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "name", "objecttype", "active" };
DefaultColumns = new List<string>() { "name", "aType", "active" };
DefaultSortBy = new Dictionary<string, string>() { { "name", "+" } };
FieldDefinitions = new List<DataListFieldDefinition>();
@@ -18,7 +18,7 @@ namespace AyaNova.DataList
{
TKey = "Report",
FieldKey = "name",
AyaObjectType = (int)AyaType.Report,
AType = (int)AyaType.Report,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "aReport.id",
SqlValueColumnName = "aReport.name",
@@ -28,10 +28,10 @@ namespace AyaNova.DataList
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "AyaType",
FieldKey = "objecttype",
FieldKey = "aType",
UiFieldDataType = (int)UiFieldDataType.Enum,
EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(AyaType).ToString()),
SqlValueColumnName = "areport.ObjectType"
SqlValueColumnName = "areport.AType"
});
FieldDefinitions.Add(new DataListFieldDefinition

View File

@@ -9,11 +9,11 @@ namespace AyaNova.DataList
public ReviewDataList()
{
DefaultListObjectType = AyaType.Review;
DefaultListAType = AyaType.Review;
SQLFrom = "from areview "
+ "left join auser uassto on (areview.userid=uassto.id) "
+ "left join auser uassby on (areview.assignedbyuserid=uassby.id)";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "ReviewCompletedDate", "ReviewDueDate", "ReviewName", "Object", "AyaType", "ReviewNotes", "ReviewUserId" };
DefaultSortBy = new Dictionary<string, string>() { { "ReviewCompletedDate", "-" }, { "ReviewDueDate", "+" } };
@@ -25,8 +25,8 @@ namespace AyaNova.DataList
FieldKey = "Object",
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "areview.objectid",
SqlValueColumnName = "AYGETNAME(areview.objectid, areview.objecttype)",
SqlAyTypeColumnName = "areview.objecttype"
SqlValueColumnName = "AYGETNAME(areview.objectid, areview.aType)",
SqlATypeColumnName = "areview.aType"
});
FieldDefinitions.Add(new DataListFieldDefinition
@@ -35,14 +35,14 @@ namespace AyaNova.DataList
FieldKey = "AyaType",
UiFieldDataType = (int)UiFieldDataType.Enum,
EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(AyaType).ToString()),
SqlValueColumnName = "areview.objecttype"
SqlValueColumnName = "areview.aType"
});
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "ReviewName",
FieldKey = "ReviewName",
AyaObjectType = (int)AyaType.Review,
AType = (int)AyaType.Review,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "areview.id",
SqlValueColumnName = "areview.name",
@@ -85,7 +85,7 @@ namespace AyaNova.DataList
{
TKey = "ReviewUserId",
FieldKey = "ReviewUserId",
AyaObjectType = (int)AyaType.User,
AType = (int)AyaType.User,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "uassto.id",
SqlValueColumnName = "uassto.name"
@@ -95,7 +95,7 @@ namespace AyaNova.DataList
{
TKey = "ReviewAssignedByUserId",
FieldKey = "ReviewAssignedByUserId",
AyaObjectType = (int)AyaType.User,
AType = (int)AyaType.User,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "uassby.id",
SqlValueColumnName = "uassby.name"
@@ -155,7 +155,7 @@ namespace AyaNova.DataList
FieldKey = "metaobjecttype",
UiFieldDataType = (int)UiFieldDataType.Enum,
EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(AyaType).ToString()),
SqlValueColumnName = "areview.objecttype",
SqlValueColumnName = "areview.aType",
IsMeta = true
});
}

View File

@@ -9,9 +9,9 @@ namespace AyaNova.DataList
public ServiceBankDataList()
{
DefaultListObjectType = AyaType.ServiceBank;
DefaultListAType = AyaType.ServiceBank;
SQLFrom = "from aservicebank";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() {
"ServiceBankCreated", "Object", "ServiceBankCurrency", "ServiceBankCurrencyBalance", "ServiceBankIncidents",
@@ -22,12 +22,12 @@ namespace AyaNova.DataList
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "ServiceBankSourceRootObjectType",
FieldKey = "ServiceBankSourceRootObjectType",
TKey = "ServiceBankSourceRootAType",
FieldKey = "ServiceBankSourceRootAType",
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "aservicebank.sourceid",
SqlValueColumnName = "AYGETNAME(aservicebank.sourceid, aservicebank.sourcetype)",
SqlAyTypeColumnName = "aservicebank.sourcetype"
SqlATypeColumnName = "aservicebank.sourcetype"
});
FieldDefinitions.Add(new DataListFieldDefinition
@@ -36,8 +36,8 @@ namespace AyaNova.DataList
FieldKey = "Object",
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "aservicebank.objectid",
SqlValueColumnName = "AYGETNAME(aservicebank.objectid, aservicebank.objecttype)",
SqlAyTypeColumnName = "aservicebank.objecttype"
SqlValueColumnName = "AYGETNAME(aservicebank.objectid, aservicebank.aType)",
SqlATypeColumnName = "aservicebank.aType"
});
FieldDefinitions.Add(new DataListFieldDefinition
@@ -46,14 +46,14 @@ namespace AyaNova.DataList
FieldKey = "AyaType",
UiFieldDataType = (int)UiFieldDataType.Enum,
EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(AyaType).ToString()),
SqlValueColumnName = "aservicebank.objecttype"
SqlValueColumnName = "aservicebank.aType"
});
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "ServiceBankDescription",
FieldKey = "ServiceBankDescription",
AyaObjectType = (int)AyaType.ServiceBank,
AType = (int)AyaType.ServiceBank,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "aservicebank.id",
SqlValueColumnName = "aservicebank.name",
@@ -132,7 +132,7 @@ namespace AyaNova.DataList
FieldKey = "metaobjecttype",
UiFieldDataType = (int)UiFieldDataType.Enum,
EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(AyaType).ToString()),
SqlValueColumnName = "aservicebank.objecttype",
SqlValueColumnName = "aservicebank.aType",
IsMeta = true
});
}

View File

@@ -6,9 +6,9 @@ namespace AyaNova.DataList
{
public ServiceRateDataList()
{
DefaultListObjectType = AyaType.ServiceRate;
DefaultListAType = AyaType.ServiceRate;
SQLFrom = "from aservicerate";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "Name", "Cost", "RateCharge", "RateUnitChargeDescriptionID", "Active" };
DefaultSortBy = new Dictionary<string, string>() { { "Name", "+" } };
@@ -18,7 +18,7 @@ namespace AyaNova.DataList
{
TKey = "Name",
FieldKey = "Name",
AyaObjectType = (int)AyaType.ServiceRate,
AType = (int)AyaType.ServiceRate,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "aservicerate.id",
SqlValueColumnName = "aservicerate.name",

View File

@@ -6,9 +6,9 @@ namespace AyaNova.DataList
{
public TaxCodeDataList()
{
DefaultListObjectType = AyaType.TaxCode;
DefaultListAType = AyaType.TaxCode;
SQLFrom = "from ataxcode";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "Name", "TaxCodeTaxA", "TaxCodeTaxB", "TaxCodeTaxOnTax", "Active" };
DefaultSortBy = new Dictionary<string, string>() { { "Name", "+" } };
@@ -18,7 +18,7 @@ namespace AyaNova.DataList
{
TKey = "Name",
FieldKey = "Name",
AyaObjectType = (int)AyaType.TaxCode,
AType = (int)AyaType.TaxCode,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "ataxcode.id",
SqlValueColumnName = "ataxcode.name",

View File

@@ -6,9 +6,9 @@ namespace AyaNova.DataList
{
public TestWidgetDataList()
{
DefaultListObjectType = AyaType.Widget;
DefaultListAType = AyaType.Widget;
SQLFrom = "from awidget left join auser on (awidget.userid=auser.id)";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "widgetname", "widgetserial", "widgetdollaramount", "widgetusertype", "widgetstartdate", "widgetactive", "username" };
DefaultSortBy = new Dictionary<string, string>() { { "widgetname", "+" } };
@@ -18,7 +18,7 @@ namespace AyaNova.DataList
{
TKey = "WidgetName",
FieldKey = "widgetname",
AyaObjectType = (int)AyaType.Widget,
AType = (int)AyaType.Widget,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "awidget.id",
SqlValueColumnName = "awidget.name",
@@ -87,7 +87,7 @@ namespace AyaNova.DataList
FieldKey = "username",
TKey = "User",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.User,
AType = (int)AyaType.User,
SqlIdColumnName = "auser.id",
SqlValueColumnName = "auser.name"
});

View File

@@ -6,9 +6,9 @@ namespace AyaNova.DataList
{
public TranslationDataList()
{
DefaultListObjectType = AyaType.Translation;
DefaultListAType = AyaType.Translation;
SQLFrom = "from atranslation";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "name", "stock", "cjkindex" };
DefaultSortBy = new Dictionary<string, string>() { { "name", "+" } };
@@ -18,7 +18,7 @@ namespace AyaNova.DataList
{
TKey = "Translation",
FieldKey = "name",
AyaObjectType = (int)AyaType.Translation,
AType = (int)AyaType.Translation,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "atranslation.id",
SqlValueColumnName = "atranslation.name",

View File

@@ -6,9 +6,9 @@ namespace AyaNova.DataList
{
public TravelRateDataList()
{
DefaultListObjectType = AyaType.TravelRate;
DefaultListAType = AyaType.TravelRate;
SQLFrom = "from atravelrate";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "Name", "Cost", "RateCharge", "RateUnitChargeDescriptionID", "Active" };
DefaultSortBy = new Dictionary<string, string>() { { "Name", "+" } };
@@ -18,7 +18,7 @@ namespace AyaNova.DataList
{
TKey = "Name",
FieldKey = "Name",
AyaObjectType = (int)AyaType.TravelRate,
AType = (int)AyaType.TravelRate,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "atravelrate.id",
SqlValueColumnName = "atravelrate.name",

View File

@@ -6,7 +6,7 @@ namespace AyaNova.DataList
{
public UnitDataList()
{
DefaultListObjectType = AyaType.Unit;
DefaultListAType = AyaType.Unit;
SQLFrom = "from aunit as amainunit "
+ "left join acustomer on (amainunit.customerid=acustomer.id) "
+ "left join aunit as aparentunit on (amainunit.parentunitid=aparentunit.id) "
@@ -15,7 +15,7 @@ namespace AyaNova.DataList
+ "left join aunit as areplacedbyunit on (amainunit.replacedbyunitid=areplacedbyunit.id) "
+ "left join acontract on (amainunit.contractid=acontract.id)";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "UnitSerial", "UnitModel", "Customer", "Active" };
DefaultSortBy = new Dictionary<string, string>() { { "UnitSerial", "+" } };
@@ -25,7 +25,7 @@ namespace AyaNova.DataList
{
TKey = "UnitSerial",
FieldKey = "UnitSerial",
AyaObjectType = (int)AyaType.Unit,
AType = (int)AyaType.Unit,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "amainunit.id",
SqlValueColumnName = "amainunit.serial",
@@ -61,7 +61,7 @@ namespace AyaNova.DataList
FieldKey = "Customer",
TKey = "Customer",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.Customer,
AType = (int)AyaType.Customer,
SqlIdColumnName = "acustomer.id",
SqlValueColumnName = "acustomer.name"
});
@@ -71,7 +71,7 @@ namespace AyaNova.DataList
FieldKey = "UnitParentUnitID",
TKey = "UnitParentUnitID",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.Unit,
AType = (int)AyaType.Unit,
SqlIdColumnName = "aparentunit.id",
SqlValueColumnName = "aparentunit.serial"
});
@@ -81,7 +81,7 @@ namespace AyaNova.DataList
FieldKey = "UnitReplacedByUnitID",
TKey = "UnitReplacedByUnitID",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.Unit,
AType = (int)AyaType.Unit,
SqlIdColumnName = "areplacedbyunit.id",
SqlValueColumnName = "areplacedbyunit.serial"
});
@@ -91,7 +91,7 @@ namespace AyaNova.DataList
FieldKey = "UnitModel",
TKey = "UnitModel",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.UnitModel,
AType = (int)AyaType.UnitModel,
SqlIdColumnName = "aunitmodel.id",
SqlValueColumnName = "aunitmodel.number"
});
@@ -117,7 +117,7 @@ namespace AyaNova.DataList
FieldKey = "UnitPurchaseFromID",
TKey = "UnitPurchaseFromID",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.Vendor,
AType = (int)AyaType.Vendor,
SqlIdColumnName = "avendor.id",
SqlValueColumnName = "avendor.name"
});
@@ -183,7 +183,7 @@ namespace AyaNova.DataList
TKey = "Contract",
FieldKey = "unitcontract",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.Contract,
AType = (int)AyaType.Contract,
SqlIdColumnName = "acontract.id",
SqlValueColumnName = "acontract.name"
});

View File

@@ -6,9 +6,9 @@ namespace AyaNova.DataList
{
public UnitModelDataList()
{
DefaultListObjectType = AyaType.UnitModel;
DefaultListAType = AyaType.UnitModel;
SQLFrom = "from aunitmodel left join avendor on (aunitmodel.vendorid=avendor.id)";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "UnitModelModelNumber", "Name", "UnitModelVendorID", "Active" };
DefaultSortBy = new Dictionary<string, string>() { { "UnitModelModelNumber", "+" } };
@@ -18,7 +18,7 @@ namespace AyaNova.DataList
{
TKey = "UnitModelModelNumber",
FieldKey = "UnitModelModelNumber",
AyaObjectType = (int)AyaType.UnitModel,
AType = (int)AyaType.UnitModel,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "aunitmodel.id",
SqlValueColumnName = "aunitmodel.number",
@@ -54,7 +54,7 @@ namespace AyaNova.DataList
FieldKey = "UnitModelVendorID",
TKey = "UnitModelVendorID",
UiFieldDataType = (int)UiFieldDataType.Text,
AyaObjectType = (int)AyaType.Vendor,
AType = (int)AyaType.Vendor,
SqlIdColumnName = "avendor.id",
SqlValueColumnName = "avendor.name"
});

View File

@@ -6,9 +6,9 @@ namespace AyaNova.DataList
{
public VendorDataList()
{
DefaultListObjectType = AyaType.Vendor;
DefaultListAType = AyaType.Vendor;
SQLFrom = "from avendor";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "vendorname", "vendorphone1", "vendoremail", "vendortags" };
DefaultSortBy = new Dictionary<string, string>() { { "vendorname", "+" } };
@@ -18,7 +18,7 @@ namespace AyaNova.DataList
{
TKey = "VendorName",
FieldKey = "vendorname",
AyaObjectType = (int)AyaType.Vendor,
AType = (int)AyaType.Vendor,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "avendor.id",
SqlValueColumnName = "avendor.name",

View File

@@ -13,7 +13,7 @@ namespace AyaNova.PickList
public string SQLFrom { get; set; }
public List<AyaPickListFieldDefinition> ColumnDefinitions { get; set; }
public AuthorizationRoles AllowedRoles { get; set; }
public AyaType DefaultListObjectType { get; set; }
public AyaType DefaultListAType { get; set; }
public string DefaultTemplate { get; set; }
//return array of field keys in list view
public List<string> GetFieldListFromTemplate(JArray template)

View File

@@ -8,9 +8,9 @@ namespace AyaNova.PickList
public ContractPickList()
{
DefaultListObjectType = AyaType.Contract;
DefaultListAType = AyaType.Contract;
SQLFrom = "from acontract";
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
dynamic dTemplate = new JArray();
dynamic cm = new JObject();

View File

@@ -8,9 +8,9 @@ namespace AyaNova.PickList
public CustomerPickList()
{
DefaultListObjectType = AyaType.Customer;
DefaultListAType = AyaType.Customer;
SQLFrom = "from acustomer";
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
dynamic dTemplate = new JArray();
dynamic cm = new JObject();

View File

@@ -8,9 +8,9 @@ namespace AyaNova.PickList
public HeadOfficePickList()
{
DefaultListObjectType = AyaType.HeadOffice;
DefaultListAType = AyaType.HeadOffice;
SQLFrom = "from aheadoffice";
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
dynamic dTemplate = new JArray();
dynamic cm = new JObject();

View File

@@ -12,7 +12,7 @@ namespace AyaNova.PickList
//allowed roles to access this list
AuthorizationRoles AllowedRoles { get; set; }
//Default object type to open for rows of this list (use no object if no)
AyaType DefaultListObjectType { get; set; }
AyaType DefaultListAType { get; set; }
//Default / STOCK template when none is specified
string DefaultTemplate { get; set; }
List<string> GetFieldListFromTemplate(JArray fieldListArray);

View File

@@ -8,9 +8,9 @@ namespace AyaNova.PickList
public LoanUnitPickList()
{
DefaultListObjectType = AyaType.LoanUnit;
DefaultListAType = AyaType.LoanUnit;
SQLFrom = "from aloanunit";
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
dynamic dTemplate = new JArray();
dynamic cm = null;

View File

@@ -8,9 +8,9 @@ namespace AyaNova.PickList
public PartAssemblyPickList()
{
DefaultListObjectType = AyaType.PartAssembly;
DefaultListAType = AyaType.PartAssembly;
SQLFrom = "from apartassembly";
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
dynamic dTemplate = new JArray();
dynamic cm = null;

View File

@@ -8,12 +8,12 @@ namespace AyaNova.PickList
public PartPickList()
{
DefaultListObjectType = AyaType.Part;
DefaultListAType = AyaType.Part;
SQLFrom = "from apart "
+ "left join avendor as amanufacturer on (apart.manufacturerid = amanufacturer.id) "
+ "left join avendor as awholesaler on (apart.wholesalerid = awholesaler.id) "
+ "left join avendor as aalternativewholesaler on (apart.alternativewholesalerid = aalternativewholesaler.id) ";
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
dynamic dTemplate = new JArray();
dynamic cm = null;

View File

@@ -8,9 +8,9 @@ namespace AyaNova.PickList
public PartWarehousePickList()
{
DefaultListObjectType = AyaType.PartWarehouse;
DefaultListAType = AyaType.PartWarehouse;
SQLFrom = "from apartwarehouse";
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
dynamic dTemplate = new JArray();
dynamic cm = null;

View File

@@ -17,7 +17,7 @@ namespace AyaNova.PickList
//Sort out effective Template
string Template = null;
//Attempt to fetch custom template
var t = await ct.PickListTemplate.FirstOrDefaultAsync(z => z.Id == ((long)PickList.DefaultListObjectType));
var t = await ct.PickListTemplate.FirstOrDefaultAsync(z => z.Id == ((long)PickList.DefaultListAType));
if (t == null)
{
Template = PickList.DefaultTemplate;

View File

@@ -57,7 +57,7 @@ namespace AyaNova.PickList
AyaPickListFieldDefinition rowIdColumn = pickList.ColumnDefinitions.FirstOrDefault(z => z.IsRowId == true);
//this should only happen with a development error
if (rowIdColumn == null)
throw new System.ArgumentNullException($"DEV ERROR in PickListSqlBuilder.cs: picklist for {pickList.DefaultListObjectType.ToString()} has no rowId column specified in columnDefinitions list");
throw new System.ArgumentNullException($"DEV ERROR in PickListSqlBuilder.cs: picklist for {pickList.DefaultListAType.ToString()} has no rowId column specified in columnDefinitions list");
PlIdSelectFragment = rowIdColumn.SqlIdColumnName + " as plId";

View File

@@ -8,9 +8,9 @@ namespace AyaNova.PickList
public ProjectPickList()
{
DefaultListObjectType = AyaType.Project;
DefaultListAType = AyaType.Project;
SQLFrom = "from aproject";
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
dynamic dTemplate = new JArray();
dynamic cm = null;

View File

@@ -12,9 +12,9 @@ namespace AyaNova.PickList
public ServiceRatePickList()
{
DefaultListObjectType = AyaType.ServiceRate;
DefaultListAType = AyaType.ServiceRate;
SQLFrom = "from aservicerate";
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
dynamic dTemplate = new JArray();
dynamic cm = new JObject();

View File

@@ -8,9 +8,9 @@ namespace AyaNova.PickList
public TaxCodePickList()
{
DefaultListObjectType = AyaType.TaxCode;
DefaultListAType = AyaType.TaxCode;
SQLFrom = "from ataxcode";
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
dynamic dTemplate = new JArray();
dynamic cm = new JObject();

View File

@@ -12,9 +12,9 @@ namespace AyaNova.PickList
public TravelRatePickList()
{
DefaultListObjectType = AyaType.TravelRate;
DefaultListAType = AyaType.TravelRate;
SQLFrom = "from atravelrate";
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
dynamic dTemplate = new JArray();
dynamic cm = new JObject();

View File

@@ -8,9 +8,9 @@ namespace AyaNova.PickList
public UnitModelPickList()
{
DefaultListObjectType = AyaType.UnitModel;
DefaultListAType = AyaType.UnitModel;
SQLFrom = "from aunitmodel left join avendor on (aunitmodel.vendorid=avendor.id)";
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
dynamic dTemplate = new JArray();
dynamic cm = null;

View File

@@ -8,12 +8,12 @@ namespace AyaNova.PickList
public UnitPickList()
{
DefaultListObjectType = AyaType.Unit;
DefaultListAType = AyaType.Unit;
SQLFrom = "from aunit "
+ "left join aunitmodel on (aunit.unitmodelid=aunitmodel.id) "
+ "left join avendor on (aunitmodel.vendorid=avendor.id) ";
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
dynamic dTemplate = new JArray();
dynamic cm = null;

View File

@@ -8,9 +8,9 @@ namespace AyaNova.PickList
public UserPickList()
{
DefaultListObjectType = AyaType.User;
DefaultListAType = AyaType.User;
SQLFrom = "from auser";
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
dynamic dTemplate = new JArray();
dynamic cm = new JObject();

View File

@@ -8,9 +8,9 @@ namespace AyaNova.PickList
public VendorPickList()
{
DefaultListObjectType = AyaType.Vendor;
DefaultListAType = AyaType.Vendor;
SQLFrom = "from avendor";
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
dynamic dTemplate = new JArray();
dynamic cm = new JObject();

View File

@@ -7,9 +7,9 @@ namespace AyaNova.PickList
{
public WidgetPickList()
{
DefaultListObjectType = AyaType.Widget;
DefaultListAType = AyaType.Widget;
SQLFrom = "from awidget left join auser on (awidget.userid=auser.id)";
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
//Default template
dynamic dTemplate = new JArray();
@@ -47,7 +47,7 @@ namespace AyaNova.PickList
{
TKey = "WidgetName",
FieldKey = "widgetname",
//AyaObjectType = AyaType.Widget,
//AType = AyaType.Widget,
ColumnDataType = UiFieldDataType.Text,
SqlIdColumnName = "awidget.id",
SqlValueColumnName = "awidget.name",

View File

@@ -8,9 +8,9 @@ namespace AyaNova.PickList
public WorkOrderTemplatePickList()
{
DefaultListObjectType = AyaType.WorkOrderTemplate;
DefaultListAType = AyaType.WorkOrderTemplate;
SQLFrom = "from aworkordertemplate";
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
dynamic dTemplate = new JArray();
dynamic cm = new JObject();

View File

@@ -90,7 +90,7 @@ namespace AyaNova.Biz
var FullPathName = FileUtil.GetPermanentAttachmentFilePath(i.StoredFileName);
AllDBFileFullPath.Add(FullPathName);
var FileExistsInReality = AllAttachmentFilesOnDisk.Contains(FullPathName);
var ParentBizObjectExistsInReality = await BizObjectExistsInDatabase.ExistsAsync(i.AttachToObjectType, i.AttachToObjectId, ct);
var ParentBizObjectExistsInReality = await BizObjectExistsInDatabase.ExistsAsync(i.AttachToAType, i.AttachToObjectId, ct);
//does the db record reflect the same status as reality?
if (FileExistsInReality != i.Exists || !ParentBizObjectExistsInReality)
{
@@ -101,7 +101,7 @@ namespace AyaNova.Biz
if (!ParentBizObjectExistsInReality)
{
//switch it to notype
f.AttachToObjectType = AyaType.NoType;
f.AttachToAType = AyaType.NoType;
f.AttachToObjectId = 0;
}
await ct.SaveChangesAsync();
@@ -121,10 +121,10 @@ namespace AyaNova.Biz
// //also, potentiallly
// //iterate orphaned file attachments to NOTHING type, if found to be attached to any other object remove the orphaned object attachment record in db
// //but keeping the physical file since it's attached to something else
// var AllOrphansInDb = await ct.FileAttachment.Where(z => z.AttachToObjectType == AyaType.NoType).ToListAsync();
// var AllOrphansInDb = await ct.FileAttachment.Where(z => z.AttachToAType == AyaType.NoType).ToListAsync();
// foreach (FileAttachment OrphanInDb in AllOrphansInDb)
// {
// if (await ct.FileAttachment.AnyAsync(z => z.StoredFileName==OrphanInDb.StoredFileName && z.AttachToObjectType != AyaType.NoType))
// if (await ct.FileAttachment.AnyAsync(z => z.StoredFileName==OrphanInDb.StoredFileName && z.AttachToAType != AyaType.NoType))
// {
// //It is also attached to something else so remove it from the nothing type
// ct.FileAttachment.Remove(OrphanInDb);
@@ -158,7 +158,7 @@ namespace AyaNova.Biz
{
FileAttachment fa = new FileAttachment();
fa.AttachToObjectId = 0;
fa.AttachToObjectType = AyaType.NoType;
fa.AttachToAType = AyaType.NoType;
fa.ContentType = "application/octet-stream";//most generic type, we don't know what it is
fa.DisplayFileName = "FOUND" + FileUtil.GetSafeDateFileName();
fa.LastModified = DateTime.UtcNow;

View File

@@ -17,7 +17,7 @@ namespace AyaNova.Biz
}
}
public AyaType ObjectType
public AyaType AType
{
get
{
@@ -25,7 +25,7 @@ namespace AyaNova.Biz
}
}
public int ObjectTypeAsInt
public int ATypeAsInt
{
get
{
@@ -33,20 +33,20 @@ namespace AyaNova.Biz
}
}
public AyaTypeId(AyaType ObjectType, long Id)
public AyaTypeId(AyaType aType, long Id)
{
_id = Id;
_ayaType = ObjectType;
_ayaType = aType;
}
public AyaTypeId(string sObjectTypeNumeral, string sId)
public AyaTypeId(string sATypeNumeral, string sId)
{
_id = long.Parse(sId);
int nType = int.Parse(sObjectTypeNumeral);
int nType = int.Parse(sATypeNumeral);
if (!AyaTypeExists(nType))
_ayaType = AyaType.NoType;
else
_ayaType = (AyaType)Enum.Parse(typeof(AyaType), sObjectTypeNumeral);
_ayaType = (AyaType)Enum.Parse(typeof(AyaType), sATypeNumeral);
}
public bool Equals(AyaTypeId x, AyaTypeId y)
@@ -60,7 +60,7 @@ namespace AyaNova.Biz
return false;
//Check whether the products' properties are equal.
return x.ObjectId == y.ObjectId && x.ObjectType == y.ObjectType;
return x.ObjectId == y.ObjectId && x.AType == y.AType;
}
public bool IsEmpty
@@ -95,7 +95,7 @@ namespace AyaNova.Biz
{
get
{
return this.ObjectType.HasAttribute(typeof(CoreBizObjectAttribute));
return this.AType.HasAttribute(typeof(CoreBizObjectAttribute));
}
}

View File

@@ -15,11 +15,11 @@ namespace AyaNova.Biz
//Returns existance status of object type and id specified in database
internal static async Task<bool> ExistsAsync(AyaType objectType, long id, AyContext ct)
internal static async Task<bool> ExistsAsync(AyaType aType, long id, AyContext ct)
{
//new up a context??
switch (objectType)
switch (aType)
{
//CoreBizObject add here
case AyaType.NoType://no type always exists and this is used by orphaned attachments
@@ -123,7 +123,7 @@ namespace AyaNova.Biz
case AyaType.CustomerServiceRequest:
return await ct.CustomerServiceRequest.AnyAsync(z => z.Id == id);
default:
throw new System.NotSupportedException($"AyaNova.Biz.BizObjectExistsInDatabase::ExistsAsync type {objectType.ToString()} is not supported");
throw new System.NotSupportedException($"AyaNova.Biz.BizObjectExistsInDatabase::ExistsAsync type {aType.ToString()} is not supported");
}
}

View File

@@ -113,7 +113,7 @@ namespace AyaNova.Biz
{
Date = z.Created,
ObjectType = z.AyaType,
AType = z.AyaType,
ObjectId = z.AyId,
Event = z.AyEvent,
Textra = z.Textra,

View File

@@ -311,7 +311,7 @@ namespace AyaNova.Biz
case JobType.BatchCoreObjectOperation:
//batch op, hand off to biz object to deal with
//note, convention is that there is an idList in job.jobinfo json if preselected else it's all objects of type
o = (IJobObject)BizObjectFactory.GetBizObject(job.ObjectType, ct);
o = (IJobObject)BizObjectFactory.GetBizObject(job.AType, ct);
break;
default:
throw new System.NotSupportedException($"ProcessJobAsync type {job.JobType.ToString()} is not supported");

View File

@@ -121,7 +121,7 @@ namespace AyaNova.Biz
// newObject.JsHelpers = (string)o["JsHelpers"];
// newObject.JsPrerender = (string)o["JsPrerender"];
// newObject.Notes = (string)o["Notes"];
// newObject.ObjectType = (AyaType)(int)o["ObjectType"];
// newObject.AType = (AyaType)(int)o["AType"];
// newObject.RenderType = (ReportRenderType)(int)o["RenderType"];
// newObject.Roles = (AuthorizationRoles)(int)o["Roles"];
// newObject.Style = (string)o["Style"];
@@ -239,9 +239,9 @@ namespace AyaNova.Biz
////////////////////////////////////////////////////////////////////////////////////////////////
//GET LIST
//
internal async Task<List<NameIdItem>> GetReportListAsync(AyaType ayType)
internal async Task<List<NameIdItem>> GetReportListAsync(AyaType aType)
{
var rpts = await ct.Report.AsNoTracking().Where(z => z.ObjectType == ayType && z.Active == true).Select(z => new { id = z.Id, name = z.Name, roles = z.Roles }).ToListAsync();
var rpts = await ct.Report.AsNoTracking().Where(z => z.AType == aType && z.Active == true).Select(z => new { id = z.Id, name = z.Name, roles = z.Roles }).ToListAsync();
var ret = new List<NameIdItem>();
foreach (var item in rpts)
{
@@ -341,15 +341,15 @@ namespace AyaNova.Biz
var log = AyaNova.Util.ApplicationLogging.CreateLogger("ReportBiz::GetReportData");
AuthorizationRoles effectiveRoles = CurrentUserRoles;
if (selectedRequest.ObjectType == AyaType.NoType)
if (selectedRequest.AType == AyaType.NoType)
{
AddError(ApiErrorCode.VALIDATION_REQUIRED, null, $"ObjectType is required");
AddError(ApiErrorCode.VALIDATION_REQUIRED, null, $"AType is required");
return null;
}
if (!AyaNova.Api.ControllerHelpers.Authorized.HasReadFullRole(effectiveRoles, selectedRequest.ObjectType))
if (!AyaNova.Api.ControllerHelpers.Authorized.HasReadFullRole(effectiveRoles, selectedRequest.AType))
{
AddError(ApiErrorCode.NOT_AUTHORIZED, null, $"User not authorized for {selectedRequest.ObjectType} type object");
AddError(ApiErrorCode.NOT_AUTHORIZED, null, $"User not authorized for {selectedRequest.AType} type object");
return null;
}
@@ -358,9 +358,9 @@ namespace AyaNova.Biz
selectedRequest.SelectedRowIds = await DataListSelectedProcessingOptions.RehydrateIdList(selectedRequest, ct, effectiveRoles, log, UserId, UserTranslationId);
log.LogDebug($"Instantiating biz object handler for {selectedRequest.ObjectType}");
var biz = BizObjectFactory.GetBizObject(selectedRequest.ObjectType, ct, UserId, CurrentUserRoles, UserTranslationId);
log.LogDebug($"Fetching data for {selectedRequest.SelectedRowIds.Length} {selectedRequest.ObjectType} items");
log.LogDebug($"Instantiating biz object handler for {selectedRequest.AType}");
var biz = BizObjectFactory.GetBizObject(selectedRequest.AType, ct, UserId, CurrentUserRoles, UserTranslationId);
log.LogDebug($"Fetching data for {selectedRequest.SelectedRowIds.Length} {selectedRequest.AType} items");
return await ((IReportAbleObject)biz).GetReportData(selectedRequest.SelectedRowIds);
}
@@ -383,17 +383,17 @@ namespace AyaNova.Biz
}
//If we get here via the /viewreport url in the client then there is no object type set so we need to set it here from the report
if(reportRequest.ObjectType==AyaType.NoType){
reportRequest.ObjectType=report.ObjectType;
if(reportRequest.AType==AyaType.NoType){
reportRequest.AType=report.AType;
}
AuthorizationRoles effectiveRoles = CurrentUserRoles;
if (!AyaNova.Api.ControllerHelpers.Authorized.HasReadFullRole(effectiveRoles, report.ObjectType))
if (!AyaNova.Api.ControllerHelpers.Authorized.HasReadFullRole(effectiveRoles, report.AType))
{
AddError(ApiErrorCode.NOT_AUTHORIZED, null, $"User not authorized for {report.ObjectType} type object");
AddError(ApiErrorCode.NOT_AUTHORIZED, null, $"User not authorized for {report.AType} type object");
return null;
}
@@ -559,14 +559,14 @@ namespace AyaNova.Biz
//Custom fields definition for report usage
string CustomFieldsTemplate = "null";
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == report.ObjectType.ToString());
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == report.AType.ToString());
if (FormCustomization != null)
{
CustomFieldsTemplate = FormCustomization.Template;
}
//Report meta data
var reportMeta = $"{{Id:{report.Id},Name:`{report.Name}`,Notes:`{report.Notes}`,ObjectType:`{report.ObjectType}`,CustomFieldsDefinition:{CustomFieldsTemplate},DataListKey:`{reportRequest.DataListKey}`,SelectedRowIds: `{string.Join(",", reportRequest.SelectedRowIds)}`}}";
var reportMeta = $"{{Id:{report.Id},Name:`{report.Name}`,Notes:`{report.Notes}`,AType:`{report.AType}`,CustomFieldsDefinition:{CustomFieldsTemplate},DataListKey:`{reportRequest.DataListKey}`,SelectedRowIds: `{string.Join(",", reportRequest.SelectedRowIds)}`}}";
//duplicate meta data in report page wide variable for use by our internal functions

View File

@@ -276,17 +276,17 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "ObjectId");
return;
}
if (proposedObj.ObjectType != currentObj.ObjectType)
if (proposedObj.AType != currentObj.AType)
{
AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "ObjectType");
AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "AType");
return;
}
}
//Does the object of this Review actually exist?
if (!await BizObjectExistsInDatabase.ExistsAsync(proposedObj.ObjectType, proposedObj.ObjectId, ct))
if (!await BizObjectExistsInDatabase.ExistsAsync(proposedObj.AType, proposedObj.ObjectId, ct))
{
AddError(ApiErrorCode.NOT_FOUND, "generalerror", $"LT:ErrorAPI2010 LT:{proposedObj.ObjectType} id {proposedObj.ObjectId}");
AddError(ApiErrorCode.NOT_FOUND, "generalerror", $"LT:ErrorAPI2010 LT:{proposedObj.AType} id {proposedObj.ObjectId}");
return;
}

View File

@@ -152,11 +152,11 @@ namespace AyaNova.Biz
//Of type?
if (searchParameters.TypeOnly != AyaType.NoType)
q = q.Where(z => z.ObjectType == searchParameters.TypeOnly);
q = q.Where(z => z.AType == searchParameters.TypeOnly);
//Find the records that have the search terms in searchkey
var SearchMatches = q.GroupBy(z => new { z.ObjectType, z.ObjectId }).Select(z => new { ObjectId = z.Key.ObjectId, ObjectType = z.Key.ObjectType, ObjectCount = z.LongCount() });
var SearchMatches = q.GroupBy(z => new { z.AType, z.ObjectId }).Select(z => new { ObjectId = z.Key.ObjectId, AType = z.Key.AType, ObjectCount = z.LongCount() });
//PUT THE RESULTS INTO MATCHING OBJECTS LIST
@@ -164,7 +164,7 @@ namespace AyaNova.Biz
{
//keep any object that matches *all* the search terms
if (SearchMatch.ObjectCount == TotalSearchTermsToMatch)
MatchingObjects.Add(new AyaTypeId(SearchMatch.ObjectType, SearchMatch.ObjectId));
MatchingObjects.Add(new AyaTypeId(SearchMatch.AType, SearchMatch.ObjectId));
}
@@ -173,19 +173,19 @@ namespace AyaNova.Biz
List<AyaTypeId> CanReadMatchingObjects = new List<AyaTypeId>();
foreach (AyaTypeId t in MatchingObjects)
{
if (t.ObjectType == AyaType.FileAttachment)
if (t.AType == AyaType.FileAttachment)
{
//have to look up the actual underlying object type and id here
//check if it's readable for user
//then add the PARENT object type and id to the CanREadMatchingObjects list
//this means user will not see it return as an attachment, just as the object
FileAttachment f = await ct.FileAttachment.AsNoTracking().FirstOrDefaultAsync(z => z.Id == t.ObjectId);
if (AyaNova.Api.ControllerHelpers.Authorized.HasReadFullRole(currentUserRoles, f.AttachToObjectType))
if (AyaNova.Api.ControllerHelpers.Authorized.HasReadFullRole(currentUserRoles, f.AttachToAType))
{
CanReadMatchingObjects.Add(new AyaTypeId(f.AttachToObjectType, f.AttachToObjectId));
CanReadMatchingObjects.Add(new AyaTypeId(f.AttachToAType, f.AttachToObjectId));
}
}
else if (t.ObjectType == AyaType.Memo)
else if (t.AType == AyaType.Memo)
{
//Users are only permitted to search their own memo's
if (await ct.Memo.AsNoTracking().AnyAsync(z => z.Id == t.ObjectId && z.ToId == currentUserId))
@@ -193,7 +193,7 @@ namespace AyaNova.Biz
}
else
{
if (AyaNova.Api.ControllerHelpers.Authorized.HasReadFullRole(currentUserRoles, t.ObjectType))
if (AyaNova.Api.ControllerHelpers.Authorized.HasReadFullRole(currentUserRoles, t.AType))
{
CanReadMatchingObjects.Add(t);
}
@@ -217,7 +217,7 @@ namespace AyaNova.Biz
//Sort and group the matching objects list in return order
//zCzustomer.OrderBy(z => z.LastName).ThenBy(z => z.FirstName)
var OrderedMatchingObjects = MatchingObjects.OrderBy(z => z.ObjectType).ThenByDescending(z => z.ObjectId);
var OrderedMatchingObjects = MatchingObjects.OrderBy(z => z.AType).ThenByDescending(z => z.ObjectId);
@@ -233,11 +233,11 @@ namespace AyaNova.Biz
foreach (AyaTypeId i in OrderedMatchingObjects)
{
SearchResult SR = new SearchResult();
SR.Name = BizObjectNameFetcherDirect.Name(i.ObjectType,
SR.Name = BizObjectNameFetcherDirect.Name(i.AType,
i.ObjectId,
command);
SR.Id = i.ObjectId;
SR.Type = i.ObjectType;
SR.Type = i.AType;
ReturnObject.SearchResults.Add(SR);
}
}
@@ -581,16 +581,16 @@ namespace AyaNova.Biz
{
public long TranslationId { get; set; }
public long ObjectId { get; set; }
public AyaType ObjectType { get; set; }
public AyaType AType { get; set; }
public List<string> Words { get; set; }
public SearchIndexProcessObjectParameters(long translationId, long objectID, AyaType objectType)
public SearchIndexProcessObjectParameters(long translationId, long objectID, AyaType aType)
{
Words = new List<string>();
TranslationId = translationId;
ObjectId = objectID;
ObjectType = objectType;
AType = aType;
}
//format used for getsummmary by biz objects
@@ -599,7 +599,7 @@ namespace AyaNova.Biz
Words = new List<string>();
TranslationId = 0;
ObjectId = 0;
ObjectType = 0;
AType = 0;
}
public SearchIndexProcessObjectParameters AddText(string s)
@@ -663,11 +663,11 @@ namespace AyaNova.Biz
await ProcessKeywordsAsync(searchIndexObjectParameters, false);
}
public static async Task ProcessDeletedObjectKeywordsAsync(long objectID, AyaType objectType, AyContext ct)
public static async Task ProcessDeletedObjectKeywordsAsync(long objectID, AyaType aType, AyContext ct)
{
//Be careful in future, if you put ToString at the end of each object in the string interpolation
//npgsql driver will assume it's a string and put quotes around it triggering an error that a string can't be compared to an int
await ct.Database.ExecuteSqlInterpolatedAsync($"delete from asearchkey where objectid={objectID} and objecttype={(int)objectType}");
await ct.Database.ExecuteSqlInterpolatedAsync($"delete from asearchkey where objectid={objectID} and aType={(int)aType}");
//nothing to save here, it's a direct command already executed
}
@@ -678,15 +678,15 @@ namespace AyaNova.Biz
private static async Task ProcessKeywordsAsync(SearchIndexProcessObjectParameters p, bool newRecord)
{
// #if (DEBUG)
// if (!p.ObjectType.HasAttribute(typeof(CoreBizObjectAttribute)))
// throw new System.NotSupportedException($"Search::ProcessKeywords - Invalid type presented {p.ObjectType}");
// if (!p.AType.HasAttribute(typeof(CoreBizObjectAttribute)))
// throw new System.NotSupportedException($"Search::ProcessKeywords - Invalid type presented {p.AType}");
// #endif
List<string> KeyWordList = await BreakAsync(p.TranslationId, p.Words);
if (KeyWordList.Count == 0) return;
//call stored procedure to do the work right at the server (fastest method by far)
using (AyContext ct = ServiceProviderProvider.DBContext)
await ct.Database.ExecuteSqlInterpolatedAsync($"call aydosearchindex({KeyWordList},{p.ObjectId},{p.ObjectType},{!newRecord})");
await ct.Database.ExecuteSqlInterpolatedAsync($"call aydosearchindex({KeyWordList},{p.ObjectId},{p.AType},{!newRecord})");
return;
}//eoc
#endregion

View File

@@ -45,12 +45,12 @@ namespace AyaNova.Biz
using (var transaction = await ct.Database.BeginTransactionAsync())
{
//get the last record
var LastEntry = await ct.ServiceBank.OrderByDescending(m => m.EntryDate).FirstOrDefaultAsync(m => m.ObjectId == newDtObject.ObjectId && m.ObjectType == newDtObject.ObjectType);
var LastEntry = await ct.ServiceBank.OrderByDescending(m => m.EntryDate).FirstOrDefaultAsync(m => m.ObjectId == newDtObject.ObjectId && m.AType == newDtObject.AType);
ServiceBank newObject = new ServiceBank();
newObject.Name = newDtObject.Name;
newObject.EntryDate = DateTime.UtcNow;
newObject.ObjectId = newDtObject.ObjectId;
newObject.ObjectType = newDtObject.ObjectType;
newObject.AType = newDtObject.AType;
newObject.SourceId = newDtObject.SourceId;
newObject.SourceType = newDtObject.SourceType;
newObject.Incidents = newDtObject.Incidents;
@@ -126,10 +126,10 @@ namespace AyaNova.Biz
// ////////////////////////////////////////////////////////////////////////////////////////////////
// //GET LAST
// //
// internal async Task<ServiceBank> GetLastForObjectAsync(AyaType objectType, long objectId)
// internal async Task<ServiceBank> GetLastForObjectAsync(AyaType aType, long objectId)
// {
// var ret = await ct.ServiceBank.OrderByDescending(m => m.EntryDate).SingleOrDefaultAsync(m => m.ObjectId == objectId && m.ObjectType == objectType);
// var ret = await ct.ServiceBank.OrderByDescending(m => m.EntryDate).SingleOrDefaultAsync(m => m.ObjectId == objectId && m.AType == aType);
// return ret;
// }
@@ -179,15 +179,15 @@ namespace AyaNova.Biz
//Object exists?
if (!await BizObjectExistsInDatabase.ExistsAsync(proposedObj.ObjectType, proposedObj.ObjectId, ct))
if (!await BizObjectExistsInDatabase.ExistsAsync(proposedObj.AType, proposedObj.ObjectId, ct))
{
AddError(ApiErrorCode.NOT_FOUND, "generalerror", $"Bankable source object specified doesn't exist [type:{proposedObj.ObjectType}, id:{proposedObj.ObjectId}]");
AddError(ApiErrorCode.NOT_FOUND, "generalerror", $"Bankable source object specified doesn't exist [type:{proposedObj.AType}, id:{proposedObj.ObjectId}]");
return;
}
/*
"CONSTRAINT UNQ_ServiceBank UNIQUE (entrydate, objectid, objecttype, incidentsbalance, hoursbalance, currencybalance), " +
"CONSTRAINT UNQ_ServiceBank_Previous_values UNIQUE (lastentrydate, objectid, objecttype, lastincidentsbalance, lasthoursbalance, lastcurrencybalance), " +
"CONSTRAINT fk_ServiceBank_self FOREIGN KEY (lastentrydate, objectid, objecttype, lastincidentsbalance, lasthoursbalance, lastcurrencybalance) references aservicebank(entrydate, objectid, objecttype, incidentsbalance, hoursbalance, currencybalance), " +
"CONSTRAINT UNQ_ServiceBank UNIQUE (entrydate, objectid, aType, incidentsbalance, hoursbalance, currencybalance), " +
"CONSTRAINT UNQ_ServiceBank_Previous_values UNIQUE (lastentrydate, objectid, aType, lastincidentsbalance, lasthoursbalance, lastcurrencybalance), " +
"CONSTRAINT fk_ServiceBank_self FOREIGN KEY (lastentrydate, objectid, aType, lastincidentsbalance, lasthoursbalance, lastcurrencybalance) references aservicebank(entrydate, objectid, aType, incidentsbalance, hoursbalance, currencybalance), " +
"CONSTRAINT CHK_Servicebank_Valid_IncidentBalance CHECK(incidentsbalance = COALESCE(lastincidentsbalance, 0) + incidents), " +
"CONSTRAINT CHK_Servicebank_Valid_CurrencyBalance CHECK(currencybalance = COALESCE(lastcurrencybalance, 0) + currency), " +
"CONSTRAINT CHK_Servicebank_Valid_HoursBalance CHECK(hoursbalance = COALESCE(lasthoursbalance, 0) + hours), " +
@@ -323,7 +323,7 @@ namespace AyaNova.Biz
var subs = await ct.NotifySubscription.Where(z => z.EventType == NotifyEventType.ServiceBankDepleted).ToListAsync();
string SourceName = string.Empty;
if (subs.Count > 0)
SourceName = BizObjectNameFetcherDirect.Name(o.ObjectType, o.ObjectId, ct);
SourceName = BizObjectNameFetcherDirect.Name(o.AType, o.ObjectId, ct);
foreach (var sub in subs)
{
@@ -343,7 +343,7 @@ namespace AyaNova.Biz
{
EventType = NotifyEventType.ServiceBankDepleted,
UserId = sub.UserId,
AyaType = o.ObjectType,
AyaType = o.AType,
ObjectId = o.ObjectId,
NotifySubscriptionId = sub.Id,
Name = SourceName

View File

@@ -2575,7 +2575,7 @@ namespace AyaNova.Biz
ICoreBizObjectModel o = null;
//save a fetch if it's a delete
if (job.SubType != JobSubType.Delete)
o = await GetWorkOrderGraphItem(job.ObjectType, id);
o = await GetWorkOrderGraphItem(job.AType, id);
switch (job.SubType)
{
case JobSubType.TagAddAny:
@@ -2587,7 +2587,7 @@ namespace AyaNova.Biz
SaveIt = TagBiz.ProcessBatchTagOperation(o.Tags, (string)jobData["tag"], jobData.ContainsKey("toTag") ? (string)jobData["toTag"] : null, job.SubType);
break;
case JobSubType.Delete:
if (!await DeleteWorkOrderGraphItem(job.ObjectType, id))
if (!await DeleteWorkOrderGraphItem(job.AType, id))
{
await JobsBiz.LogJobAsync(job.GId, $"LT:Errors {GetErrorsAsString()} id {id}");
FailedObjectCount++;
@@ -2598,7 +2598,7 @@ namespace AyaNova.Biz
}
if (SaveIt)
{
o = await PutWorkOrderGraphItem(job.ObjectType, o);
o = await PutWorkOrderGraphItem(job.AType, o);
if (o == null)
{
await JobsBiz.LogJobAsync(job.GId, $"LT:Errors {GetErrorsAsString()} id {id}");

View File

@@ -326,7 +326,7 @@ namespace AyaNova.Biz
//Open object url
//### NOTE: If this is required anywhere else, move it to a central BizUtils class in Biz folder callable from here and there
private static string OpenObjectUrlBuilder(AyaType otype, long id, NotifyEventType net)
private static string OpenObjectUrlBuilder(AyaType aType, long id, NotifyEventType net)
{
var ServerUrl = ServerGlobalOpsSettingsCache.Notify.AyaNovaServerURL;
if (string.IsNullOrWhiteSpace(ServerUrl))
@@ -344,7 +344,7 @@ namespace AyaNova.Biz
//Might not have a type or id in which case nothing directly to open
if (otype == AyaType.NoType || id == 0)
if (aType == AyaType.NoType || id == 0)
{
return ServerUrl;
}
@@ -353,11 +353,11 @@ namespace AyaNova.Biz
{
//goto event log for item
// path: "/history/:ayatype/:recordid/:userlog?",
return $"{ServerUrl}/history/{(int)otype}/{id}";
return $"{ServerUrl}/history/{(int)aType}/{id}";
}
//default is to open the object in question directly
return $"{ServerUrl}/open/{(int)otype}/{id}";
return $"{ServerUrl}/open/{(int)aType}/{id}";
}

View File

@@ -116,7 +116,7 @@ namespace AyaNova.Biz
{
//OPSMETRIC
await JobsBiz.LogJobAsync(j.GId, "LT:JobFailed LT:TimedOut");
log.LogError($"Job found job stuck in running status and set to failed: deadline={dtRunningDeadline.ToString()}, jobId={j.GId.ToString()}, jobname={j.Name}, jobtype={j.JobType.ToString()}, jobObjectType={j.ObjectType.ToString()}, jobObjectId={j.ObjectId.ToString()}");
log.LogError($"Job found job stuck in running status and set to failed: deadline={dtRunningDeadline.ToString()}, jobId={j.GId.ToString()}, jobname={j.Name}, jobtype={j.JobType.ToString()}, jobAType={j.AType.ToString()}, jobObjectId={j.ObjectId.ToString()}");
await JobsBiz.UpdateJobStatusAsync(j.GId, JobStatus.Failed);
}
}

View File

@@ -13,6 +13,6 @@ namespace AyaNova.Models
REQUEST
BASE: DataListKey, ClientCriteria, FilterId
TABLEVERSION: Limit, Offset : base
REPORT/BULK OPS VERSION: ObjectType(ayatype),SelectedRowIds(long[]) : base
REPORT/BULK OPS VERSION: AType(ayatype),SelectedRowIds(long[]) : base
*/
}

View File

@@ -5,7 +5,7 @@ namespace AyaNova.Models
//handles posts from client
public class DataListSelectedRequest : DataListRequestBase
{
public AyaType ObjectType { get; set; }
public AyaType AType { get; set; }
public long[] SelectedRowIds { get; set; }
}

View File

@@ -21,7 +21,7 @@ namespace AyaNova.Models
[Required]
public long AttachToObjectId { get; set; }
[Required]
public AyaType AttachToObjectType { get; set; }//int
public AyaType AttachToAType { get; set; }//int
[Required]
public string StoredFileName { get; set; }
[Required]

View File

@@ -30,7 +30,7 @@ namespace AyaNova.Models
public JobType JobType { get; set; }
public JobSubType SubType { get; set; }
public long ObjectId { get; set; }
public AyaType ObjectType { get; set; }
public AyaType AType { get; set; }
[Required]
public JobStatus JobStatus { get; set; }
@@ -50,7 +50,7 @@ namespace AyaNova.Models
JobType = JobType.NotSet;
SubType = JobSubType.NotSet;
ObjectId = 0;
ObjectType = AyaType.NoType;
AType = AyaType.NoType;
JobStatus = JobStatus.Sleeping;
JobInfo = null;

View File

@@ -16,7 +16,7 @@ namespace AyaNova.Models
public string Notes { get; set; }
public AuthorizationRoles Roles { get; set; }
[Required]
public AyaType ObjectType { get; set; }
public AyaType AType { get; set; }
public string Template { get; set; }
@@ -47,7 +47,7 @@ namespace AyaNova.Models
public Report()
{
RenderType = ReportRenderType.PDF;
ObjectType = AyaType.NoType;
AType = AyaType.NoType;
Roles = AuthorizationRoles.All;
Active = true;
//these are pdf option defaults as per PuppeteerSharp

View File

@@ -39,7 +39,7 @@ namespace AyaNova.Models
[Required]
public long ObjectId { get; set; }
[Required]
public AyaType ObjectType { get; set; }//int
public AyaType AType { get; set; }//int
[NotMapped]
public bool OverDue

View File

@@ -16,7 +16,7 @@ namespace AyaNova.Models
[Required]
public long ObjectId { get; set; }
[Required]
public AyaType ObjectType { get; set; }
public AyaType AType { get; set; }

View File

@@ -24,7 +24,7 @@ namespace AyaNova.Models
[Required]
public long ObjectId { get; set; }
[Required]
public AyaType ObjectType { get; set; }
public AyaType AType { get; set; }
[Required]
public long SourceId { get; set; }
[Required]
@@ -71,7 +71,7 @@ namespace AyaNova.Models
[Required]
public long ObjectId { get; set; }
[Required]
public AyaType ObjectType { get; set; }
public AyaType AType { get; set; }
[Required]
public long SourceId { get; set; }
[Required]

View File

@@ -1 +1 @@
{"Name":"EXAMPLE API use and meta data","Active":true,"Notes":"","Roles":124927,"ObjectType":2,"Template":"<html>\n\n<body>\n\t<h2>Example: Meta data and API usage</h2>\n\t<p>See help documentation for details</p>\n\t\n\t<div>\n\t\t<h4>ayServerMetaData</h4>\n\t\t{{ ayJSON ayServerMetaData }}\n\t</div>\n\n\t<div>\n\t\t<h4>ayClientMetaData</h4>\n\t\t{{ ayJSON ayClientMetaData }}\n\t</div>\n\n\t<div>\n\t\t<h4>ayReportMetaData</h4>\n\t\t{{ ayJSON ayReportMetaData }}\n\t</div>\n\n\n\t<div>\n\t\t<h4>myData</h4>\n\t\t<h5>(Fetched dynamically from API route <strong>enum-list/list/AyaType</strong>)</h5>\n\t\t{{ ayJSON myData }}\n\t</div>\n\n\t<div>\n\t\t<h4>ayReportData</h4>\n\t\t{{#each ayReportData}}\n\t\t<h2>{{ Name }}</h2>\n\t\t<div>Notes: <span class=\"example\">{{ Notes }}</span></div>\n\t\t{{/each}}\n\t</div>\n</body>\n\n</html>","Style":".example {\n color: blue;\n}","JsPrerender":"async function ayPrepareData(reportData) {\n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders \n\n //Example of using API GET method to fetch data from API server and make it available to the report template\n\n //Put the data into the main report data object so it's available to the template\n reportData.myData={ServerInfo:await ayGetFromAPI(\"server-info\")};\n\n //Example API POST method to fetch data from api server\n let searchPostData={phrase: \"Fresh\"};\n reportData.myData.SearchResults=await ayPostToAPI(\"search\", searchPostData);\n\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})","RenderType":0}
{"Name":"EXAMPLE API use and meta data","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"<html>\n\n<body>\n\t<h2>Example: Meta data and API usage</h2>\n\t<p>See help documentation for details</p>\n\t\n\t<div>\n\t\t<h4>ayServerMetaData</h4>\n\t\t{{ ayJSON ayServerMetaData }}\n\t</div>\n\n\t<div>\n\t\t<h4>ayClientMetaData</h4>\n\t\t{{ ayJSON ayClientMetaData }}\n\t</div>\n\n\t<div>\n\t\t<h4>ayReportMetaData</h4>\n\t\t{{ ayJSON ayReportMetaData }}\n\t</div>\n\n\n\t<div>\n\t\t<h4>myData</h4>\n\t\t<h5>(Fetched dynamically from API route <strong>enum-list/list/AyaType</strong>)</h5>\n\t\t{{ ayJSON myData }}\n\t</div>\n\n\t<div>\n\t\t<h4>ayReportData</h4>\n\t\t{{#each ayReportData}}\n\t\t<h2>{{ Name }}</h2>\n\t\t<div>Notes: <span class=\"example\">{{ Notes }}</span></div>\n\t\t{{/each}}\n\t</div>\n</body>\n\n</html>","Style":".example {\n color: blue;\n}","JsPrerender":"async function ayPrepareData(reportData) {\n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders \n\n //Example of using API GET method to fetch data from API server and make it available to the report template\n\n //Put the data into the main report data object so it's available to the template\n reportData.myData={ServerInfo:await ayGetFromAPI(\"server-info\")};\n\n //Example API POST method to fetch data from api server\n let searchPostData={phrase: \"Fresh\"};\n reportData.myData.SearchResults=await ayPostToAPI(\"search\", searchPostData);\n\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})","RenderType":0}

View File

@@ -1 +1 @@
{"Name":"EXAMPLE Bar code helper","Active":true,"Notes":"","Roles":124927,"ObjectType":2,"Template":"<html>\n\n<body>\n\t<h2>Example: Bar code helper </h2>\n\t<p>See Report editor help documentation for details</p>\n\n\t{{#each ayReportData}}\n\t<h2>{{ Name }}</h2>\n\t<div>\n\t\tSerial as \"CODE-128\" BarCode:<br/>\n\t\t{{ ayBC Serial '{ \"bcid\": \"code128\",\"includetext\":true, \"scale\":1}' }}\n\t</div>\n\t<br/>\n\t<div>\n\t\tSerial as \"QR\" Code:<br/>\n\t\t{{ ayBC Serial '{ \"bcid\": \"qrcode\",\"includetext\":true, \"scale\":3}' }}\n\t</div>\n\t<br/>\n\t<div>\n\t\tSample \"UPC-A\" Code (Serial wouldn't be a valid UPC code so hard coded here):<br/>\n\t\t{{ ayBC \"712345678904\" '{ \"bcid\": \"upca\",\"includetext\":true, \"scale\":1}' }}\n\t</div>\n\t<br/>\n\t<br/>\n\t<hr/>\n\t{{/each}}\n</body>\n\n</html>","Style":".example {\n color: blue;\n}","JsPrerender":"async function ayPrepareData(reportData){ \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})","RenderType":0}
{"Name":"EXAMPLE Bar code helper","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"<html>\n\n<body>\n\t<h2>Example: Bar code helper </h2>\n\t<p>See Report editor help documentation for details</p>\n\n\t{{#each ayReportData}}\n\t<h2>{{ Name }}</h2>\n\t<div>\n\t\tSerial as \"CODE-128\" BarCode:<br/>\n\t\t{{ ayBC Serial '{ \"bcid\": \"code128\",\"includetext\":true, \"scale\":1}' }}\n\t</div>\n\t<br/>\n\t<div>\n\t\tSerial as \"QR\" Code:<br/>\n\t\t{{ ayBC Serial '{ \"bcid\": \"qrcode\",\"includetext\":true, \"scale\":3}' }}\n\t</div>\n\t<br/>\n\t<div>\n\t\tSample \"UPC-A\" Code (Serial wouldn't be a valid UPC code so hard coded here):<br/>\n\t\t{{ ayBC \"712345678904\" '{ \"bcid\": \"upca\",\"includetext\":true, \"scale\":1}' }}\n\t</div>\n\t<br/>\n\t<br/>\n\t<hr/>\n\t{{/each}}\n</body>\n\n</html>","Style":".example {\n color: blue;\n}","JsPrerender":"async function ayPrepareData(reportData){ \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})","RenderType":0}

View File

@@ -1 +1 @@
{"Name":"EXAMPLE Logo helper","Active":true,"Notes":"","Roles":124927,"ObjectType":2,"Template":"<html>\n\n<body>\n\t<h2>Example: LOGO </h2>\n\t<p>See Report editor help documentation for details</p>\n\t<p>Note: you must upload a logo via the Global Settings form in order to see them here</p>\n\n\t<h4>Small logo</h4>\n\t{{ ayLogo \"small\" }}\n\n\t<h4>Medium logo</h4>\n\t{{ ayLogo \"medium\" }}\n\n\t<h4>Large logo</h4>\n\t{{ ayLogo \"large\" }}\n\n\n\t{{#each ayReportData}}\n\t<h2>{{ Name }}</h2>\n\t<div>Notes: <span class='example'>{{ Notes }}</span></div>\n\t{{/each}}\n</body>\n\n</html>","Style":".example {\n color: blue;\n}","JsPrerender":"async function ayPrepareData(reportData){ \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})","RenderType":0}
{"Name":"EXAMPLE Logo helper","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"<html>\n\n<body>\n\t<h2>Example: LOGO </h2>\n\t<p>See Report editor help documentation for details</p>\n\t<p>Note: you must upload a logo via the Global Settings form in order to see them here</p>\n\n\t<h4>Small logo</h4>\n\t{{ ayLogo \"small\" }}\n\n\t<h4>Medium logo</h4>\n\t{{ ayLogo \"medium\" }}\n\n\t<h4>Large logo</h4>\n\t{{ ayLogo \"large\" }}\n\n\n\t{{#each ayReportData}}\n\t<h2>{{ Name }}</h2>\n\t<div>Notes: <span class='example'>{{ Notes }}</span></div>\n\t{{/each}}\n</body>\n\n</html>","Style":".example {\n color: blue;\n}","JsPrerender":"async function ayPrepareData(reportData){ \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})","RenderType":0}

View File

@@ -1 +1 @@
{"Name":"EXAMPLE PDF Options page number","Active":true,"Notes":"","Roles":124927,"ObjectType":2,"Template":"<html>\n\n<body>\n\t{{#each ayReportData}}\n\t<h2>{{ Name }}</h2>\n\t<div>Notes: <span class='example'>{{ Notes }}</span></div>\n\t{{/each}}\n</body>\n\n</html>","Style":"","JsPrerender":"","JsHelpers":"","RenderType":0,"HeaderTemplate":" <span style=\"font-size:12px;color:blue; \">&nbsp;Header: Page&nbsp;<span class=\"pageNumber\"></span>&nbsp;of&nbsp;<span class=\"totalPages\"></span></span>","FooterTemplate":" <span style=\"font-size:12px;color:green; \">&nbsp;Footer: Page&nbsp;<span class=\"pageNumber\"></span>&nbsp;of&nbsp;<span class=\"totalPages\"></span></span>","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"40px","MarginOptionsLeft":"40px","MarginOptionsRight":"40px","MarginOptionsTop":"40px","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.0000}
{"Name":"EXAMPLE PDF Options page number","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"<html>\n\n<body>\n\t{{#each ayReportData}}\n\t<h2>{{ Name }}</h2>\n\t<div>Notes: <span class='example'>{{ Notes }}</span></div>\n\t{{/each}}\n</body>\n\n</html>","Style":"","JsPrerender":"","JsHelpers":"","RenderType":0,"HeaderTemplate":" <span style=\"font-size:12px;color:blue; \">&nbsp;Header: Page&nbsp;<span class=\"pageNumber\"></span>&nbsp;of&nbsp;<span class=\"totalPages\"></span></span>","FooterTemplate":" <span style=\"font-size:12px;color:green; \">&nbsp;Footer: Page&nbsp;<span class=\"pageNumber\"></span>&nbsp;of&nbsp;<span class=\"totalPages\"></span></span>","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"40px","MarginOptionsLeft":"40px","MarginOptionsRight":"40px","MarginOptionsTop":"40px","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.0000}

View File

@@ -1 +1 @@
{"Name":"EXAMPLE Translation helper","Active":true,"Notes":"","Roles":124927,"ObjectType":2,"Template":"<html>\n\n<body>\n\n\t<h2>Example: Translation helper </h2>\n\t<p>See Report editor help documentation for details</p>\n\n\t<div>\n\t\t<h4>ayReportData</h4>\n\t\t{{#each ayReportData}}\n\t\t<h2>{{ayT 'WidgetName' }}: {{ Name }}</h2>\n\t\t<div>{{ayT 'WidgetSerial' }}:{{ Serial }}</div>\n\t\t<div>{{ayT 'WidgetDollarAmount' }}:{{ DollarAmount }}</div>\n\t\t<div>{{ayT 'WidgetStartDate' }}:{{ StartDate }}</div>\n\t\t<div>{{ayT 'WidgetNotes' }}:{{ Notes }}</div>\n\t\t{{/each}}\n\t</div>\n</body>\n\n</html>","Style":".example {\n color: blue;\n}","JsPrerender":"async function ayPrepareData(reportData) {\n //Fetch translation keys required for report \n //Server will get the translations that match the current logged in user's language\n //Only translation keys pre-fetched here will be available for use with the ayT translation helper\n\n //NOTE: you *must* await the call to ayGetTranslations or they will not be present for the report template use\n\n await ayGetTranslations([\n \"Widget\",\n \"WidgetName\",\n \"WidgetSerial\",\n \"WidgetDollarAmount\",\n \"WidgetCount\",\n \"WidgetStartDate\",\n \"WidgetEndDate\",\n \"WidgetNotes\",\n \"WidgetCustom1\",\n \"WidgetCustom2\",\n \"WidgetCustom3\",\n \"WidgetCustom4\",\n \"WidgetCustom5\",\n \"WidgetCustom6\",\n \"WidgetCustom7\",\n \"WidgetCustom8\",\n \"WidgetCustom9\",\n \"WidgetCustom10\",\n \"WidgetCustom11\",\n \"WidgetCustom12\",\n \"WidgetCustom13\",\n \"WidgetCustom14\",\n \"WidgetCustom15\",\n \"WidgetCustom16\",\n ]);\n\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})","RenderType":0}
{"Name":"EXAMPLE Translation helper","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"<html>\n\n<body>\n\n\t<h2>Example: Translation helper </h2>\n\t<p>See Report editor help documentation for details</p>\n\n\t<div>\n\t\t<h4>ayReportData</h4>\n\t\t{{#each ayReportData}}\n\t\t<h2>{{ayT 'WidgetName' }}: {{ Name }}</h2>\n\t\t<div>{{ayT 'WidgetSerial' }}:{{ Serial }}</div>\n\t\t<div>{{ayT 'WidgetDollarAmount' }}:{{ DollarAmount }}</div>\n\t\t<div>{{ayT 'WidgetStartDate' }}:{{ StartDate }}</div>\n\t\t<div>{{ayT 'WidgetNotes' }}:{{ Notes }}</div>\n\t\t{{/each}}\n\t</div>\n</body>\n\n</html>","Style":".example {\n color: blue;\n}","JsPrerender":"async function ayPrepareData(reportData) {\n //Fetch translation keys required for report \n //Server will get the translations that match the current logged in user's language\n //Only translation keys pre-fetched here will be available for use with the ayT translation helper\n\n //NOTE: you *must* await the call to ayGetTranslations or they will not be present for the report template use\n\n await ayGetTranslations([\n \"Widget\",\n \"WidgetName\",\n \"WidgetSerial\",\n \"WidgetDollarAmount\",\n \"WidgetCount\",\n \"WidgetStartDate\",\n \"WidgetEndDate\",\n \"WidgetNotes\",\n \"WidgetCustom1\",\n \"WidgetCustom2\",\n \"WidgetCustom3\",\n \"WidgetCustom4\",\n \"WidgetCustom5\",\n \"WidgetCustom6\",\n \"WidgetCustom7\",\n \"WidgetCustom8\",\n \"WidgetCustom9\",\n \"WidgetCustom10\",\n \"WidgetCustom11\",\n \"WidgetCustom12\",\n \"WidgetCustom13\",\n \"WidgetCustom14\",\n \"WidgetCustom15\",\n \"WidgetCustom16\",\n ]);\n\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})","RenderType":0}

View File

@@ -1 +1 @@
{"Name":"EXAMPLE WIKI helper","Active":true,"Notes":"","Roles":124927,"ObjectType":2,"Template":"<html>\n\n<body>\n\t<h2>Example: WIKI / markdown field usage </h2>\n\t<p>See help documentation for details</p>\n\n\t{{#each ayReportData}}\n\t<h1>Object name:</h1>\n\t{{ Name }}\n\t<h1>Object WIKI:</h1>\n\t{{ ayWiki Wiki }}\n\t{{/each}}\n</body>\n\n</html>","Style":"","JsPrerender":"async function ayPrepareData(reportData){ \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\n","RenderType":0}
{"Name":"EXAMPLE WIKI helper","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"<html>\n\n<body>\n\t<h2>Example: WIKI / markdown field usage </h2>\n\t<p>See help documentation for details</p>\n\n\t{{#each ayReportData}}\n\t<h1>Object name:</h1>\n\t{{ Name }}\n\t<h1>Object WIKI:</h1>\n\t{{ ayWiki Wiki }}\n\t{{/each}}\n</body>\n\n</html>","Style":"","JsPrerender":"async function ayPrepareData(reportData){ \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\n","RenderType":0}

View File

@@ -1 +1 @@
{"Name":"EXAMPLE custom fields","Active":true,"Notes":"","Roles":124927,"ObjectType":2,"Template":"<html>\n\n<body>\n\t<h2>Example: custom fields usage </h2>\n\t<p>See help documentation for details</p>\n\n\t<div>\n\t\t{{#each ayReportData}}\n\n\t\t<h2>Non custom fields </h2>\n\t\tName: {{ Name }} <br/>\n\t\tDollarAmount as Number: {{ ayDecimal DollarAmount}} <br/>\n\n\t\t<h2>Custom fields </h2>\n\t\t<p>Custom field items can be accessed via the main object's CustomFields property and then by dot notation for each of the 16 possible custom fields as .c1 to .c16 \n\t\tIf a custom field is unused it will return a blank for that item.\n\t\t(note, example assumes generated sample data and that c1 and c5 have data)</p>\n\t\tCustom c1 as DateTime: {{ ayDateTime CustomFields.c1}} <br/>\n\t\tcustom c5 as Number: {{ ayDecimal CustomFields.c5}} <br/>\t\n\t\t<hr />\n\t\t{{/each}}\n\t</div>\n</body>\n\n</html>","Style":"","JsPrerender":"async function ayPrepareData(reportData){ \n return reportData;\n}","JsHelpers":"","RenderType":0}
{"Name":"EXAMPLE custom fields","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"<html>\n\n<body>\n\t<h2>Example: custom fields usage </h2>\n\t<p>See help documentation for details</p>\n\n\t<div>\n\t\t{{#each ayReportData}}\n\n\t\t<h2>Non custom fields </h2>\n\t\tName: {{ Name }} <br/>\n\t\tDollarAmount as Number: {{ ayDecimal DollarAmount}} <br/>\n\n\t\t<h2>Custom fields </h2>\n\t\t<p>Custom field items can be accessed via the main object's CustomFields property and then by dot notation for each of the 16 possible custom fields as .c1 to .c16 \n\t\tIf a custom field is unused it will return a blank for that item.\n\t\t(note, example assumes generated sample data and that c1 and c5 have data)</p>\n\t\tCustom c1 as DateTime: {{ ayDateTime CustomFields.c1}} <br/>\n\t\tcustom c5 as Number: {{ ayDecimal CustomFields.c5}} <br/>\t\n\t\t<hr />\n\t\t{{/each}}\n\t</div>\n</body>\n\n</html>","Style":"","JsPrerender":"async function ayPrepareData(reportData){ \n return reportData;\n}","JsHelpers":"","RenderType":0}

View File

@@ -1 +1 @@
{"Name":"EXAMPLE localization helpers","Active":true,"Notes":"","Roles":124927,"ObjectType":2,"Template":"<html>\n\n<body>\n\t<h2>Example: Localization helpers </h2>\n\t<p>See help documentation for details</p>\n\n\t<div>\n\t\t<h3>Client locale settings used</h3>\n\t\tBrowser TimeZone: {{ ayClientMetaData.TimeZoneName }}<br/>\n\t\tBrowser LanguageName: {{ ayClientMetaData.LanguageName }}<br/>\n\t\tHour12: {{ ayClientMetaData.Hour12 }}<br/>\n\t\tCurrencyName: {{ ayClientMetaData.CurrencyName }}<br/>\n\t</div>\n\t<div>\n\t\t{{#each ayReportData}}\n\t\t<h2>Name: {{ Name }}</h2>\n\t\tStartDate as DateTime: {{ ayDateTime StartDate}} <br/>\n\t\tStartDate as Date : {{ ayDate StartDate}} <br/>\n\t\tStartDate as Time: {{ ayTime StartDate}} <br/>\n\t\tDollarAmount as Currency: {{ ayCurrency DollarAmount}} <br/>\n\t\tDollarAmount as Number: {{ ayDecimal DollarAmount}} <br/>\n\t\t<hr />\n\t\t{{/each}}\n\t</div>\n</body>\n\n</html>","Style":".example {\n color: blue;\n}","JsPrerender":"async function ayPrepareData(reportData){ \n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})","RenderType":0}
{"Name":"EXAMPLE localization helpers","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"<html>\n\n<body>\n\t<h2>Example: Localization helpers </h2>\n\t<p>See help documentation for details</p>\n\n\t<div>\n\t\t<h3>Client locale settings used</h3>\n\t\tBrowser TimeZone: {{ ayClientMetaData.TimeZoneName }}<br/>\n\t\tBrowser LanguageName: {{ ayClientMetaData.LanguageName }}<br/>\n\t\tHour12: {{ ayClientMetaData.Hour12 }}<br/>\n\t\tCurrencyName: {{ ayClientMetaData.CurrencyName }}<br/>\n\t</div>\n\t<div>\n\t\t{{#each ayReportData}}\n\t\t<h2>Name: {{ Name }}</h2>\n\t\tStartDate as DateTime: {{ ayDateTime StartDate}} <br/>\n\t\tStartDate as Date : {{ ayDate StartDate}} <br/>\n\t\tStartDate as Time: {{ ayTime StartDate}} <br/>\n\t\tDollarAmount as Currency: {{ ayCurrency DollarAmount}} <br/>\n\t\tDollarAmount as Number: {{ ayDecimal DollarAmount}} <br/>\n\t\t<hr />\n\t\t{{/each}}\n\t</div>\n</body>\n\n</html>","Style":".example {\n color: blue;\n}","JsPrerender":"async function ayPrepareData(reportData){ \n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})","RenderType":0}

View File

@@ -1 +1 @@
{"Name":"EXAMPLE modify data before rendering","Active":true,"Notes":"","Roles":124927,"ObjectType":2,"Template":"<html>\n\n<body>\n\t{{#each ayReportData}}\n\tName: {{ Name }}, DollarAmount: {{ ayCurrency DollarAmount }}, RunningTotal: {{ ayCurrency MyRunningTotal }} <br/>\n\t{{/each}}\n\n\t<h2>Total dollar amount: {{ ayCurrency MyTotalDollarAmount }}\n</body>\n\n</html>","Style":"","JsPrerender":"async function ayPrepareData(reportData) {\n //Example of both manipulating the reportData before rendering the report (by adding a running total field)\n //and adding a field to the overall data calculating the total dollar amount for all records\n\n //Declare a temporary variable to hold the running total\n let TotalDollarAmount = 0;\n\n //Iterate through all the records in the reportData\n //adding the dollar amount of each item to the TotalDollarAmount variable\n for (MyItem of reportData.ayReportData) {\n\n //make sure it has a value before attempting to add it to the running total\n if (MyItem.DollarAmount != null) {\n TotalDollarAmount += MyItem.DollarAmount;\n }\n\n //add a new key to each record in the reportData object named \"MyRunningTotal\" with the running total so far\n MyItem.MyRunningTotal=TotalDollarAmount;\n }\n\n //Add the TotalDollarAmount variable to the reportData so it can be \n //accessed in the report template\n reportData.MyTotalDollarAmount=TotalDollarAmount;\n\n return reportData;\n}","JsHelpers":"","RenderType":0}
{"Name":"EXAMPLE modify data before rendering","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"<html>\n\n<body>\n\t{{#each ayReportData}}\n\tName: {{ Name }}, DollarAmount: {{ ayCurrency DollarAmount }}, RunningTotal: {{ ayCurrency MyRunningTotal }} <br/>\n\t{{/each}}\n\n\t<h2>Total dollar amount: {{ ayCurrency MyTotalDollarAmount }}\n</body>\n\n</html>","Style":"","JsPrerender":"async function ayPrepareData(reportData) {\n //Example of both manipulating the reportData before rendering the report (by adding a running total field)\n //and adding a field to the overall data calculating the total dollar amount for all records\n\n //Declare a temporary variable to hold the running total\n let TotalDollarAmount = 0;\n\n //Iterate through all the records in the reportData\n //adding the dollar amount of each item to the TotalDollarAmount variable\n for (MyItem of reportData.ayReportData) {\n\n //make sure it has a value before attempting to add it to the running total\n if (MyItem.DollarAmount != null) {\n TotalDollarAmount += MyItem.DollarAmount;\n }\n\n //add a new key to each record in the reportData object named \"MyRunningTotal\" with the running total so far\n MyItem.MyRunningTotal=TotalDollarAmount;\n }\n\n //Add the TotalDollarAmount variable to the reportData so it can be \n //accessed in the report template\n reportData.MyTotalDollarAmount=TotalDollarAmount;\n\n return reportData;\n}","JsHelpers":"","RenderType":0}

Some files were not shown because too many files have changed in this diff Show More