This commit is contained in:
@@ -5,7 +5,7 @@ using Sockeye.Models;
|
||||
|
||||
namespace Sockeye.DataList
|
||||
{
|
||||
internal class GZCaseDataList : DataListProcessingBase
|
||||
internal class GZCaseDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||
{
|
||||
public GZCaseDataList(long translationId)
|
||||
{
|
||||
@@ -17,7 +17,7 @@ namespace Sockeye.DataList
|
||||
DefaultColumns = new List<string>() { "GZCaseId", "Tags", "GZCaseName", "GZCaseClosed" };
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "GZCaseId", "-" } };
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
@@ -62,7 +62,55 @@ namespace Sockeye.DataList
|
||||
SqlValueColumnName = "agzcase.tags"
|
||||
});
|
||||
|
||||
}
|
||||
//META column
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metacustomer",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "agzcase.customerid",
|
||||
SqlValueColumnName = "agzcase, IDataListInternalCriteria.customerid",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
}
|
||||
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)
|
||||
{
|
||||
//will be filtered from different types, show all records from Customer and nothing else at this time
|
||||
int nType = 0;
|
||||
if (!int.TryParse(crit[1], out nType)) return ret;
|
||||
SockType forType = (SockType)nType;
|
||||
if (forType != SockType.Customer) return ret;//only supports customer for now see workorderdatalist for alts
|
||||
|
||||
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.Customer:
|
||||
{
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metacustomer" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = crit[0], op = DataListFilterComparisonOperator.Equality });
|
||||
ret.Add(FilterOption);
|
||||
}
|
||||
break;
|
||||
// case AyaType.Project:
|
||||
// {
|
||||
// DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metaproject" };
|
||||
// FilterOption.Items.Add(new DataListColumnFilter() { value = crit[0], op = DataListFilterComparisonOperator.Equality });
|
||||
// ret.Add(FilterOption);
|
||||
// }
|
||||
// break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
Reference in New Issue
Block a user