This commit is contained in:
2018-11-29 18:01:05 +00:00
parent 7e3f6805ed
commit 563efd6d66
4 changed files with 32 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
namespace AyaNova.Biz namespace AyaNova.Biz
{ {
static class AyDataTypes public static class AyDataType
{ {
public const string Date = "date"; public const string Date = "date";
public const string Text = "text"; public const string Text = "text";

View File

@@ -17,6 +17,12 @@ namespace AyaNova.Biz
Key = key; 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 public class FilterField

View File

@@ -14,7 +14,7 @@ namespace AyaNova.Biz
{ {
//FILTEROPTIONS COLLECTION //FILTEROPTIONS COLLECTION
FilterOptions FilterOptions { get; set; } FilterOptions FilterOptions { get; }
//VALIDATE FILTER? //VALIDATE FILTER?

View File

@@ -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) 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); EventLogProcessor.LogEventToDatabase(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct);
//SEARCH INDEXING //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; return outObj;
@@ -225,7 +245,7 @@ namespace AyaNova.Biz
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct); EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
//Update keywords //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; return true;
} }
@@ -248,7 +268,7 @@ namespace AyaNova.Biz
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct); EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
//Update keywords //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; return true;
} }