This commit is contained in:
@@ -16,7 +16,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
[Route("api/v{version:apiVersion}/customer-note")]
|
[Route("api/v{version:apiVersion}/customer-note")]
|
||||||
[Produces("application/json")]
|
[Produces("application/json")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public class CustomerNoteController : controllerbase
|
public class CustomerNoteController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly AyContext ct;
|
private readonly AyContext ct;
|
||||||
private readonly ILogger<CustomerNoteController> log;
|
private readonly ILogger<CustomerNoteController> log;
|
||||||
|
|||||||
69
server/AyaNova/DataList/CustomerNoteDataList.cs
Normal file
69
server/AyaNova/DataList/CustomerNoteDataList.cs
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using AyaNova.Biz;
|
||||||
|
namespace AyaNova.DataList
|
||||||
|
{
|
||||||
|
internal class CustomerNoteDataList : AyaDataList
|
||||||
|
{
|
||||||
|
public CustomerNoteDataList()
|
||||||
|
{
|
||||||
|
DefaultListObjectType = AyaType.CustomerNote;
|
||||||
|
SQLFrom = "from acustomernote left outer join auser on (acustomernote.userid=auser.id)";
|
||||||
|
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
|
||||||
|
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||||
|
|
||||||
|
//######## DEFAULT VIEW WHEN NO VIEW CHOSEN ############
|
||||||
|
//Default ListView
|
||||||
|
dynamic dlistView = new JArray();
|
||||||
|
|
||||||
|
|
||||||
|
dynamic cm = new JObject();
|
||||||
|
cm.fld = "notedate";
|
||||||
|
dlistView.Add(cm);
|
||||||
|
|
||||||
|
cm = new JObject();
|
||||||
|
cm.fld = "notes";
|
||||||
|
dlistView.Add(cm);
|
||||||
|
|
||||||
|
cm = new JObject();
|
||||||
|
cm.fld = "username";
|
||||||
|
dlistView.Add(cm);
|
||||||
|
DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None);
|
||||||
|
|
||||||
|
|
||||||
|
//NOTE: Due to the join, all the sql id and name fields that can conflict with the joined table need to be specified completely
|
||||||
|
FieldDefinitions = new List<AyaDataListFieldDefinition>();
|
||||||
|
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "User",
|
||||||
|
FieldKey = "username",
|
||||||
|
AyaObjectType = (int)AyaType.User,
|
||||||
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||||
|
SqlIdColumnName = "auser.id",
|
||||||
|
SqlValueColumnName = "auser.name",
|
||||||
|
IsRowId=true
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "CustomerNoteNotes",
|
||||||
|
FieldKey = "notes",
|
||||||
|
AyaObjectType = (int)AyaType.CustomerNote,
|
||||||
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||||
|
SqlIdColumnName = "acustomernote.id",
|
||||||
|
SqlValueColumnName = "acustomernote.notes",
|
||||||
|
IsRowId = true
|
||||||
|
});
|
||||||
|
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "CustomerNoteNoteDate",
|
||||||
|
FieldKey = "notedate",
|
||||||
|
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||||
|
SqlValueColumnName = "acustomernote.notedate"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}//eoc
|
||||||
|
}//eons
|
||||||
Reference in New Issue
Block a user