This commit is contained in:
2021-07-29 23:49:16 +00:00
parent fb693fe457
commit ab00b7ec69
2 changed files with 23 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ namespace AyaNova.DataList
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "PMSerialNumber", "Customer", "PMNextServiceDate", "PMNextWoGenerateDate", "pmactive", "PMStopGeneratingDate" };
DefaultSortBy = new Dictionary<string, string>() { { "PMNextWoGenerateDate", "-" } };
DefaultSortBy = new Dictionary<string, string>() { { "PMSerialNumber", "-" } };
FieldDefinitions = new List<DataListFieldDefinition>();
FieldDefinitions.Add(new DataListFieldDefinition

View File

@@ -704,6 +704,28 @@ namespace AyaNova.Biz
}
//Did they exclude *all* days of the week (int value 127)
if ((int)proposedObj.ExcludeDaysOfWeek == 127)
{
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "ExcludeDaysOfWeek");
}
//GenerateBefore MUST be less than Repeat Interval or bad things happen
//normalizing to dates makes this easier
var dtNow = DateTime.UtcNow;
var dtGenBefore = CalculateNewDateFromSpanAndUnit(dtNow, proposedObj.GenerateBeforeUnit, proposedObj.GenerateBeforeInterval);
var dtRepeat = CalculateNewDateFromSpanAndUnit(dtNow, proposedObj.RepeatUnit, proposedObj.RepeatInterval);
if (!(dtGenBefore < dtRepeat))
{
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "GenerateBeforeInterval", "message here??");
}
/*
todo: quote status list first, it's a table of created items, keep properties from v7 but add the following properties: