diff --git a/server/AyaNova/biz/AyDataTypes.cs b/server/AyaNova/biz/AyDataType.cs similarity index 88% rename from server/AyaNova/biz/AyDataTypes.cs rename to server/AyaNova/biz/AyDataType.cs index b6aa0809..c9049cb9 100644 --- a/server/AyaNova/biz/AyDataTypes.cs +++ b/server/AyaNova/biz/AyDataType.cs @@ -1,6 +1,6 @@ namespace AyaNova.Biz { - static class AyDataTypes + public static class AyDataType { public const string Date = "date"; public const string Text = "text"; diff --git a/server/AyaNova/biz/FilterOptions.cs b/server/AyaNova/biz/FilterOptions.cs index 6e931a35..c2c1d451 100644 --- a/server/AyaNova/biz/FilterOptions.cs +++ b/server/AyaNova/biz/FilterOptions.cs @@ -17,6 +17,12 @@ namespace AyaNova.Biz Key = key; } + public FilterOptions AddField(string FieldName, string LocaleKey, string DataType) + { + Flds.Add(new FilterField() { Fld = FieldName, Lt = LocaleKey, Type = DataType }); + return this; + } + } public class FilterField diff --git a/server/AyaNova/biz/IFilterableObject.cs b/server/AyaNova/biz/IFilterableObject.cs index ee7c95ea..085c50fb 100644 --- a/server/AyaNova/biz/IFilterableObject.cs +++ b/server/AyaNova/biz/IFilterableObject.cs @@ -14,7 +14,7 @@ namespace AyaNova.Biz { //FILTEROPTIONS COLLECTION - FilterOptions FilterOptions { get; set; } + FilterOptions FilterOptions { get; } //VALIDATE FILTER? diff --git a/server/AyaNova/biz/WidgetBiz.cs b/server/AyaNova/biz/WidgetBiz.cs index fe29a0d6..d042e991 100644 --- a/server/AyaNova/biz/WidgetBiz.cs +++ b/server/AyaNova/biz/WidgetBiz.cs @@ -14,8 +14,28 @@ namespace AyaNova.Biz { - internal class WidgetBiz : BizObject, IJobObject + internal class WidgetBiz : BizObject, IJobObject, IFilterableObject { + private FilterOptions filterOptions = null; + public FilterOptions FilterOptions + { + get + { + if (filterOptions == null) + { + filterOptions = new FilterOptions("Widget"); + filterOptions. + AddField("Name", "WidgetName", AyDataType.Text). + AddField("Serial", "WidgetSerial", AyDataType.Text). + AddField("DollarAmount", "WidgetDollarAmount", AyDataType.Decimal). + AddField("Active", "WidgetActive", AyDataType.Bool). + AddField("StartDate", "WidgetStartDate", AyDataType.Date). + AddField("EndDate", "WidgetEndDate", AyDataType.Date); + + } + return filterOptions; + } + } internal WidgetBiz(AyContext dbcontext, long currentUserId, long userLocaleId, AuthorizationRoles UserRoles) { @@ -78,7 +98,7 @@ namespace AyaNova.Biz EventLogProcessor.LogEventToDatabase(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct); //SEARCH INDEXING - Search.ProcessNewObjectKeywords( UserLocaleId, outObj.Id, BizType, outObj.Name, outObj.Notes, outObj.Name, outObj.Serial.ToString()); + Search.ProcessNewObjectKeywords(UserLocaleId, outObj.Id, BizType, outObj.Name, outObj.Notes, outObj.Name, outObj.Serial.ToString()); return outObj; @@ -225,7 +245,7 @@ namespace AyaNova.Biz EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct); //Update keywords - Search.ProcessUpdatedObjectKeywords( UserLocaleId, dbObj.Id, BizType, dbObj.Name, dbObj.Notes, dbObj.Name, dbObj.Serial.ToString()); + Search.ProcessUpdatedObjectKeywords(UserLocaleId, dbObj.Id, BizType, dbObj.Name, dbObj.Notes, dbObj.Name, dbObj.Serial.ToString()); return true; } @@ -248,7 +268,7 @@ namespace AyaNova.Biz EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct); //Update keywords - Search.ProcessUpdatedObjectKeywords( UserLocaleId, dbObj.Id, BizType, dbObj.Name, dbObj.Notes, dbObj.Name, dbObj.Serial.ToString()); + Search.ProcessUpdatedObjectKeywords(UserLocaleId, dbObj.Id, BizType, dbObj.Name, dbObj.Notes, dbObj.Name, dbObj.Serial.ToString()); return true; }