131 lines
4.9 KiB
C#
131 lines
4.9 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Sockeye.Biz;
|
|
using Sockeye.Models;
|
|
|
|
namespace Sockeye.DataList
|
|
{
|
|
internal class LicenseDataList : DataListProcessingBase
|
|
{
|
|
public LicenseDataList(long translationId)
|
|
{
|
|
DefaultListAType = SockType.License;
|
|
SQLFrom = @"FROM alicense LEFT JOIN acustomer ON (alicense.customerid = acustomer.id)";
|
|
|
|
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
|
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
|
DefaultColumns = new List<string>() { "licensecreated", "LicenseTrialMode", "licenseactive", "licenseregto", "LicenseFetchedOn", "notificationsent", "ProductGroup" };
|
|
DefaultSortBy = new Dictionary<string, string>() { { "licensecreated", "-" } };
|
|
FieldDefinitions = new List<DataListFieldDefinition>();
|
|
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Created",
|
|
FieldKey = "licensecreated",
|
|
SockType = (int)SockType.License,
|
|
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
|
SqlIdColumnName = "alicense.id",
|
|
SqlValueColumnName = "alicense.created",
|
|
IsRowId = true
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Active",
|
|
FieldKey = "licenseactive",
|
|
UiFieldDataType = (int)UiFieldDataType.Bool,
|
|
SqlValueColumnName = "alicense.active"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "NotificationSent",
|
|
FieldKey = "notificationsent",
|
|
UiFieldDataType = (int)UiFieldDataType.Bool,
|
|
SqlValueColumnName = "alicense.notificationsent"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "LicenseTrialMode",
|
|
FieldKey = "LicenseTrialMode",
|
|
UiFieldDataType = (int)UiFieldDataType.Bool,
|
|
SqlValueColumnName = "alicense.trialmode"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "LicenseRegTo",
|
|
FieldKey = "licenseregto",
|
|
SockType = (int)SockType.License,
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlIdColumnName = "alicense.id",
|
|
SqlValueColumnName = "alicense.regto"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Customer",
|
|
FieldKey = "licensecustomer",
|
|
SockType = (int)SockType.Customer,
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlIdColumnName = "alicense.customerid",
|
|
SqlValueColumnName = "acustomer.name"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "ProductGroup",
|
|
FieldKey = "ProductGroup",
|
|
UiFieldDataType = (int)UiFieldDataType.Enum,
|
|
EnumType = Sockeye.Util.StringUtil.TrimTypeName(typeof(ProductGroup).ToString()),
|
|
SqlValueColumnName = "alicense.pgroup"
|
|
});
|
|
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Tags",
|
|
FieldKey = "licensetags",
|
|
UiFieldDataType = (int)UiFieldDataType.Tags,
|
|
SqlValueColumnName = "alicense.tags"
|
|
});
|
|
|
|
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "LicenseMaintenanceExpire",
|
|
FieldKey = "licensemaintexpire",
|
|
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
|
SqlValueColumnName = "alicense.maintenanceexpire"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "LicenseExpiration",
|
|
FieldKey = "licenseexpire",
|
|
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
|
SqlValueColumnName = "alicense.licenseexpire"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "LicenseFetchedOn",
|
|
FieldKey = "LicenseFetchedOn",
|
|
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
|
SqlValueColumnName = "alicense.fetchedon"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "DatabaseID",
|
|
FieldKey = "DatabaseID",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "alicense.dbid"
|
|
});
|
|
}
|
|
|
|
}//eoc
|
|
}//eons |