This commit is contained in:
81
server/DataList/AttachmentDataList.cs
Normal file
81
server/DataList/AttachmentDataList.cs
Normal file
@@ -0,0 +1,81 @@
|
||||
using System.Collections.Generic;
|
||||
using Sockeye.Biz;
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal class AttachmentDataList : DataListProcessingBase
|
||||
{
|
||||
public AttachmentDataList(long translationId)
|
||||
{
|
||||
DefaultListAType = SockType.FileAttachment;
|
||||
SQLFrom = "from afileattachment left join auser on (afileattachment.attachedByUserId=auser.id)";
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() { "displayfilename", "object", "size", "username", "notes", "exists" };
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "displayfilename", "+" }, { "size", "-" } };
|
||||
|
||||
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "FileAttachment",
|
||||
FieldKey = "displayfilename",
|
||||
SockType = (int)SockType.FileAttachment,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "afileattachment.id",
|
||||
SqlValueColumnName = "afileattachment.displayfilename",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "User",
|
||||
FieldKey = "username",
|
||||
SockType = (int)SockType.User,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "auser.id",
|
||||
SqlValueColumnName = "auser.name",
|
||||
IsRowId = false
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AttachmentExists",
|
||||
FieldKey = "exists",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "afileattachment.exists"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Object",
|
||||
FieldKey = "object",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "afileattachment.AttachToObjectid",
|
||||
SqlValueColumnName = $"AYGETNAME(afileattachment.AttachToObjectid, afileattachment.attachtosockType,{translationId})",
|
||||
SqlATypeColumnName = "afileattachment.attachtosockType",
|
||||
Translate = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "FileSize",
|
||||
FieldKey = "size",
|
||||
UiFieldDataType = (int)UiFieldDataType.MemorySize,
|
||||
SqlValueColumnName = "afileattachment.size"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AttachmentNotes",
|
||||
FieldKey = "notes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "afileattachment.notes"
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}//eoc
|
||||
}//eons
|
||||
326
server/DataList/CustomerDataList.cs
Normal file
326
server/DataList/CustomerDataList.cs
Normal file
@@ -0,0 +1,326 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Sockeye.Biz;
|
||||
using Sockeye.Models;
|
||||
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal class CustomerDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||
{
|
||||
public CustomerDataList(long translationId)
|
||||
{
|
||||
DefaultListAType = SockType.Customer;
|
||||
SQLFrom = @"FROM ACUSTOMER LEFT JOIN AHEADOFFICE ON (ACUSTOMER.HEADOFFICEID = AHEADOFFICE.ID)";
|
||||
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() { "customername", "customerphone1", "customeremail", "customerheadoffice" };
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "customername", "+" } };
|
||||
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "CustomerName",
|
||||
FieldKey = "customername",
|
||||
SockType = (int)SockType.Customer,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "acustomer.id",
|
||||
SqlValueColumnName = "acustomer.name",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "CustomerNotes",
|
||||
FieldKey = "customernotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "acustomer.notes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Active",
|
||||
FieldKey = "customeractive",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "acustomer.active"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "customertags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "acustomer.tags"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WebAddress",
|
||||
FieldKey = "customerwebaddress",
|
||||
UiFieldDataType = (int)UiFieldDataType.HTTP,
|
||||
SqlValueColumnName = "acustomer.webaddress"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "CustomerAlertNotes",
|
||||
FieldKey = "CustomerAlertNotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "acustomer.alertnotes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "HeadOffice",
|
||||
FieldKey = "customerheadoffice",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SockType = (int)SockType.HeadOffice,
|
||||
SqlIdColumnName = "aheadoffice.id",
|
||||
SqlValueColumnName = "aheadoffice.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "CustomerBillHeadOffice",
|
||||
FieldKey = "customerbillheadoffice",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "acustomer.billheadoffice"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "CustomerTechNotes",
|
||||
FieldKey = "customertechnotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "acustomer.technotes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "CustomerAccountNumber",
|
||||
FieldKey = "customeraccountnumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "acustomer.accountnumber"
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "CustomerPhone1",
|
||||
FieldKey = "customerphone1",
|
||||
UiFieldDataType = (int)UiFieldDataType.PhoneNumber,
|
||||
SqlValueColumnName = "acustomer.phone1"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "CustomerPhone2",
|
||||
FieldKey = "customerphone2",
|
||||
UiFieldDataType = (int)UiFieldDataType.PhoneNumber,
|
||||
SqlValueColumnName = "acustomer.phone2"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "CustomerPhone3",
|
||||
FieldKey = "customerphone3",
|
||||
UiFieldDataType = (int)UiFieldDataType.PhoneNumber,
|
||||
SqlValueColumnName = "acustomer.phone3"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "CustomerPhone4",
|
||||
FieldKey = "customerphone4",
|
||||
UiFieldDataType = (int)UiFieldDataType.PhoneNumber,
|
||||
SqlValueColumnName = "acustomer.phone4"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "CustomerPhone5",
|
||||
FieldKey = "customerphone5",
|
||||
UiFieldDataType = (int)UiFieldDataType.PhoneNumber,
|
||||
SqlValueColumnName = "acustomer.phone5"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "CustomerEmail",
|
||||
FieldKey = "customeremail",
|
||||
UiFieldDataType = (int)UiFieldDataType.EmailAddress,
|
||||
SqlValueColumnName = "acustomer.emailaddress"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalDeliveryAddress",
|
||||
FieldKey = "customerpostaddress",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "acustomer.postaddress"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalCity",
|
||||
FieldKey = "customerpostcity",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "acustomer.postcity"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalStateProv",
|
||||
FieldKey = "customerpostregion",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "acustomer.postregion"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalCountry",
|
||||
FieldKey = "customerpostcountry",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "acustomer.postcountry"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalPostal",
|
||||
FieldKey = "customerpostcode",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "acustomer.postcode"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressDeliveryAddress",
|
||||
FieldKey = "customeraddress",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "acustomer.address"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressCity",
|
||||
FieldKey = "customercity",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "acustomer.city"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressStateProv",
|
||||
FieldKey = "customerregion",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "acustomer.region"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressCountry",
|
||||
FieldKey = "customercountry",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "acustomer.country"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostal",
|
||||
FieldKey = "customeraddresspostal",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "acustomer.addresspostal"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressLatitude",
|
||||
FieldKey = "customerlatitude",
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlValueColumnName = "acustomer.latitude"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressLongitude",
|
||||
FieldKey = "customerlongitude",
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlValueColumnName = "acustomer.longitude"
|
||||
});
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom1", FieldKey = "customercustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom2", FieldKey = "customercustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom3", FieldKey = "customercustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom4", FieldKey = "customercustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom5", FieldKey = "customercustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom6", FieldKey = "customercustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom7", FieldKey = "customercustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom8", FieldKey = "customercustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom9", FieldKey = "customercustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom10", FieldKey = "customercustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom11", FieldKey = "customercustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom12", FieldKey = "customercustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom13", FieldKey = "customercustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom14", FieldKey = "customercustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom15", FieldKey = "customercustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom16", FieldKey = "customercustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
|
||||
|
||||
//META COLUMNS
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metaheadoffice",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "aheadoffice.id",
|
||||
SqlValueColumnName = "aheadoffice.id",
|
||||
IsMeta = true //"I'm So Meta Even This Acronym"
|
||||
});
|
||||
}
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, string clientCriteria)
|
||||
{
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
|
||||
//ClientCriteria format for this list is "OBJECTID,AYATYPE"
|
||||
var crit = (clientCriteria ?? "").Split(',').Select(z => z.Trim()).ToArray();
|
||||
if (crit.Length > 1)
|
||||
{
|
||||
//for now just show all customers of headoffice
|
||||
int nType = 0;
|
||||
if (!int.TryParse(crit[1], out nType)) return ret;
|
||||
SockType forType = (SockType)nType;
|
||||
if (forType != SockType.HeadOffice) return ret;
|
||||
|
||||
long lId = 0;
|
||||
if (!long.TryParse(crit[0], out lId)) return ret;
|
||||
if (lId == 0) return ret;
|
||||
|
||||
//Have valid type, have an id, so filter away
|
||||
switch (forType)
|
||||
{
|
||||
case SockType.HeadOffice:
|
||||
{
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metaheadoffice" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = crit[0], op = DataListFilterComparisonOperator.Equality });
|
||||
ret.Add(FilterOption);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
}//eoc
|
||||
}//eons
|
||||
87
server/DataList/CustomerNoteDataList.cs
Normal file
87
server/DataList/CustomerNoteDataList.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
using System.Collections.Generic;
|
||||
using Sockeye.Biz;
|
||||
using Sockeye.Models;
|
||||
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal class CustomerNoteDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||
{
|
||||
public CustomerNoteDataList(long translationId)
|
||||
{
|
||||
DefaultListAType = SockType.CustomerNote;
|
||||
SQLFrom = "from acustomernote left join auser on (acustomernote.userid=auser.id)";
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() { "notedate", "notes", "username" };
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "notedate", "-" } };
|
||||
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "User",
|
||||
FieldKey = "username",
|
||||
SockType = (int)SockType.User,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "auser.id",
|
||||
SqlValueColumnName = "auser.name",
|
||||
IsRowId = false
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "CustomerNoteNotes",
|
||||
FieldKey = "notes",
|
||||
SockType = (int)SockType.CustomerNote,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "acustomernote.id",
|
||||
SqlValueColumnName = "acustomernote.notes",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "CustomerNoteNoteDate",
|
||||
FieldKey = "notedate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "acustomernote.notedate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "customernotetags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "acustomernote.tags"
|
||||
});
|
||||
|
||||
//META column
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metacustomer",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "acustomernote.customerid",
|
||||
SqlValueColumnName = "acustomernote.customerid",
|
||||
IsMeta = true
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, string clientCriteria)
|
||||
{
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
//ClientCriteria MUST be CustomerId
|
||||
if (string.IsNullOrWhiteSpace(clientCriteria))
|
||||
throw new System.ArgumentNullException("CustomerNoteDataList - ClientCriteria is empty, should be Customer ID");
|
||||
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metacustomer" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = clientCriteria, op = DataListFilterComparisonOperator.Equality });
|
||||
|
||||
ret.Add(FilterOption);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
}//eoc
|
||||
}//eons
|
||||
75
server/DataList/CustomerNotificationDeliveryLogDataList.cs
Normal file
75
server/DataList/CustomerNotificationDeliveryLogDataList.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
using System.Collections.Generic;
|
||||
using Sockeye.Biz;
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal class CustomerNotificationDeliveryLogDataList : DataListProcessingBase
|
||||
{
|
||||
public CustomerNotificationDeliveryLogDataList(long translationId)
|
||||
{
|
||||
DefaultListAType = SockType.OpsNotificationSettings;
|
||||
SQLFrom = "from acustomernotifydeliverylog left join acustomernotifysubscription on acustomernotifysubscription.id = acustomernotifydeliverylog.customernotifysubscriptionid";
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() { "CustomerNotifySubscription", "Processed", "NotifyEventType", "CustomerTags", "Failed", "Errors" };
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "Processed", "-" } };
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "CustomerNotifySubscription",
|
||||
FieldKey = "CustomerNotifySubscription",
|
||||
SockType = (int)SockType.CustomerNotifySubscription,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "acustomernotifysubscription.id",
|
||||
SqlValueColumnName = "acustomernotifysubscription.id",
|
||||
IsRowId = false
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Processed",
|
||||
FieldKey = "Processed",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "acustomernotifydeliverylog.processed"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "NotifyEventType",
|
||||
FieldKey = "NotifyEventType",
|
||||
UiFieldDataType = (int)UiFieldDataType.Enum,
|
||||
EnumType = Sockeye.Util.StringUtil.TrimTypeName(typeof(NotifyEventType).ToString()),
|
||||
SqlValueColumnName = "acustomernotifysubscription.eventtype"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "CustomerTags",
|
||||
FieldKey = "CustomerTags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "acustomernotifysubscription.customertags"
|
||||
});
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Failed",
|
||||
FieldKey = "Failed",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "acustomernotifydeliverylog.fail"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Errors",
|
||||
FieldKey = "Errors",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "acustomernotifydeliverylog.error"
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
56
server/DataList/DataListFactory.cs
Normal file
56
server/DataList/DataListFactory.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal static class DataListFactory
|
||||
{
|
||||
|
||||
//Instantiate list object specified
|
||||
//this is safe as it's only attempting to load assemblies in the Sockeye.DataList namespace so can't attempt to instantiate some random object or nefarious object
|
||||
//returns null if doesn't exist
|
||||
internal static IDataListProcessing GetAyaDataList(string ListKey, long translationId)
|
||||
{
|
||||
System.Reflection.Assembly ass = System.Reflection.Assembly.GetEntryAssembly();
|
||||
return ass.CreateInstance($"Sockeye.DataList.{ListKey}", false, System.Reflection.BindingFlags.Default, null, new object[] { translationId }, null, null) as IDataListProcessing;
|
||||
|
||||
}
|
||||
|
||||
//List all the datalist types available
|
||||
internal static List<string> GetListOfAllDataListKeyNames()
|
||||
{
|
||||
//https://stackoverflow.com/a/42574373/8939
|
||||
|
||||
List<string> ret = new List<string>();
|
||||
System.Reflection.Assembly ass = System.Reflection.Assembly.GetEntryAssembly();
|
||||
|
||||
foreach (System.Reflection.TypeInfo ti in ass.DefinedTypes)
|
||||
{
|
||||
if (!ti.IsAbstract && ti.ImplementedInterfaces.Contains(typeof(IDataListProcessing)))
|
||||
{
|
||||
ret.Add(ti.Name);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
//Verify listkey
|
||||
internal static bool ListKeyIsValid(string listKey)
|
||||
{
|
||||
|
||||
System.Reflection.Assembly ass = System.Reflection.Assembly.GetEntryAssembly();
|
||||
|
||||
foreach (System.Reflection.TypeInfo ti in ass.DefinedTypes)
|
||||
{
|
||||
if (!ti.IsAbstract && ti.ImplementedInterfaces.Contains(typeof(IDataListProcessing)))
|
||||
{
|
||||
if (ti.Name == listKey)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}//eoc
|
||||
}//eons
|
||||
310
server/DataList/DataListFetcher.cs
Normal file
310
server/DataList/DataListFetcher.cs
Normal file
@@ -0,0 +1,310 @@
|
||||
//#define AYSHOWQUERYINFO
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Sockeye.Biz;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Sockeye.Models;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal static class DataListFetcher
|
||||
{
|
||||
|
||||
#if (AYSHOWQUERYINFO)
|
||||
#if (DEBUG)
|
||||
#warning FYI AYSHOWQUERYINFO is defined
|
||||
#else
|
||||
#error ### HOLDUP: AYSHOWQUERYINFO is defined in a RELEASE BUILD!!!!
|
||||
#endif
|
||||
#endif
|
||||
////////////////////////////////////////////////
|
||||
// Get the data list data requested
|
||||
//
|
||||
//
|
||||
internal static async Task<DataListReturnData> GetResponseAsync(AyContext ct, DataListTableProcessingOptions dataListTableProcessingOptions, IDataListProcessing DataList, AuthorizationRoles userRoles, ILogger log, long userId)
|
||||
{
|
||||
//#BUILD THE QUERY
|
||||
|
||||
//SELECT CLAUSE
|
||||
var qSelect = DataListSqlSelectBuilder.BuildForDataTableListResponse(DataList.FieldDefinitions, dataListTableProcessingOptions.AllUniqueColumnKeysReferenced);
|
||||
|
||||
//FROM CLAUSE
|
||||
var qFrom = DataList.SQLFrom;
|
||||
|
||||
var qWhere = string.Empty;
|
||||
var qOrderBy = string.Empty;
|
||||
|
||||
//WHERE CLAUSE - FILTER
|
||||
qWhere = DataListSqlFilterCriteriaBuilder.DataFilterToSQLCriteria(DataList.FieldDefinitions, dataListTableProcessingOptions);
|
||||
|
||||
//ORDER BY CLAUSE - SORT
|
||||
//BUILD ORDER BY
|
||||
qOrderBy = DataListSqlFilterOrderByBuilder.DataFilterToSQLOrderBy(DataList.FieldDefinitions, dataListTableProcessingOptions);
|
||||
|
||||
//LIMIT AND OFFSET CLAUSE - PAGING
|
||||
dataListTableProcessingOptions.Offset = dataListTableProcessingOptions.Offset ?? DataListTableProcessingOptions.DefaultOffset;
|
||||
dataListTableProcessingOptions.Limit = dataListTableProcessingOptions.Limit ?? DataListTableProcessingOptions.DefaultLimit;
|
||||
var qLimitOffset = $"LIMIT {dataListTableProcessingOptions.Limit} OFFSET {dataListTableProcessingOptions.Offset}";
|
||||
|
||||
//PUT IT ALL TOGETHER
|
||||
string qDataQuery = string.Empty;
|
||||
string qTotalRecordsQuery = string.Empty;
|
||||
|
||||
qDataQuery = $"{qSelect.Select} {qFrom} {qWhere} {qOrderBy} {qLimitOffset}".Replace(" ", " ");
|
||||
qTotalRecordsQuery = $"SELECT COUNT(*) {qFrom} {qWhere}".Replace(" ", " ");
|
||||
|
||||
//RETURN OBJECTS
|
||||
int returnRowColumnCount = dataListTableProcessingOptions.Columns.Count();
|
||||
List<List<DataListField>> rows = new List<List<DataListField>>();
|
||||
long totalRecordCount = 0;
|
||||
#if (DEBUG && AYSHOWQUERYINFO)
|
||||
System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch();
|
||||
|
||||
#endif
|
||||
|
||||
//QUERY THE DB
|
||||
using (var command = ct.Database.GetDbConnection().CreateCommand())
|
||||
{
|
||||
await ct.Database.OpenConnectionAsync();
|
||||
|
||||
//GET DATA RETURN ROWS
|
||||
command.CommandText = qDataQuery;
|
||||
try
|
||||
{
|
||||
#if (DEBUG && AYSHOWQUERYINFO)
|
||||
stopWatch.Start();
|
||||
#endif
|
||||
using (var dr = await command.ExecuteReaderAsync())
|
||||
{
|
||||
#if (DEBUG && AYSHOWQUERYINFO)
|
||||
stopWatch.Stop();
|
||||
log.LogInformation($"(debug) DataListFetcher:GetResponse DATA query took {stopWatch.ElapsedMilliseconds}ms to execute: {qDataQuery}");
|
||||
stopWatch.Reset();
|
||||
#endif
|
||||
while (dr.Read())
|
||||
{
|
||||
List<DataListField> row = new List<DataListField>(returnRowColumnCount);
|
||||
//INSERT REMAINING FIELDS FROM TEMPLATE INTO THE RETURN ROWS LIST
|
||||
foreach (string TemplateField in dataListTableProcessingOptions.Columns)
|
||||
{
|
||||
//get the AyaObjectFieldDefinition
|
||||
DataListFieldDefinition f = DataList.FieldDefinitions.FirstOrDefault(z => z.FieldKey == TemplateField);
|
||||
if (f == null)
|
||||
{
|
||||
|
||||
log.LogError($"DataListFetcher:GetResponseAsync Template field '{TemplateField}' was NOT found in the field definitions for data list {DataList.ToString()}");
|
||||
continue;
|
||||
}
|
||||
if (f.IsCustomField)
|
||||
{
|
||||
DataListField AyaField = new DataListField();
|
||||
//could be null
|
||||
var rawValue = dr.GetValue(qSelect.map[f.GetSqlValueColumnName()]);
|
||||
if (rawValue != null)
|
||||
{
|
||||
string cust = rawValue.ToString();
|
||||
if (!string.IsNullOrWhiteSpace(cust))
|
||||
{
|
||||
JObject j = JObject.Parse(cust);
|
||||
//convert field name to cust name then get value
|
||||
var InternalCustomFieldName = FormFieldOptionalCustomizableReference.TranslateLTCustomFieldToInternalCustomFieldName(TemplateField);
|
||||
//Sometimes a custom field is specified but doesn't exist in the collection so don't assume it's there
|
||||
JToken o = j[InternalCustomFieldName];
|
||||
if (o != null)
|
||||
AyaField.v = o.Value<object>();
|
||||
else
|
||||
AyaField.v = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
AyaField.v = null;
|
||||
}
|
||||
}
|
||||
row.Add(AyaField);
|
||||
}
|
||||
else
|
||||
{
|
||||
DataListField AyaField = new DataListField();
|
||||
AyaField.v = dr.GetValue(qSelect.map[f.GetSqlValueColumnName()]);
|
||||
|
||||
if (f.IsRowId)
|
||||
{
|
||||
AyaField.rid = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
AyaField.rid = null;
|
||||
}
|
||||
|
||||
if (f.SqlIdColumnName != null)
|
||||
{
|
||||
var ordinal = qSelect.map[f.SqlIdColumnName];
|
||||
if (!await dr.IsDBNullAsync(ordinal))
|
||||
AyaField.i = dr.GetInt64(ordinal);
|
||||
}
|
||||
|
||||
if (f.SqlATypeColumnName != null)
|
||||
{
|
||||
var ordinal = qSelect.map[f.SqlATypeColumnName];
|
||||
if (!await dr.IsDBNullAsync(ordinal))
|
||||
AyaField.ot = dr.GetInt32(ordinal);
|
||||
}
|
||||
|
||||
if (f.SqlColorColumnName != null)
|
||||
{
|
||||
var ordinal = qSelect.map[f.SqlColorColumnName];
|
||||
if (!await dr.IsDBNullAsync(ordinal))
|
||||
AyaField.clr = dr.GetString(ordinal);
|
||||
}
|
||||
|
||||
row.Add(AyaField);
|
||||
}
|
||||
}
|
||||
rows.Add(row);
|
||||
}
|
||||
}
|
||||
|
||||
//GET TOTAL RECORD COUNT
|
||||
command.CommandText = qTotalRecordsQuery;
|
||||
#if (DEBUG && AYSHOWQUERYINFO)
|
||||
stopWatch.Start();
|
||||
#endif
|
||||
using (var dr = await command.ExecuteReaderAsync())
|
||||
{
|
||||
#if (DEBUG && AYSHOWQUERYINFO)
|
||||
stopWatch.Stop();
|
||||
log.LogInformation($"(debug) DataListFetcher:GetResponse COUNT query took {stopWatch.ElapsedMilliseconds}ms to execute: {qTotalRecordsQuery}");
|
||||
#endif
|
||||
if (dr.Read())
|
||||
{
|
||||
totalRecordCount = dr.GetInt64(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Npgsql.PostgresException e)
|
||||
{
|
||||
//log out the exception and the query
|
||||
log.LogError("DataListFetcher:GetResponseAsync query failed. Data Query was:");
|
||||
log.LogError(qDataQuery);
|
||||
log.LogError("Count Query was:");
|
||||
log.LogError(qTotalRecordsQuery);
|
||||
log.LogError(e, "DB Exception");
|
||||
throw new System.Exception("DataListFetcher:GetResponseAsync - Query failed see log");
|
||||
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
//ensure any other type of exception gets surfaced properly
|
||||
//log out the exception and the query
|
||||
log.LogError("DataListFetcher:GetResponseAsync unexpected failure. Data Query was:");
|
||||
log.LogError(qDataQuery);
|
||||
log.LogError("Count Query was:");
|
||||
log.LogError(qTotalRecordsQuery);
|
||||
log.LogError(e, "Exception");
|
||||
throw new System.Exception("DataListFetcher:GetResponseAsync - unexpected failure see log");
|
||||
}
|
||||
}
|
||||
|
||||
//BUILD THE COLUMNS RETURN PROPERTY JSON FRAGMENT
|
||||
Newtonsoft.Json.Linq.JArray ColumnsJSON = null;
|
||||
ColumnsJSON = DataList.GenerateReturnListColumns(dataListTableProcessingOptions.Columns);
|
||||
return new DataListReturnData(rows,
|
||||
totalRecordCount,
|
||||
ColumnsJSON,
|
||||
dataListTableProcessingOptions.SortBy,
|
||||
dataListTableProcessingOptions.Filter.Where(z => z.Column.StartsWith("meta") == false).ToList(),
|
||||
dataListTableProcessingOptions.HiddenAffectiveColumns);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// Get a list of id's of the datalist results for reporting
|
||||
// (and other uses like job ops, exporting etc)
|
||||
// called from RehydrateIdList only
|
||||
//
|
||||
internal static async Task<long[]> GetIdListResponseAsync(
|
||||
AyContext ct,
|
||||
DataListSelectedProcessingOptions dataListSelectionOptions,
|
||||
IDataListProcessing DataList,
|
||||
AuthorizationRoles userRoles,
|
||||
ILogger log,
|
||||
long userId,
|
||||
bool limitForReportDesigner)
|
||||
{
|
||||
//#BUILD THE QUERY
|
||||
|
||||
//SELECT FRAGMENT COLUMNS FROM TEMPLATE
|
||||
var qSelect = DataListSqlSelectBuilder.BuildForIdListResponse(DataList.FieldDefinitions, dataListSelectionOptions);
|
||||
|
||||
//FROM CLAUSE
|
||||
var qFrom = DataList.SQLFrom;
|
||||
|
||||
var qWhere = string.Empty;
|
||||
var qOrderBy = string.Empty;
|
||||
|
||||
//WHERE CLAUSE - FILTER
|
||||
qWhere = DataListSqlFilterCriteriaBuilder.DataFilterToSQLCriteria(DataList.FieldDefinitions, dataListSelectionOptions);
|
||||
|
||||
//ORDER BY CLAUSE - SORT
|
||||
qOrderBy = DataListSqlFilterOrderByBuilder.DataFilterToSQLOrderBy(DataList.FieldDefinitions, dataListSelectionOptions);
|
||||
|
||||
//LIMIT (if report designer)
|
||||
var qLimit = string.Empty;
|
||||
if (limitForReportDesigner)
|
||||
qLimit = "LIMIT 5";
|
||||
|
||||
//PUT IT ALL TOGETHER
|
||||
string qDataQuery = string.Empty;
|
||||
|
||||
qDataQuery = $"{qSelect} {qFrom} {qWhere} {qOrderBy} {qLimit} ".Replace(" ", " ");
|
||||
|
||||
//RETURN OBJECTS
|
||||
var retList = new List<long>();
|
||||
|
||||
using (var command = ct.Database.GetDbConnection().CreateCommand())
|
||||
{
|
||||
await ct.Database.OpenConnectionAsync();
|
||||
command.CommandText = qDataQuery;
|
||||
try
|
||||
{
|
||||
using (var dr = await command.ExecuteReaderAsync())
|
||||
{
|
||||
while (dr.Read())
|
||||
{
|
||||
//only one column and it's the zeroth id column
|
||||
if (!dr.IsDBNull(0))
|
||||
retList.Add(dr.GetInt64(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Npgsql.PostgresException e)
|
||||
{
|
||||
//log out the exception and the query
|
||||
log.LogError("DataListFetcher:GetIdListResponseAsync query failed unexpectedly. IDList Query was:");
|
||||
log.LogError(qDataQuery);
|
||||
|
||||
log.LogError(e, "DB Exception");
|
||||
throw new System.Exception("DataListFetcher:GetIdListResponseAsync - Query failed see log");
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
//ensure any other type of exception gets surfaced properly
|
||||
//log out the exception and the query
|
||||
log.LogError("DataListFetcher:GetIdListResponseAsync unexpected failure. IDList Query was:");
|
||||
log.LogError(qDataQuery);
|
||||
|
||||
log.LogError(e, "Exception");
|
||||
throw new System.Exception("DataListFetcher:GetIdListResponseAsync - unexpected failure see log");
|
||||
}
|
||||
}
|
||||
return retList.ToArray();
|
||||
}
|
||||
|
||||
|
||||
}//eoc
|
||||
}//eons
|
||||
17
server/DataList/DataListField.cs
Normal file
17
server/DataList/DataListField.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
public class DataListField
|
||||
{
|
||||
public object v { get; set; }//v for vvvvvvvv?
|
||||
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)] //https://www.newtonsoft.com/json/help/html/JsonPropertyPropertyLevelSetting.htm
|
||||
public long? i { get; set; }//id value
|
||||
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)] //https://www.newtonsoft.com/json/help/html/JsonPropertyPropertyLevelSetting.htm
|
||||
public bool? rid { get; set; } //row id for opening entire row by one field id
|
||||
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)] //https://www.newtonsoft.com/json/help/html/JsonPropertyPropertyLevelSetting.htm
|
||||
public int? ot { get; set; }//openable type
|
||||
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)] //https://www.newtonsoft.com/json/help/html/JsonPropertyPropertyLevelSetting.htm
|
||||
public string clr { get; set; }//color
|
||||
}
|
||||
}
|
||||
94
server/DataList/DataListFieldDefinition.cs
Normal file
94
server/DataList/DataListFieldDefinition.cs
Normal file
@@ -0,0 +1,94 @@
|
||||
using Sockeye.Biz;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
//This class defines a field used for returning data in list format for UI grid lists and reporting
|
||||
public class DataListFieldDefinition
|
||||
{
|
||||
//CLIENT / SERVER Unique identifier used at BOTH client and server
|
||||
//also the sql valuecolumnname if identical
|
||||
public string FieldKey { get; set; }
|
||||
|
||||
//CLIENT Use only for display
|
||||
public string TKey { get; set; }
|
||||
|
||||
//CLIENT Use only for display to disambiguate things like
|
||||
//Tags in main workorder and Tags in Workorder Item and Tags in Unit (all on same list)
|
||||
public string TKeySection { get; set; }
|
||||
|
||||
//CLIENT / SERVER - client display server validation purposes
|
||||
public bool IsCustomField { get; set; }
|
||||
|
||||
//CLIENT / SERVER - client display server validation purposes
|
||||
public bool IsFilterable { get; set; }
|
||||
|
||||
//CLIENT / SERVER - client display server validation purposes
|
||||
public bool IsSortable { get; set; }
|
||||
|
||||
//SERVER - indicates internal only meta column, not a client thing
|
||||
public bool IsMeta { get; set; }
|
||||
|
||||
//CLIENT Use only for display
|
||||
public int UiFieldDataType { get; set; }
|
||||
|
||||
//CLIENT Use only for display
|
||||
public string EnumType { get; set; }
|
||||
|
||||
//SERVER / CLIENT - used to identify the column that represents the entire row ID and object
|
||||
//MUST be present in all datalists and displayed at the client
|
||||
public bool IsRowId { get; set; }
|
||||
|
||||
//CLIENT / SERVER - client display and to indicate what object to open , Server for formatting return object
|
||||
public int SockType { get; set; }
|
||||
|
||||
//CLIENT - indicates client must translate the values in this column (typically computed columns based on aygetname procedure)
|
||||
public bool Translate { get; set; }
|
||||
|
||||
//SERVER - for building sql queries
|
||||
//don't return these properties when api user fetches field list definitions in DataListController
|
||||
[JsonIgnore]
|
||||
public string SqlIdColumnName { get; set; }
|
||||
[JsonIgnore]
|
||||
public string SqlValueColumnName { get; set; }
|
||||
[JsonIgnore]
|
||||
public string SqlATypeColumnName { get; set; }//column to fetch the SockType 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
|
||||
|
||||
public DataListFieldDefinition()
|
||||
{
|
||||
//most common defaults
|
||||
IsCustomField = false;
|
||||
IsFilterable = true;
|
||||
IsSortable = true;
|
||||
IsRowId = false;
|
||||
IsMeta = false;
|
||||
Translate = false;
|
||||
//Set openable object type to no type which is the default and means it's not a link to another object
|
||||
SockType = (int)Biz.SockType.NoType;
|
||||
SqlATypeColumnName = null;//must be null as that is checked against specifically
|
||||
SqlColorColumnName = null;//must be null to be ignored properly
|
||||
|
||||
}
|
||||
|
||||
//Get column to query for display name or use FieldName if there is no difference
|
||||
public string GetSqlValueColumnName()
|
||||
{
|
||||
if (string.IsNullOrEmpty(SqlValueColumnName))
|
||||
{
|
||||
return FieldKey.ToLowerInvariant();
|
||||
}
|
||||
else
|
||||
{
|
||||
return SqlValueColumnName;
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasIdColumn()
|
||||
{
|
||||
return !string.IsNullOrWhiteSpace(SqlIdColumnName);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
43
server/DataList/DataListFilterComparisonOperator.cs
Normal file
43
server/DataList/DataListFilterComparisonOperator.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System.Collections.Generic;
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
public static class DataListFilterComparisonOperator
|
||||
{
|
||||
//NOTE: no LIKE or NOT LIKE deliberately
|
||||
//StartsWith and EndsWith and Contains and NotContains cover all the most common cases and avoid needing a special set of LIKE characters people have to type and we have to document
|
||||
public const string Equality = "=";
|
||||
public const string GreaterThan = ">";
|
||||
public const string GreaterThanOrEqualTo = ">=";
|
||||
public const string LessThan = "<";
|
||||
public const string LessThanOrEqualTo = "<=";
|
||||
public const string NotEqual = "!=";
|
||||
public const string StartsWith = "%-";
|
||||
public const string EndsWith = "-%";
|
||||
public const string Contains = "-%-";
|
||||
public const string NotContains = "!-%-";
|
||||
|
||||
public static List<string> operators = null;
|
||||
public static List<string> Operators
|
||||
{
|
||||
get
|
||||
{
|
||||
if (operators == null)
|
||||
{
|
||||
operators = new List<string>();
|
||||
operators.Add(Equality);
|
||||
operators.Add(GreaterThan);
|
||||
operators.Add(GreaterThanOrEqualTo);
|
||||
operators.Add(LessThan);
|
||||
operators.Add(LessThanOrEqualTo);
|
||||
operators.Add(NotEqual);
|
||||
operators.Add(StartsWith);
|
||||
operators.Add(EndsWith);
|
||||
operators.Add(Contains);
|
||||
operators.Add(NotContains);
|
||||
|
||||
}
|
||||
return operators;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
210
server/DataList/DataListProcessingBase.cs
Normal file
210
server/DataList/DataListProcessingBase.cs
Normal file
@@ -0,0 +1,210 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Sockeye.Models;
|
||||
using Sockeye.Biz;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// DataList object base class
|
||||
/// </summary>
|
||||
internal abstract class DataListProcessingBase : IDataListProcessing
|
||||
{
|
||||
//CoreBizObject add here
|
||||
//well, not here exactly but add a new DATALIST class if it will be displayed as a list anywhere in the UI or reported on
|
||||
public DataListProcessingBase()
|
||||
{
|
||||
/*
|
||||
NOTE: all sql identifiers need to be explicitly identified as understood by postgres
|
||||
|
||||
DefaultColumns = new List<string>() { "XXX", "XXXX", "XXXX", "XXXX", "XXXX", "XXX", "XXXX", "XXXX", "XXXX", "XXXX" };
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "XXXX", "+" }, { "XXXX", "-" } };
|
||||
*/
|
||||
}
|
||||
|
||||
public string SQLFrom { get; set; }
|
||||
public List<DataListFieldDefinition> FieldDefinitions { get; set; }
|
||||
public AuthorizationRoles AllowedRoles { get; set; }
|
||||
public SockType DefaultListAType { get; set; }
|
||||
//public long CurrentUserId { get; set; }
|
||||
//public long CurrentUserTranslationId { get; set; }
|
||||
public List<string> DefaultColumns { get; set; }
|
||||
public Dictionary<string, string> DefaultSortBy { get; set; }
|
||||
|
||||
//set defaults if not provided in listOptions
|
||||
public void SetListOptionDefaultsIfNecessary(Models.DataListProcessingBase listOptions)
|
||||
{
|
||||
//columns, filter and sortby could all be null
|
||||
if (listOptions.Filter == null)
|
||||
listOptions.Filter = new List<DataListFilterOption>();
|
||||
|
||||
if (listOptions.SortBy == null)
|
||||
listOptions.SortBy = new Dictionary<string, string>();
|
||||
|
||||
//Check Columns
|
||||
if (listOptions is DataListTableProcessingOptions)
|
||||
{
|
||||
var dlto = ((DataListTableProcessingOptions)listOptions);
|
||||
if (dlto.Columns == null)
|
||||
dlto.Columns = new List<string>();
|
||||
//if this doesn't work then just ditch this method in favor of local code, it's not really saving much
|
||||
if (dlto.Columns.Count == 0)
|
||||
dlto.Columns = DefaultColumns;
|
||||
}
|
||||
|
||||
//Check SortBy
|
||||
if (listOptions.SortBy.Count == 0)
|
||||
listOptions.SortBy = DefaultSortBy;
|
||||
|
||||
//Check filter
|
||||
if (listOptions.Filter == null)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Newtonsoft.Json.Linq.JArray GenerateReturnListColumns(List<string> columns)
|
||||
{
|
||||
var CustomFieldDefinitions = GetCustomFieldDefinitionsForList();
|
||||
|
||||
//Generate JSON fragment to return with column definitions
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.Append("[");
|
||||
|
||||
bool FirstColumnAdded = false;
|
||||
|
||||
foreach (string s in columns)
|
||||
{
|
||||
DataListFieldDefinition o = FieldDefinitions.FirstOrDefault(z => z.FieldKey == s);
|
||||
#if (DEBUG)
|
||||
//Developers little helper
|
||||
if (o == null)
|
||||
{
|
||||
throw new System.ArgumentNullException($"DEV ERROR in AyaDataList::GenerateReturnListColumns - field {s} specified in columns was NOT found in ObjectFields list");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (o != null)
|
||||
{//Here is where we can vet the field name, if it doesn't exist. For production we'll just ignore those ones
|
||||
|
||||
if (FirstColumnAdded)
|
||||
sb.Append(",");
|
||||
sb.Append("{");
|
||||
//Build required part of column definition
|
||||
if (!o.IsCustomField)
|
||||
sb.Append($"\"cm\":\"{o.TKey}\",\"dt\":{(int)o.UiFieldDataType}");
|
||||
else
|
||||
{
|
||||
//insert specific type for this custom field
|
||||
if (CustomFieldDefinitions.ContainsKey(o.TKey))
|
||||
{
|
||||
var customFieldType = CustomFieldDefinitions[o.TKey];
|
||||
sb.Append($"\"cm\":\"{o.TKey}\",\"dt\":{customFieldType}");
|
||||
}
|
||||
else
|
||||
{
|
||||
//this is normal as there may not be a definition for a Custom field but it's been requested so just treat it like text
|
||||
sb.Append($"\"cm\":\"{o.TKey}\",\"dt\":{(int)UiFieldDataType.Text}");
|
||||
}
|
||||
}
|
||||
|
||||
//Has a AyAType? (linkable / openable)
|
||||
if (o.SockType != 0)
|
||||
sb.Append($",\"sock\":{(int)o.SockType}");
|
||||
|
||||
//Row ID column?
|
||||
if (o.IsRowId)
|
||||
{
|
||||
sb.Append($",\"rid\":1");
|
||||
}
|
||||
|
||||
//Has a Enumtype?
|
||||
if (!string.IsNullOrEmpty(o.EnumType))
|
||||
sb.Append($",\"et\":\"{Sockeye.Util.StringUtil.TrimTypeName(o.EnumType)}\"");
|
||||
|
||||
|
||||
//field key needed for sorting etc
|
||||
sb.Append($",\"fk\":\"{o.FieldKey}\"");
|
||||
|
||||
//Not Sortable?
|
||||
if (!o.IsSortable)
|
||||
sb.Append($",\"ns\":1");
|
||||
|
||||
//Not Filterable?
|
||||
if (!o.IsFilterable)
|
||||
sb.Append($",\"nf\":1");
|
||||
|
||||
//translate required?
|
||||
if (o.Translate)
|
||||
sb.Append($",\"tra\":1");
|
||||
|
||||
|
||||
sb.Append("}");
|
||||
FirstColumnAdded = true;
|
||||
|
||||
}
|
||||
}
|
||||
sb.Append("]");
|
||||
|
||||
return JArray.Parse(sb.ToString());
|
||||
}
|
||||
|
||||
|
||||
//Find and return a dictionary of all custom fields definitions for all types in list
|
||||
//used to build the column array and define specific type defined for custom fields so client datatable
|
||||
//knows how to format it
|
||||
private Dictionary<string, int> GetCustomFieldDefinitionsForList()
|
||||
{
|
||||
//all keys and types can go in the same list since they are unique to each type of list
|
||||
//i.e. both users and widget custom fields can be in the same list
|
||||
Dictionary<string, int> ret = new Dictionary<string, int>();
|
||||
List<string> typesProcessed = new List<string>();
|
||||
//custom fields handling
|
||||
foreach (DataListFieldDefinition d in this.FieldDefinitions)
|
||||
{
|
||||
if (d.IsCustomField)
|
||||
{
|
||||
//this relies on the convention I'm using of SockType name as the first part of all custom fields lT keys, e.g.
|
||||
//WidgetCustom1 -> Widget
|
||||
var aysockTypename = d.TKey.Split("Custom")[0];
|
||||
if (!typesProcessed.Contains(aysockTypename))
|
||||
{
|
||||
//make sure we do each type only once
|
||||
typesProcessed.Add(aysockTypename);
|
||||
//fetch it and set it
|
||||
using (var ct = Sockeye.Util.ServiceProviderProvider.DBContext)
|
||||
{
|
||||
var fc = ct.FormCustom.AsNoTracking().SingleOrDefault(z => z.FormKey == aysockTypename);
|
||||
//normal condition
|
||||
if (fc == null)
|
||||
continue;
|
||||
|
||||
//iterate the fields and add each custom one with a type to the return dictionary
|
||||
var flds = JArray.Parse(fc.Template);
|
||||
foreach (JToken t in flds)
|
||||
{
|
||||
if (t["type"] != null)
|
||||
{
|
||||
ret.Add(t["fld"].Value<string>(), t["type"].Value<int>());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}//eoc
|
||||
|
||||
}//eons
|
||||
27
server/DataList/DataListReturnData.cs
Normal file
27
server/DataList/DataListReturnData.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
using Sockeye.Models;
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
public class DataListReturnData
|
||||
{
|
||||
public object Data { get; }
|
||||
public long TotalRecordCount { get; }
|
||||
public object Columns { get; }
|
||||
public Dictionary<string, string> SortBy { get; set; }
|
||||
public List<DataListFilterOption> Filter { get; set; }
|
||||
//All columns that are hidden but are affecting the query (sorting, filtering)
|
||||
//so in UI can show that there are hidden columns affecting the result set
|
||||
public List<string> HiddenAffectiveColumns {get;set;}
|
||||
|
||||
public DataListReturnData(object returnItems, long totalRecordCount, Newtonsoft.Json.Linq.JArray columns, Dictionary<string, string> sortBy, List<DataListFilterOption> filter, List<string> hiddenAffectiveColumns)
|
||||
{
|
||||
Data = returnItems;
|
||||
TotalRecordCount = totalRecordCount;
|
||||
Columns = columns;
|
||||
SortBy = sortBy;
|
||||
Filter = filter;
|
||||
HiddenAffectiveColumns=hiddenAffectiveColumns;
|
||||
}
|
||||
}//eoc
|
||||
|
||||
}//eons
|
||||
1179
server/DataList/DataListSqlFilterCriteriaBuilder.cs
Normal file
1179
server/DataList/DataListSqlFilterCriteriaBuilder.cs
Normal file
File diff suppressed because it is too large
Load Diff
51
server/DataList/DataListSqlFilterOrderByBuilder.cs
Normal file
51
server/DataList/DataListSqlFilterOrderByBuilder.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System.Text;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
public static class DataListSqlFilterOrderByBuilder
|
||||
{
|
||||
public static string DataFilterToSQLOrderBy(List<DataListFieldDefinition> objectFieldsList, Models.DataListProcessingBase listOptions)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
bool SortItemAdded = false;
|
||||
foreach (KeyValuePair<string, string> kvSort in listOptions.SortBy)
|
||||
{
|
||||
//Get the correct sql column name
|
||||
DataListFieldDefinition DataListField = objectFieldsList.FirstOrDefault(z => z.FieldKey == kvSort.Key);
|
||||
//No sorting on custom fields!
|
||||
if (DataListField.IsCustomField)
|
||||
continue;
|
||||
#if (DEBUG)
|
||||
//Developers little helper
|
||||
if (DataListField == null)
|
||||
throw new System.ArgumentNullException($"DEV ERROR in DataListSqlFilterOrderByBuilder.cs: field {kvSort.Key} specified in template was NOT found in ObjectFields list");
|
||||
|
||||
#endif
|
||||
var SQLValueColumnName = DataListField.GetSqlValueColumnName();
|
||||
if (SortItemAdded)
|
||||
sb.Append(", ");
|
||||
else
|
||||
sb.Append(" ");
|
||||
sb.Append(SQLValueColumnName);
|
||||
sb.Append(" ");
|
||||
sb.Append(kvSort.Value == "+" ? "ASC" : "DESC");
|
||||
SortItemAdded = true;
|
||||
}
|
||||
|
||||
if (sb.Length == 0)
|
||||
{
|
||||
//no sort specified so default it
|
||||
DataListFieldDefinition rid = objectFieldsList.FirstOrDefault(z => z.IsRowId == true);
|
||||
if (rid != null)
|
||||
return $"ORDER BY {rid.SqlIdColumnName} DESC";
|
||||
else
|
||||
return string.Empty; //no default column so no idea how to sort
|
||||
}
|
||||
else
|
||||
return "ORDER BY" + sb.ToString();
|
||||
}
|
||||
|
||||
}//eoc
|
||||
}//ens
|
||||
126
server/DataList/DataListSqlSelectBuilder.cs
Normal file
126
server/DataList/DataListSqlSelectBuilder.cs
Normal file
@@ -0,0 +1,126 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Linq;
|
||||
using Sockeye.Models;
|
||||
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal class SqlSelectBuilderResult
|
||||
{
|
||||
internal Dictionary<string, int> map { get; set; }
|
||||
internal string Select { get; set; }
|
||||
}
|
||||
internal static class DataListSqlSelectBuilder
|
||||
{
|
||||
|
||||
//Build the SELECT portion of a list query based on the columns
|
||||
internal static SqlSelectBuilderResult BuildForDataTableListResponse(List<DataListFieldDefinition> objectFieldsList, List<string> columns)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("SELECT ");
|
||||
//keep track of which custom fields columns were added already
|
||||
//this ensures that if there is more than one set of custom fields like from two different objects in the list
|
||||
//only unique ones will be returned by query
|
||||
//map sql column name to ordinal name
|
||||
Dictionary<string, int> map = new Dictionary<string, int>();
|
||||
int nOrdinal = 0;
|
||||
|
||||
var firstColumnAdded = false;
|
||||
foreach (string ColumnName in columns)
|
||||
{
|
||||
DataListFieldDefinition o = objectFieldsList.FirstOrDefault(z => z.FieldKey == ColumnName);
|
||||
#if (DEBUG)
|
||||
//Developers little helper
|
||||
if (o == null)
|
||||
{
|
||||
throw new System.ArgumentNullException($"## DEV ERROR in DataListSqlSelectBuilder.cs:BuildForDataTableListResponse() field {ColumnName} specified in columns was NOT found in the data list's ObjectFields list, a defined fieldkey name differs from the columns key name");
|
||||
}
|
||||
#endif
|
||||
if (o != null)
|
||||
{//Ignore missing fields in production
|
||||
if (o.IsCustomField)
|
||||
{ //if any are custom field then add custom fields column to query
|
||||
var CustomFieldSqlColumnName = o.GetSqlValueColumnName();
|
||||
//has it been added yet?
|
||||
if (!map.ContainsKey(CustomFieldSqlColumnName))
|
||||
{ //nope
|
||||
if (firstColumnAdded)
|
||||
sb.Append(", ");
|
||||
sb.Append(CustomFieldSqlColumnName);
|
||||
firstColumnAdded = true;
|
||||
map.Add(CustomFieldSqlColumnName, nOrdinal++);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var valueColumnName = o.GetSqlValueColumnName();
|
||||
if (!map.ContainsKey(valueColumnName))
|
||||
{
|
||||
if (firstColumnAdded)
|
||||
sb.Append(", ");
|
||||
sb.Append(valueColumnName);
|
||||
firstColumnAdded = true;
|
||||
map.Add(valueColumnName, nOrdinal++);
|
||||
}
|
||||
|
||||
//does it also have an ID column?
|
||||
var idColumnName = o.SqlIdColumnName;
|
||||
if (!string.IsNullOrWhiteSpace(idColumnName))
|
||||
{
|
||||
if (!map.ContainsKey(idColumnName))
|
||||
{
|
||||
if (firstColumnAdded)
|
||||
sb.Append(", ");
|
||||
sb.Append(idColumnName);
|
||||
firstColumnAdded = true;
|
||||
map.Add(idColumnName, nOrdinal++);
|
||||
}
|
||||
}
|
||||
|
||||
//does it also have an openable SockType column?
|
||||
var sockTypeColumnName = o.SqlATypeColumnName;
|
||||
if (!string.IsNullOrWhiteSpace(sockTypeColumnName))
|
||||
{
|
||||
if (!map.ContainsKey(sockTypeColumnName))
|
||||
{
|
||||
if (firstColumnAdded)
|
||||
sb.Append(", ");
|
||||
sb.Append(sockTypeColumnName);
|
||||
firstColumnAdded = true;
|
||||
map.Add(sockTypeColumnName, nOrdinal++);
|
||||
}
|
||||
}
|
||||
|
||||
//does it also have a Color column?
|
||||
var ayaColorColumnName = o.SqlColorColumnName;
|
||||
if (!string.IsNullOrWhiteSpace(ayaColorColumnName))
|
||||
{
|
||||
if (!map.ContainsKey(ayaColorColumnName))
|
||||
{
|
||||
if (firstColumnAdded)
|
||||
sb.Append(", ");
|
||||
sb.Append(ayaColorColumnName);
|
||||
firstColumnAdded = true;
|
||||
map.Add(ayaColorColumnName, nOrdinal++);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return new SqlSelectBuilderResult() { map = map, Select = sb.ToString() };
|
||||
}//eom
|
||||
|
||||
|
||||
//Build the SELECT portion of a list query but only to return rowid's
|
||||
internal static string BuildForIdListResponse(List<DataListFieldDefinition> fieldDefinitions, DataListSelectedProcessingOptions dataListSelectionOptions)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("SELECT ");
|
||||
//note: only need rowid column for these queries, the where conditions don't rely on any defined column names as they explicitly refer to the exact identifier known to postgres
|
||||
//Note: IsRowId field should *always* exist for any list that is intended to be used in an idlist response
|
||||
var o = fieldDefinitions.FirstOrDefault(z => z.IsRowId == true);
|
||||
sb.Append(o.SqlIdColumnName);
|
||||
return sb.ToString();
|
||||
}//eom
|
||||
}//eoc
|
||||
}//ens
|
||||
75
server/DataList/EventDataList.cs
Normal file
75
server/DataList/EventDataList.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
using System.Collections.Generic;
|
||||
using Sockeye.Biz;
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal class EventDataList : DataListProcessingBase
|
||||
{
|
||||
public EventDataList(long translationId)
|
||||
{
|
||||
//NOTE: used this type because it's full BizFull and read only Bizrestricted only which is appropriate and there is no event type
|
||||
DefaultListAType = SockType.Global;
|
||||
SQLFrom = "from aevent left join auser on (aevent.userid=auser.id)";
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() { "eventcreated", "event", "object", "SockType", "username", "textra" };
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "eventcreated", "-" } };
|
||||
|
||||
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "EventCreated",
|
||||
FieldKey = "eventcreated",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "aevent.created"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Event",
|
||||
FieldKey = "event",
|
||||
UiFieldDataType = (int)UiFieldDataType.Enum,
|
||||
EnumType = Sockeye.Util.StringUtil.TrimTypeName(typeof(SockEvent).ToString()),
|
||||
SqlValueColumnName = "aevent.ayevent"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "SockType",
|
||||
FieldKey = "SockType",
|
||||
UiFieldDataType = (int)UiFieldDataType.Enum,
|
||||
EnumType = Sockeye.Util.StringUtil.TrimTypeName(typeof(SockType).ToString()),
|
||||
SqlValueColumnName = "aevent.socktype"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Object",
|
||||
FieldKey = "object",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "aevent.ayid",
|
||||
SqlValueColumnName = $"AYGETNAME(aevent.ayid, aevent.socktype,{translationId})",
|
||||
SqlATypeColumnName = "aevent.socktype"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "username",
|
||||
TKey = "User",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SockType = (int)SockType.User,
|
||||
SqlIdColumnName = "auser.id",
|
||||
SqlValueColumnName = "auser.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "EventTextra",
|
||||
FieldKey = "textra",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aevent.textra"
|
||||
});
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
240
server/DataList/HeadOfficeDataList.cs
Normal file
240
server/DataList/HeadOfficeDataList.cs
Normal file
@@ -0,0 +1,240 @@
|
||||
using System.Collections.Generic;
|
||||
using Sockeye.Biz;
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal class HeadOfficeDataList : DataListProcessingBase
|
||||
{
|
||||
public HeadOfficeDataList(long translationId)
|
||||
{
|
||||
DefaultListAType = SockType.HeadOffice;
|
||||
SQLFrom = "from aheadoffice";
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() { "headofficename", "headofficephone1", "headofficeemail" };
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "headofficename", "+" } };
|
||||
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "HeadOfficeName",
|
||||
FieldKey = "headofficename",
|
||||
SockType = (int)SockType.HeadOffice,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "aheadoffice.id",
|
||||
SqlValueColumnName = "aheadoffice.name",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "HeadOfficeNotes",
|
||||
FieldKey = "headofficenotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aheadoffice.notes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Active",
|
||||
FieldKey = "headofficeactive",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "aheadoffice.active"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "headofficetags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "aheadoffice.tags"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WebAddress",
|
||||
FieldKey = "headofficewebaddress",
|
||||
UiFieldDataType = (int)UiFieldDataType.HTTP,
|
||||
SqlValueColumnName = "aheadoffice.webaddress"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "HeadOfficeAccountNumber",
|
||||
FieldKey = "headofficeaccountnumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aheadoffice.accountnumber"
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "HeadOfficePhone1",
|
||||
FieldKey = "headofficephone1",
|
||||
UiFieldDataType = (int)UiFieldDataType.PhoneNumber,
|
||||
SqlValueColumnName = "aheadoffice.phone1"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "HeadOfficePhone2",
|
||||
FieldKey = "headofficephone2",
|
||||
UiFieldDataType = (int)UiFieldDataType.PhoneNumber,
|
||||
SqlValueColumnName = "aheadoffice.phone2"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "HeadOfficePhone3",
|
||||
FieldKey = "headofficephone3",
|
||||
UiFieldDataType = (int)UiFieldDataType.PhoneNumber,
|
||||
SqlValueColumnName = "aheadoffice.phone3"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "HeadOfficePhone4",
|
||||
FieldKey = "headofficephone4",
|
||||
UiFieldDataType = (int)UiFieldDataType.PhoneNumber,
|
||||
SqlValueColumnName = "aheadoffice.phone4"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "HeadOfficePhone5",
|
||||
FieldKey = "headofficephone5",
|
||||
UiFieldDataType = (int)UiFieldDataType.PhoneNumber,
|
||||
SqlValueColumnName = "aheadoffice.phone5"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "HeadOfficeEmail",
|
||||
FieldKey = "headofficeemail",
|
||||
UiFieldDataType = (int)UiFieldDataType.EmailAddress,
|
||||
SqlValueColumnName = "aheadoffice.emailaddress"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalDeliveryAddress",
|
||||
FieldKey = "headofficepostaddress",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aheadoffice.postaddress"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalCity",
|
||||
FieldKey = "headofficepostcity",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aheadoffice.postcity"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalStateProv",
|
||||
FieldKey = "headofficepostregion",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aheadoffice.postregion"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalCountry",
|
||||
FieldKey = "headofficepostcountry",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aheadoffice.postcountry"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalPostal",
|
||||
FieldKey = "headofficepostcode",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aheadoffice.postcode"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressDeliveryAddress",
|
||||
FieldKey = "headofficeaddress",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aheadoffice.address"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressCity",
|
||||
FieldKey = "headofficecity",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aheadoffice.city"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressStateProv",
|
||||
FieldKey = "headofficeregion",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aheadoffice.region"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressCountry",
|
||||
FieldKey = "headofficecountry",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aheadoffice.country"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostal",
|
||||
FieldKey = "headofficeaddresspostal",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aheadoffice.addresspostal"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressLatitude",
|
||||
FieldKey = "headofficelatitude",
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlValueColumnName = "aheadoffice.latitude"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressLongitude",
|
||||
FieldKey = "headofficelongitude",
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlValueColumnName = "aheadoffice.longitude"
|
||||
});
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "HeadOfficeCustom1", FieldKey = "headofficecustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aheadoffice.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "HeadOfficeCustom2", FieldKey = "headofficecustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aheadoffice.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "HeadOfficeCustom3", FieldKey = "headofficecustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aheadoffice.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "HeadOfficeCustom4", FieldKey = "headofficecustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aheadoffice.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "HeadOfficeCustom5", FieldKey = "headofficecustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aheadoffice.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "HeadOfficeCustom6", FieldKey = "headofficecustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aheadoffice.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "HeadOfficeCustom7", FieldKey = "headofficecustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aheadoffice.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "HeadOfficeCustom8", FieldKey = "headofficecustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aheadoffice.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "HeadOfficeCustom9", FieldKey = "headofficecustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aheadoffice.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "HeadOfficeCustom10", FieldKey = "headofficecustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aheadoffice.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "HeadOfficeCustom11", FieldKey = "headofficecustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aheadoffice.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "HeadOfficeCustom12", FieldKey = "headofficecustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aheadoffice.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "HeadOfficeCustom13", FieldKey = "headofficecustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aheadoffice.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "HeadOfficeCustom14", FieldKey = "headofficecustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aheadoffice.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "HeadOfficeCustom15", FieldKey = "headofficecustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aheadoffice.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "HeadOfficeCustom16", FieldKey = "headofficecustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aheadoffice.customfields" });
|
||||
}
|
||||
|
||||
}//eoc
|
||||
}//eons
|
||||
11
server/DataList/IDataListInternalCriteria.cs
Normal file
11
server/DataList/IDataListInternalCriteria.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Sockeye.Models;
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal interface IDataListInternalCriteria
|
||||
{
|
||||
//Additional criteria for security or other reasons
|
||||
//hard coded into some lists (e.g. MemoDataList so users can't get other people's memos)
|
||||
//clientCriteria is additional criteria provided by client to list to process as it sees fit (e.g. CustomerNoteDataList requires customer id from client)
|
||||
System.Collections.Generic.List<DataListFilterOption> DataListInternalCriteria(long currentUserId, Sockeye.Biz.AuthorizationRoles userRoles, string clientCriteria);
|
||||
}
|
||||
}
|
||||
23
server/DataList/IDataListProcessing.cs
Normal file
23
server/DataList/IDataListProcessing.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Collections.Generic;
|
||||
using Sockeye.Biz;
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal interface IDataListProcessing
|
||||
{
|
||||
//sql query from fragment with table joins et
|
||||
string SQLFrom { get; set; }
|
||||
//List of fields for this object
|
||||
List<DataListFieldDefinition> FieldDefinitions { get; set; }
|
||||
//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)
|
||||
SockType 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; }
|
||||
void SetListOptionDefaultsIfNecessary(Models.DataListProcessingBase listOptions);
|
||||
Newtonsoft.Json.Linq.JArray GenerateReturnListColumns(List<string> columns);
|
||||
|
||||
//long CurrentUserTranslationId { get; set; }
|
||||
}
|
||||
}
|
||||
138
server/DataList/InsideUserDataList.cs
Normal file
138
server/DataList/InsideUserDataList.cs
Normal file
@@ -0,0 +1,138 @@
|
||||
using System.Collections.Generic;
|
||||
using Sockeye.Biz;
|
||||
using Sockeye.Models;
|
||||
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal class InsideUserDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||
{
|
||||
|
||||
public InsideUserDataList(long translationId)
|
||||
{
|
||||
DefaultListAType = SockType.User;
|
||||
SQLFrom = "from auser "
|
||||
+ "left join auseroptions on auser.id=auseroptions.userid "
|
||||
+ "left join atranslation on auseroptions.translationid = atranslation.id";
|
||||
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", "+" } };
|
||||
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "User",
|
||||
FieldKey = "name",
|
||||
SockType = (int)SockType.User,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "auser.id",
|
||||
SqlValueColumnName = "auser.name",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "UserEmployeeNumber",
|
||||
FieldKey = "employeenumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "auser.employeenumber"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Active",
|
||||
FieldKey = "active",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "auser.active"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AllowLogin",
|
||||
FieldKey = "allowlogin",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "auser.allowlogin"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "UserType",
|
||||
FieldKey = "usertype",
|
||||
UiFieldDataType = (int)UiFieldDataType.Enum,
|
||||
EnumType = Sockeye.Util.StringUtil.TrimTypeName(typeof(UserType).ToString()),
|
||||
SqlValueColumnName = "auser.usertype"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AuthorizationRoles",
|
||||
FieldKey = "roles",
|
||||
UiFieldDataType = (int)UiFieldDataType.Roles,
|
||||
//NOTE: not technically an enum list but this will trigger datagrid at client to fetch roles for special handling
|
||||
EnumType = Sockeye.Util.StringUtil.TrimTypeName(typeof(AuthorizationRoles).ToString()),
|
||||
SqlValueColumnName = "auser.roles"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "LastLogin",
|
||||
FieldKey = "lastlogin",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "auser.lastlogin"
|
||||
});
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AuthTwoFactor",
|
||||
FieldKey = "AuthTwoFactor",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "auser.twofactorenabled"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Translation",
|
||||
FieldKey = "Translation",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SockType = (int)SockType.Translation,
|
||||
SqlIdColumnName = "atranslation.id",
|
||||
SqlValueColumnName = "atranslation.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "Tags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "auser.tags"
|
||||
});
|
||||
|
||||
//META COLUMNS
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
|
||||
FieldKey = "metausertype",
|
||||
UiFieldDataType = (int)UiFieldDataType.Enum,
|
||||
EnumType = Sockeye.Util.StringUtil.TrimTypeName(typeof(UserType).ToString()),
|
||||
SqlValueColumnName = "auser.usertype",
|
||||
IsMeta = true
|
||||
});
|
||||
}
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, string clientCriteria)
|
||||
{
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metausertype" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = ((int)UserType.Customer).ToString(), op = DataListFilterComparisonOperator.NotEqual });
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = ((int)UserType.HeadOffice).ToString(), op = DataListFilterComparisonOperator.NotEqual });
|
||||
|
||||
ret.Add(FilterOption);
|
||||
return ret;
|
||||
}
|
||||
|
||||
}//eoc
|
||||
}//eons
|
||||
41
server/DataList/IntegrationDataList.cs
Normal file
41
server/DataList/IntegrationDataList.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System.Collections.Generic;
|
||||
using Sockeye.Biz;
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal class IntegrationDataList : DataListProcessingBase
|
||||
{
|
||||
public IntegrationDataList(long translationId)
|
||||
{
|
||||
DefaultListAType = SockType.Integration;
|
||||
SQLFrom = "from aintegration";
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() { "integrationname" };
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "integrationname", "+" } };
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "IntegrationName",
|
||||
FieldKey = "integrationname",
|
||||
SockType = (int)SockType.Integration,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "aintegration.id",
|
||||
SqlValueColumnName = "aintegration.name",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Active",
|
||||
FieldKey = "partassemblyactive",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "aintegration.active"
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
123
server/DataList/MemoDataList.cs
Normal file
123
server/DataList/MemoDataList.cs
Normal file
@@ -0,0 +1,123 @@
|
||||
using System.Collections.Generic;
|
||||
using Sockeye.Models;
|
||||
using Sockeye.Biz;
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal class MemoDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||
{
|
||||
public MemoDataList(long translationId)
|
||||
{
|
||||
|
||||
DefaultListAType = SockType.Memo;
|
||||
SQLFrom = "from amemo left join auser on (amemo.fromid=auser.id)";
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() { "MemoSubject", "MemoFromID", "MemoSent", "MemoViewed" };
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "MemoSent", "-" } };
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "MemoSubject",
|
||||
FieldKey = "MemoSubject",
|
||||
SockType = (int)SockType.Memo,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "amemo.id",
|
||||
SqlValueColumnName = "amemo.name",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "MemoMessage",
|
||||
FieldKey = "MemoMessage",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "amemo.notes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "MemoFromID",
|
||||
FieldKey = "MemoFromID",
|
||||
SockType = (int)SockType.User,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "auser.id",
|
||||
SqlValueColumnName = "auser.name",
|
||||
IsRowId = false
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "MemoSent",
|
||||
FieldKey = "MemoSent",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "amemo.sent"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "MemoReplied",
|
||||
FieldKey = "MemoReplied",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "amemo.replied"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "MemoViewed",
|
||||
FieldKey = "MemoViewed",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "amemo.viewed"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "MemoTags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "amemo.tags"
|
||||
});
|
||||
|
||||
//META column
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metamemoto",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "amemo.toid",
|
||||
SqlValueColumnName = "amemo.toid",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "MemoCustom1", FieldKey = "MemoCustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "MemoCustom2", FieldKey = "MemoCustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "MemoCustom3", FieldKey = "MemoCustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "MemoCustom4", FieldKey = "MemoCustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "MemoCustom5", FieldKey = "MemoCustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "MemoCustom6", FieldKey = "MemoCustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "MemoCustom7", FieldKey = "MemoCustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "MemoCustom8", FieldKey = "MemoCustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "MemoCustom9", FieldKey = "MemoCustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "MemoCustom10", FieldKey = "MemoCustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "MemoCustom11", FieldKey = "MemoCustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "MemoCustom12", FieldKey = "MemoCustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "MemoCustom13", FieldKey = "MemoCustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "MemoCustom14", FieldKey = "MemoCustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "MemoCustom15", FieldKey = "MemoCustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "MemoCustom16", FieldKey = "MemoCustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
|
||||
}
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, string clientCriteria)
|
||||
{
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metamemoto" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = currentUserId.ToString(), op = DataListFilterComparisonOperator.Equality });
|
||||
|
||||
ret.Add(FilterOption);
|
||||
return ret;
|
||||
}
|
||||
|
||||
}//eoc
|
||||
}//eons
|
||||
84
server/DataList/NotificationDeliveryLogDataList.cs
Normal file
84
server/DataList/NotificationDeliveryLogDataList.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
using System.Collections.Generic;
|
||||
using Sockeye.Biz;
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal class NotificationDeliveryLogDataList : DataListProcessingBase
|
||||
{
|
||||
public NotificationDeliveryLogDataList(long translationId)
|
||||
{
|
||||
DefaultListAType = SockType.OpsNotificationSettings;
|
||||
SQLFrom = @"from anotifydeliverylog
|
||||
left join anotifysubscription on anotifysubscription.id = anotifydeliverylog.notifysubscriptionid
|
||||
left join auser on anotifysubscription.userid=auser.id";
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() { "Processed", "NotifyEventType", "SockType", "User", "Failed", "Errors" };
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "Processed", "-" } };
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
// FieldDefinitions.Add(new DataListFieldDefinition
|
||||
// {
|
||||
// TKey = "NotifySubscription",
|
||||
// FieldKey = "NotifySubscription",
|
||||
// SockType = (int)SockType.NotifySubscription,
|
||||
// UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
// SqlIdColumnName = "anotifysubscription.id",
|
||||
// SqlValueColumnName = "anotifysubscription.id",
|
||||
// IsRowId = false
|
||||
// });
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Processed",
|
||||
FieldKey = "Processed",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "anotifydeliverylog.processed"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "NotifyEventType",
|
||||
FieldKey = "NotifyEventType",
|
||||
UiFieldDataType = (int)UiFieldDataType.Enum,
|
||||
EnumType = Sockeye.Util.StringUtil.TrimTypeName(typeof(NotifyEventType).ToString()),
|
||||
SqlValueColumnName = "anotifysubscription.eventtype"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "SockType",
|
||||
FieldKey = "SockType",
|
||||
UiFieldDataType = (int)UiFieldDataType.Enum,
|
||||
EnumType = Sockeye.Util.StringUtil.TrimTypeName(typeof(SockType).ToString()),
|
||||
SqlValueColumnName = "anotifysubscription.socktype"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Failed",
|
||||
FieldKey = "Failed",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "anotifydeliverylog.fail"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Errors",
|
||||
FieldKey = "Errors",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "anotifydeliverylog.error"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "User",
|
||||
TKey = "User",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SockType = (int)SockType.User,
|
||||
SqlIdColumnName = "auser.id",
|
||||
SqlValueColumnName = "auser.name"
|
||||
});
|
||||
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
151
server/DataList/OutsideUserDataList.cs
Normal file
151
server/DataList/OutsideUserDataList.cs
Normal file
@@ -0,0 +1,151 @@
|
||||
using System.Collections.Generic;
|
||||
using Sockeye.Models;
|
||||
using Sockeye.Biz;
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal class OutsideUserDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||
{
|
||||
|
||||
public OutsideUserDataList(long translationId)
|
||||
{
|
||||
DefaultListAType = SockType.Customer;
|
||||
SQLFrom = "from auser left join aheadoffice on (auser.headofficeid=aheadoffice.id) "
|
||||
+ "left join acustomer on (auser.customerid=acustomer.id)"
|
||||
+ "left join auseroptions on auser.id=auseroptions.userid "
|
||||
+ "left join atranslation on auseroptions.translationid = atranslation.id";
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() { "name", "active", "allowlogin", "usercustomer", "userheadoffice", "lastlogin" };
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "name", "+" } };
|
||||
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "User",
|
||||
FieldKey = "name",
|
||||
SockType = (int)SockType.User,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "auser.id",
|
||||
SqlValueColumnName = "auser.name",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Active",
|
||||
FieldKey = "active",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "auser.active"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AllowLogin",
|
||||
FieldKey = "allowlogin",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "auser.allowlogin"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "UserType",
|
||||
FieldKey = "usertype",
|
||||
UiFieldDataType = (int)UiFieldDataType.Enum,
|
||||
EnumType = Sockeye.Util.StringUtil.TrimTypeName(typeof(UserType).ToString()),
|
||||
SqlValueColumnName = "auser.usertype"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AuthorizationRoles",
|
||||
FieldKey = "roles",
|
||||
UiFieldDataType = (int)UiFieldDataType.Roles,
|
||||
//NOTE: not technically an enum list but this will trigger datagrid at client to fetch roles for special handling
|
||||
EnumType = Sockeye.Util.StringUtil.TrimTypeName(typeof(AuthorizationRoles).ToString()),
|
||||
SqlValueColumnName = "auser.roles"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "LastLogin",
|
||||
FieldKey = "lastlogin",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "auser.lastlogin"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "HeadOffice",
|
||||
FieldKey = "userheadoffice",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SockType = (int)SockType.HeadOffice,
|
||||
SqlIdColumnName = "aheadoffice.id",
|
||||
SqlValueColumnName = "aheadoffice.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Customer",
|
||||
FieldKey = "usercustomer",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SockType = (int)SockType.Customer,
|
||||
SqlIdColumnName = "acustomer.id",
|
||||
SqlValueColumnName = "acustomer.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AuthTwoFactor",
|
||||
FieldKey = "AuthTwoFactor",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "auser.twofactorenabled"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Translation",
|
||||
FieldKey = "Translation",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SockType = (int)SockType.Translation,
|
||||
SqlIdColumnName = "atranslation.id",
|
||||
SqlValueColumnName = "atranslation.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "Tags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "auser.tags"
|
||||
});
|
||||
|
||||
//META COLUMNS
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metausertype",
|
||||
UiFieldDataType = (int)UiFieldDataType.Enum,
|
||||
EnumType = Sockeye.Util.StringUtil.TrimTypeName(typeof(UserType).ToString()),
|
||||
SqlValueColumnName = "auser.usertype",
|
||||
IsMeta = true
|
||||
});
|
||||
}
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, string clientCriteria)
|
||||
{
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metausertype" };
|
||||
FilterOption.Any = true;
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = ((int)UserType.Customer).ToString(), op = DataListFilterComparisonOperator.Equality });
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = ((int)UserType.HeadOffice).ToString(), op = DataListFilterComparisonOperator.Equality });
|
||||
|
||||
ret.Add(FilterOption);
|
||||
return ret;
|
||||
}
|
||||
|
||||
}//eoc
|
||||
}//eons
|
||||
103
server/DataList/ReminderDataList.cs
Normal file
103
server/DataList/ReminderDataList.cs
Normal file
@@ -0,0 +1,103 @@
|
||||
using System.Collections.Generic;
|
||||
using Sockeye.Models;
|
||||
using Sockeye.Biz;
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal class ReminderDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||
{
|
||||
public ReminderDataList(long translationId)
|
||||
{
|
||||
DefaultListAType = SockType.Reminder;
|
||||
SQLFrom = "from areminder";
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() { "ReminderName", "ReminderNotes", "ReminderStartDate", "ReminderStopDate" };
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "ReminderStartDate", "-" } };
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "ReminderName",
|
||||
FieldKey = "ReminderName",
|
||||
SockType = (int)SockType.Reminder,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "areminder.id",
|
||||
SqlValueColumnName = "areminder.name",
|
||||
SqlColorColumnName = "areminder.color",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "ReminderNotes",
|
||||
FieldKey = "ReminderNotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "areminder.notes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "ReminderStartDate",
|
||||
FieldKey = "ReminderStartDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "areminder.startdate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "ReminderStopDate",
|
||||
FieldKey = "ReminderStopDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "areminder.stopdate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "ReminderTags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "areminder.tags"
|
||||
});
|
||||
|
||||
//META column
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metareminderuser",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "areminder.userid",
|
||||
SqlValueColumnName = "areminder.userid",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReminderCustom1", FieldKey = "ReminderCustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReminderCustom2", FieldKey = "ReminderCustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReminderCustom3", FieldKey = "ReminderCustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReminderCustom4", FieldKey = "ReminderCustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReminderCustom5", FieldKey = "ReminderCustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReminderCustom6", FieldKey = "ReminderCustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReminderCustom7", FieldKey = "ReminderCustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReminderCustom8", FieldKey = "ReminderCustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReminderCustom9", FieldKey = "ReminderCustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReminderCustom10", FieldKey = "ReminderCustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReminderCustom11", FieldKey = "ReminderCustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReminderCustom12", FieldKey = "ReminderCustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReminderCustom13", FieldKey = "ReminderCustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReminderCustom14", FieldKey = "ReminderCustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReminderCustom15", FieldKey = "ReminderCustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReminderCustom16", FieldKey = "ReminderCustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||
}
|
||||
|
||||
//Ensure only current user can fetch their reminders
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, string clientCriteria)
|
||||
{
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metareminderuser" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = currentUserId.ToString(), op = DataListFilterComparisonOperator.Equality });
|
||||
|
||||
ret.Add(FilterOption);
|
||||
return ret;
|
||||
}
|
||||
|
||||
}//eoc
|
||||
}//eons
|
||||
65
server/DataList/ReportDataList.cs
Normal file
65
server/DataList/ReportDataList.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using System.Collections.Generic;
|
||||
using Sockeye.Biz;
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal class ReportDataList : DataListProcessingBase
|
||||
{
|
||||
public ReportDataList(long translationId)
|
||||
{
|
||||
DefaultListAType = SockType.Report;
|
||||
SQLFrom = "from aReport";
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() { "name", "aType", "ReportNotes", "active" };
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "name", "+" } };
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Report",
|
||||
FieldKey = "name",
|
||||
SockType = (int)SockType.Report,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "aReport.id",
|
||||
SqlValueColumnName = "aReport.name",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "SockType",
|
||||
FieldKey = "aType",
|
||||
UiFieldDataType = (int)UiFieldDataType.Enum,
|
||||
EnumType = Sockeye.Util.StringUtil.TrimTypeName(typeof(SockType).ToString()),
|
||||
SqlValueColumnName = "areport.SockType"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "ReportNotes",
|
||||
FieldKey = "ReportNotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "areport.notes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Active",
|
||||
FieldKey = "active",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "aReport.active"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "SelectRoles",
|
||||
FieldKey = "roles",
|
||||
UiFieldDataType = (int)UiFieldDataType.Roles,
|
||||
//NOTE: not technically an enum list but this will trigger datagrid at client to fetch roles for special handling
|
||||
EnumType = Sockeye.Util.StringUtil.TrimTypeName(typeof(AuthorizationRoles).ToString()),
|
||||
SqlValueColumnName = "areport.roles"
|
||||
});
|
||||
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
208
server/DataList/ReviewDataList.cs
Normal file
208
server/DataList/ReviewDataList.cs
Normal file
@@ -0,0 +1,208 @@
|
||||
using System.Collections.Generic;
|
||||
using Sockeye.Models;
|
||||
using Sockeye.Biz;
|
||||
using System.Linq;
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal class ReviewDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||
{
|
||||
public ReviewDataList(long translationId)
|
||||
{
|
||||
|
||||
DefaultListAType = SockType.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(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() { "ReviewCompletedDate", "ReviewDate", "ReviewName", "Object", "SockType", "ReviewNotes", "ReviewUserId" };
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "ReviewCompletedDate", "-" }, { "ReviewDate", "+" } };
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Object",
|
||||
FieldKey = "Object",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "areview.objectid",
|
||||
SqlValueColumnName = $"AYGETNAME(areview.objectid, areview.aType,{translationId})",
|
||||
SqlATypeColumnName = "areview.aType",
|
||||
Translate=true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "SockType",
|
||||
FieldKey = "SockType",
|
||||
UiFieldDataType = (int)UiFieldDataType.Enum,
|
||||
EnumType = Sockeye.Util.StringUtil.TrimTypeName(typeof(SockType).ToString()),
|
||||
SqlValueColumnName = "areview.aType"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "ReviewName",
|
||||
FieldKey = "ReviewName",
|
||||
SockType = (int)SockType.Review,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "areview.id",
|
||||
SqlValueColumnName = "areview.name",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "ReviewNotes",
|
||||
FieldKey = "ReviewNotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "areview.notes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "ReviewDate",
|
||||
FieldKey = "ReviewDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "areview.reviewdate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "ReviewCompletedDate",
|
||||
FieldKey = "ReviewCompletedDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "areview.completeddate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "ReviewCompletionNotes",
|
||||
FieldKey = "ReviewCompletionNotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "areview.completionnotes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "ReviewUserId",
|
||||
FieldKey = "ReviewUserId",
|
||||
SockType = (int)SockType.User,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "uassto.id",
|
||||
SqlValueColumnName = "uassto.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "ReviewAssignedByUserId",
|
||||
FieldKey = "ReviewAssignedByUserId",
|
||||
SockType = (int)SockType.User,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "uassby.id",
|
||||
SqlValueColumnName = "uassby.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "ReviewTags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "areview.tags"
|
||||
});
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReviewCustom1", FieldKey = "ReviewCustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areview.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReviewCustom2", FieldKey = "ReviewCustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areview.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReviewCustom3", FieldKey = "ReviewCustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areview.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReviewCustom4", FieldKey = "ReviewCustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areview.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReviewCustom5", FieldKey = "ReviewCustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areview.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReviewCustom6", FieldKey = "ReviewCustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areview.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReviewCustom7", FieldKey = "ReviewCustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areview.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReviewCustom8", FieldKey = "ReviewCustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areview.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReviewCustom9", FieldKey = "ReviewCustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areview.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReviewCustom10", FieldKey = "ReviewCustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areview.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReviewCustom11", FieldKey = "ReviewCustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areview.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReviewCustom12", FieldKey = "ReviewCustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areview.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReviewCustom13", FieldKey = "ReviewCustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areview.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReviewCustom14", FieldKey = "ReviewCustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areview.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReviewCustom15", FieldKey = "ReviewCustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areview.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ReviewCustom16", FieldKey = "ReviewCustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areview.customfields" });
|
||||
|
||||
|
||||
|
||||
//META COLUMNS
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metareviewuser",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "areview.userid",
|
||||
SqlValueColumnName = "areview.userid",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metaobjectid",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "areview.objectid",
|
||||
SqlValueColumnName = "areview.objectid",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
|
||||
FieldKey = "metaobjecttype",
|
||||
UiFieldDataType = (int)UiFieldDataType.Enum,
|
||||
EnumType = Sockeye.Util.StringUtil.TrimTypeName(typeof(SockType).ToString()),
|
||||
SqlValueColumnName = "areview.aType",
|
||||
IsMeta = true
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, string clientCriteria)
|
||||
{
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
bool HasSupervisorRole =
|
||||
userRoles.HasFlag(AuthorizationRoles.BizAdmin)
|
||||
|| userRoles.HasFlag(AuthorizationRoles.Service)
|
||||
|| userRoles.HasFlag(AuthorizationRoles.Inventory)
|
||||
|| userRoles.HasFlag(AuthorizationRoles.Sales)
|
||||
|| userRoles.HasFlag(AuthorizationRoles.Accounting);
|
||||
|
||||
if (!HasSupervisorRole)
|
||||
{
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metareviewuser" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = currentUserId.ToString(), op = DataListFilterComparisonOperator.Equality });
|
||||
|
||||
ret.Add(FilterOption);
|
||||
}
|
||||
|
||||
|
||||
//ClientCriteria format for this list is "OBJECTID,AYATYPE"
|
||||
var crit = (clientCriteria ?? "").Split(',').Select(z => z.Trim()).ToArray();
|
||||
if (crit.Length > 1)
|
||||
{
|
||||
//OBJECTID criteria
|
||||
if (crit[0] != "0")
|
||||
{
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metaobjectid" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = crit[0], op = DataListFilterComparisonOperator.Equality });
|
||||
ret.Add(FilterOption);
|
||||
}
|
||||
|
||||
//AYATYPE criteria
|
||||
if (!string.IsNullOrWhiteSpace(crit[1]))
|
||||
{
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metaobjecttype" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = crit[1], op = DataListFilterComparisonOperator.Equality });
|
||||
ret.Add(FilterOption);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
}//eoc
|
||||
}//eons
|
||||
45
server/DataList/TranslationDataList.cs
Normal file
45
server/DataList/TranslationDataList.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System.Collections.Generic;
|
||||
using Sockeye.Biz;
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal class TranslationDataList : DataListProcessingBase
|
||||
{
|
||||
public TranslationDataList(long translationId)
|
||||
{
|
||||
DefaultListAType = SockType.Translation;
|
||||
SQLFrom = "from atranslation";
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() { "name", "stock", "cjkindex" };
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "name", "+" } };
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Translation",
|
||||
FieldKey = "name",
|
||||
SockType = (int)SockType.Translation,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "atranslation.id",
|
||||
SqlValueColumnName = "atranslation.name",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "GlobalCJKIndex",
|
||||
FieldKey = "cjkindex",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "atranslation.cjkindex"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "ReadOnly",
|
||||
FieldKey = "stock",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "atranslation.stock"
|
||||
});
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
Reference in New Issue
Block a user