This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
@@ -46,11 +47,7 @@ namespace AyaNova.Biz
|
||||
/// <summary>
|
||||
/// Get the event log for a specified object
|
||||
/// </summary>
|
||||
/// <param name="ayId"></param>
|
||||
/// <param name="userLocaleId"></param>
|
||||
/// <param name="ct"></param>
|
||||
/// <returns></returns>
|
||||
internal static async Task<string> GetLogForObject(long ayId, long userLocaleId, AyContext ct)
|
||||
internal static async Task<string> GetLogForObject(long ayId, DateTime StartDate, DateTime EndDate, AyContext ct)
|
||||
{
|
||||
var items = await ct.Event
|
||||
.Where(m => m.AyId == ayId)
|
||||
@@ -62,23 +59,10 @@ namespace AyaNova.Biz
|
||||
return "";
|
||||
}
|
||||
|
||||
AyaNova.Api.Controllers.LocaleController.LocaleSubsetParam param = new Api.Controllers.LocaleController.LocaleSubsetParam();
|
||||
param.LocaleId = userLocaleId;
|
||||
param.Keys.AddRange(new string[] { "CommonCreated", "Delete", "Modified", "Retrieved" });
|
||||
|
||||
|
||||
|
||||
//TODO: add all the keys from all the events in AyaEvent
|
||||
//Attachment, Created instead of AttachmentCreate, or is it attached?
|
||||
|
||||
var LT = await LocaleBiz.GetSubsetStatic(param);
|
||||
|
||||
//Have list of locales and list of ops, now make it into a readable text display and return it
|
||||
System.Text.StringBuilder SbReturn = new System.Text.StringBuilder();
|
||||
foreach (Event ev in items)
|
||||
{
|
||||
SbReturn.AppendLine(BuildLogEntry(ev, LT));
|
||||
}
|
||||
|
||||
return SbReturn.ToString();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -88,8 +72,24 @@ namespace AyaNova.Biz
|
||||
}
|
||||
|
||||
|
||||
internal static string BuildLogEntry(Event ev, List<KeyValuePair<string, string>> lt)
|
||||
|
||||
internal static string BuildLogEntry(bool userFormat, Event ev, List<KeyValuePair<string, string>> lt)
|
||||
{
|
||||
StringBuilder S=new StringBuilder();
|
||||
|
||||
//Object format:
|
||||
//DateTime, UserId, ActionNumber, Textra
|
||||
|
||||
//User format:
|
||||
//DateTime, ObjectType, ObjectId, ActionNumber, Textra
|
||||
|
||||
ev
|
||||
|
||||
switch(ev.AyEvent){
|
||||
case AyaEvent.Created:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return ":";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user