From 5ab3c899fb6c57dfcbdd545860e5346710c903d8 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 12 Dec 2018 22:21:44 +0000 Subject: [PATCH] --- devdocs/todo.txt | 5 ++++- server/AyaNova/biz/AyDataType.cs | 4 +++- server/AyaNova/biz/FilterSqlCriteriaBuilder.cs | 2 +- server/AyaNova/biz/UserBiz.cs | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/devdocs/todo.txt b/devdocs/todo.txt index 7914acdd..fc71865d 100644 --- a/devdocs/todo.txt +++ b/devdocs/todo.txt @@ -16,7 +16,10 @@ Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOiIxNTQ0NTU5NzAwIiwiZXhwIjoi User - Create one filter and sort test that can be adapted for all other objects so we know each object has one basic test for it's filter and sort code - Probably just filter by name and sort by active to be most universal - + ENUM + - Need route to get enum values and lt by providing a lowercase name of the enum (used for building filter UI for enum types) + - Client needs to pick enum value adn display localized + NEXT - This should be the point that the lists code is concluded and can move on to the other SERVER items below then back to client stuff in the middle here diff --git a/server/AyaNova/biz/AyDataType.cs b/server/AyaNova/biz/AyDataType.cs index e9a92f78..e1225030 100644 --- a/server/AyaNova/biz/AyDataType.cs +++ b/server/AyaNova/biz/AyDataType.cs @@ -7,6 +7,8 @@ namespace AyaNova.Biz public const string Integer = "int"; public const string Bool = "bool"; public const string Decimal = "decimal"; - public const string Tags="tags"; + public const string Tags = "tags"; + public const string Enum = "enum";//enums are just integers in the db so the sql code handles it like an int, but the client needs to know it's an enum + } } diff --git a/server/AyaNova/biz/FilterSqlCriteriaBuilder.cs b/server/AyaNova/biz/FilterSqlCriteriaBuilder.cs index cf013b96..79ee44e8 100644 --- a/server/AyaNova/biz/FilterSqlCriteriaBuilder.cs +++ b/server/AyaNova/biz/FilterSqlCriteriaBuilder.cs @@ -635,7 +635,7 @@ namespace AyaNova.Biz } } break; - + case AyDataType.Enum://enums are just ints to the db, but it's a special type so the client can recognize it case AyDataType.Decimal: case AyDataType.Integer: //whole numbers, not only integer { diff --git a/server/AyaNova/biz/UserBiz.cs b/server/AyaNova/biz/UserBiz.cs index 6e231cde..746bdf90 100644 --- a/server/AyaNova/biz/UserBiz.cs +++ b/server/AyaNova/biz/UserBiz.cs @@ -155,6 +155,7 @@ namespace AyaNova.Biz AddField("active", "CommonActive", AyDataType.Bool). AddField("tags", "Tags", AyDataType.Tags). AddField("EmployeeNumber", "UserEmployeeNumber", AyDataType.Text). + AddField("usertype", "UserUserType", AyDataType.Enum). AddField("notes", "WidgetNotes", AyDataType.Text); if (localizeToLocaleId != 0) @@ -224,7 +225,7 @@ namespace AyaNova.Biz { cleanedItems.Append(CleanUserForReturn(item)); } - + var pageLinks = new PaginationLinkBuilder(Url, routeName, null, pagingOptions, totalRecordCount).PagingLinksObject(); ApiPagedResponse pr = new ApiPagedResponse(cleanedItems, pageLinks); return pr;