This commit is contained in:
2019-01-10 19:32:24 +00:00
parent 55266fd87f
commit d7c54cca70
3 changed files with 54 additions and 119 deletions

View File

@@ -80,35 +80,7 @@ namespace AyaNova.Biz
}
}
////////////////////////////////////////////////////////////////////////////////////////////////
//CREATE
internal FormCustom Create(AyContext TempContext, FormCustom inObj)
{
Validate(inObj, true);
if (HasErrors)
return null;
else
{
//do stuff with datafilter
FormCustom outObj = inObj;
outObj.OwnerId = UserId;
TempContext.FormCustom.Add(outObj);
TempContext.SaveChanges();
//Handle child and associated items:
//EVENT LOG
EventLogProcessor.LogEventToDatabase(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), TempContext);
//SEARCH INDEXING
// Search.ProcessNewObjectKeywords(UserLocaleId, outObj.Id, BizType, outObj.Name, outObj.Name);
return outObj;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////
/// GET
@@ -203,7 +175,28 @@ namespace AyaNova.Biz
try
{
var v = JArray.Parse(inObj.Template);
//Validate the following:
//FormKey is valid value
//All fields specified are valid values
//Field is allowed to be hidden if hidden
//Type is one of the valid types:
/*
public const string Date = "date";
public const string Text = "text";
public const string Integer = "int";
public const string Bool = "bool";
public const string Decimal = "decimal";
*/
//TODO: validate the json
/*
- JSON FRAGMENT holds items that differ from stock, no "core" fields allowed
- FieldKey
- Hide
- Required
- Type (checkbox, date, date time, decimal, number, picklist(FUTURE), and text)
*/
// for (int i = 0; i < v.Count; i++)
// {
// var filterItem = v[i];