78 lines
3.5 KiB
C#
78 lines
3.5 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Sockeye.Biz;
|
|
using Sockeye.Models;
|
|
|
|
namespace Sockeye.DataList
|
|
{
|
|
internal class GZCaseDataList : DataListProcessingBase
|
|
{
|
|
public GZCaseDataList(long translationId)
|
|
{
|
|
DefaultListAType = SockType.GZCase;
|
|
SQLFrom = @"FROM agzcase ";
|
|
|
|
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
|
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
|
DefaultColumns = new List<string>() { "GZCaseId", "GZCaseName", "Tags" };
|
|
DefaultSortBy = new Dictionary<string, string>() { { "GZCaseId", "-" } };
|
|
FieldDefinitions = new List<DataListFieldDefinition>();
|
|
/*
|
|
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'GZCase', 'Case' FROM atranslation t where t.baselanguage = 'en'");
|
|
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'GZCaseList', 'Cases' FROM atranslation t where t.baselanguage = 'en'");
|
|
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'GZCaseId', 'Case #' FROM atranslation t where t.baselanguage = 'en'");
|
|
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'GZCaseClosed', 'Closed' FROM atranslation t where t.baselanguage = 'en'");
|
|
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'GZCaseName', 'Summary' FROM atranslation t where t.baselanguage = 'en'");
|
|
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'GZCaseNotes', 'Details' FROM atranslation t where t.baselanguage = 'en'");
|
|
caseid BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, "
|
|
+ "created TIMESTAMPTZ NOT NULL, closed TIMESTAMPTZ, name TEXT NOT NULL, notes TEXT, "
|
|
+ "wiki TEXT, tags VARCHAR(255) ARRAY
|
|
*/
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "GZCaseId",
|
|
FieldKey = "GZCaseId",
|
|
SockType = (int)SockType.GZCase,
|
|
UiFieldDataType = (int)UiFieldDataType.Integer,
|
|
SqlIdColumnName = "agzcase.id",
|
|
SqlValueColumnName = "agzcase.caseid",
|
|
IsRowId = true
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Created",
|
|
FieldKey = "Created",
|
|
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
|
SqlValueColumnName = "agzcase.created"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "GZCaseClosed",
|
|
FieldKey = "GZCaseClosed",
|
|
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
|
SqlValueColumnName = "agzcase.closed"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "GZCaseName",
|
|
FieldKey = "GZCaseName",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "agzcase.name"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Tags",
|
|
FieldKey = "gzcasetags",
|
|
UiFieldDataType = (int)UiFieldDataType.Tags,
|
|
SqlValueColumnName = "agzcase.tags"
|
|
});
|
|
|
|
}
|
|
|
|
}//eoc
|
|
}//eons |