This commit is contained in:
2022-01-23 22:25:31 +00:00
parent b1d39d2a38
commit b16560116b
3 changed files with 22 additions and 23 deletions

View File

@@ -838,7 +838,7 @@ namespace AyaNova.Biz
l.Add(new FormField { TKey = "TechSignature", FieldKey = "TechSignature" });
l.Add(new FormField { TKey = "Tags", FieldKey = "Tags" });
l.Add(new FormField { TKey = "Wiki", FieldKey = "Wiki" });
l.Add(new FormField { TKey = "Attachments", FieldKey = "Attachments" });
l.Add(new FormField { TKey = "Attachments", FieldKey = "Attachments", Requireable = false });
l.Add(new FormField { TKey = "WorkOrderCustom1", FieldKey = "WorkOrderCustom1", IsCustomField = true });
l.Add(new FormField { TKey = "WorkOrderCustom2", FieldKey = "WorkOrderCustom2", IsCustomField = true });
l.Add(new FormField { TKey = "WorkOrderCustom3", FieldKey = "WorkOrderCustom3", IsCustomField = true });
@@ -861,11 +861,11 @@ namespace AyaNova.Biz
l.Add(new FormField { TKey = "WorkOrderItemTechNotes", FieldKey = "TechNotes", TKeySection = "WorkOrderItem" });
l.Add(new FormField { TKey = "Tags", FieldKey = "WorkOrderItemTags", TKeySection = "WorkOrderItem", ModelProperty="Tags" });
l.Add(new FormField { TKey = "Wiki", FieldKey = "WorkOrderItemWiki", TKeySection = "WorkOrderItem", ModelProperty="Wiki" });
l.Add(new FormField { TKey = "Attachments", FieldKey = "WorkOrderItemAttachments", TKeySection = "WorkOrderItem" });
l.Add(new FormField { TKey = "Attachments", FieldKey = "WorkOrderItemAttachments", TKeySection = "WorkOrderItem", Requireable = false });
l.Add(new FormField { TKey = "WorkOrderItemWorkOrderStatusID", FieldKey = "WorkOrderItemStatusId", TKeySection = "WorkOrderItem" });
l.Add(new FormField { TKey = "WorkOrderItemPriorityID", FieldKey = "WorkOrderItemPriorityId", TKeySection = "WorkOrderItem" });
l.Add(new FormField { TKey = "WorkOrderItemRequestDate", FieldKey = "RequestDate", TKeySection = "WorkOrderItem" });
l.Add(new FormField { TKey = "WorkOrderItemWarrantyService", FieldKey = "WorkOrderItemWarrantyService", TKeySection = "WorkOrderItem" });
l.Add(new FormField { TKey = "WorkOrderItemWarrantyService", FieldKey = "WarrantyService", TKeySection = "WorkOrderItem", Requireable = false });
l.Add(new FormField { TKey = "WorkOrderItemCustom1", FieldKey = "WorkOrderItemCustom1", IsCustomField = true, TKeySection = "WorkOrderItem" });
l.Add(new FormField { TKey = "WorkOrderItemCustom2", FieldKey = "WorkOrderItemCustom2", IsCustomField = true, TKeySection = "WorkOrderItem" });
l.Add(new FormField { TKey = "WorkOrderItemCustom3", FieldKey = "WorkOrderItemCustom3", IsCustomField = true, TKeySection = "WorkOrderItem" });
@@ -897,15 +897,14 @@ namespace AyaNova.Biz
l.Add(new FormField { TKey = "WorkOrderItemOutsideServiceList", FieldKey = "WorkOrderItemOutsideServiceList", TKeySection = "WorkOrderItem", Requireable = false });
//WORKORDER ITEM UNIT
l.Add(new FormField { TKey = "WorkOrderItemUnitNotes", FieldKey = "WorkOrderItemUnitNotes", TKeySection = "WorkOrderItemUnit" });
l.Add(new FormField { TKey = "Unit", FieldKey = "WorkOrderItemUnit", TKeySection = "WorkOrderItemUnit" });
l.Add(new FormField { TKey = "UnitModelVendorID", FieldKey = "UnitModelVendorID", TKeySection = "WorkOrderItemUnit" });
l.Add(new FormField { TKey = "UnitModelName", FieldKey = "UnitModelName", TKeySection = "WorkOrderItemUnit" });
l.Add(new FormField { TKey = "UnitDescription", FieldKey = "UnitDescription", TKeySection = "WorkOrderItemUnit" });
l.Add(new FormField { TKey = "Tags", FieldKey = "WorkOrderItemUnitTags", TKeySection = "WorkOrderItemUnit" });
l.Add(new FormField { TKey = "UnitWarrantyInfo", FieldKey = "UnitWarrantyInfo", TKeySection = "WorkOrderItemUnit" });
l.Add(new FormField { TKey = "Wiki", FieldKey = "WorkOrderItemUnitWiki", TKeySection = "WorkOrderItemUnit" });
l.Add(new FormField { TKey = "Attachments", FieldKey = "WorkOrderItemUnitAttachments", TKeySection = "WorkOrderItemUnit" });
l.Add(new FormField { TKey = "WorkOrderItemUnitNotes", FieldKey = "WorkOrderItemUnitNotes", TKeySection = "WorkOrderItemUnit", ModelProperty="Notes" });
l.Add(new FormField { TKey = "UnitModelVendorID", FieldKey = "UnitModelVendorID", TKeySection = "WorkOrderItemUnit", Requireable = false });
l.Add(new FormField { TKey = "UnitModelName", FieldKey = "UnitModelName", TKeySection = "WorkOrderItemUnit", Requireable = false });
l.Add(new FormField { TKey = "UnitDescription", FieldKey = "UnitDescription", TKeySection = "WorkOrderItemUnit", Requireable = false });
l.Add(new FormField { TKey = "Tags", FieldKey = "WorkOrderItemUnitTags", TKeySection = "WorkOrderItemUnit", ModelProperty="Tags" });
l.Add(new FormField { TKey = "UnitWarrantyInfo", FieldKey = "UnitWarrantyInfo", TKeySection = "WorkOrderItemUnit", Requireable = false });
l.Add(new FormField { TKey = "Wiki", FieldKey = "WorkOrderItemUnitWiki", TKeySection = "WorkOrderItemUnit", ModelProperty="Wiki" });
l.Add(new FormField { TKey = "Attachments", FieldKey = "WorkOrderItemUnitAttachments", TKeySection = "WorkOrderItemUnit", Requireable = false });
l.Add(new FormField { TKey = "WorkOrderItemUnitCustom1", FieldKey = "WorkOrderItemUnitCustom1", IsCustomField = true, TKeySection = "WorkOrderItemUnit" });
l.Add(new FormField { TKey = "WorkOrderItemUnitCustom2", FieldKey = "WorkOrderItemUnitCustom2", IsCustomField = true, TKeySection = "WorkOrderItemUnit" });
l.Add(new FormField { TKey = "WorkOrderItemUnitCustom3", FieldKey = "WorkOrderItemUnitCustom3", IsCustomField = true, TKeySection = "WorkOrderItemUnit" });

View File

@@ -30,7 +30,7 @@ namespace AyaNova.Biz
var proposedObjectType=proposedObject.GetType().ToString();
//don't validate custom fields, just skip them, make sure if it's sectional it matches the section of the object type (workorder sub sections)
if (!FF.IsCustomField && FF.TKeySection == null || proposedObjectType.EndsWith(FF.TKeySection))
if (!FF.IsCustomField && (FF.TKeySection == null || proposedObjectType.EndsWith(FF.TKeySection)))
{
//Now get the actual property name from the available fields using the lt key
string RequiredPropertyName = FF.FieldKey;

View File

@@ -2603,7 +2603,7 @@ namespace AyaNova.Biz
}
//Any form customizations to validate?
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrderItemExpense.ToString());
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrder.ToString());//all workorder sub items use the workorder key for customization
if (FormCustomization != null)
{
//Yeppers, do the validation, there are two, the custom fields and the regular fields that might be set to required
@@ -3010,7 +3010,7 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "NoChargeQuantity");
//Any form customizations to validate?
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrderItemLabor.ToString());
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrder.ToString());//all workorder sub items use the workorder key for customization
if (FormCustomization != null)
{
//Yeppers, do the validation, there are two, the custom fields and the regular fields that might be set to required
@@ -3452,7 +3452,7 @@ namespace AyaNova.Biz
//Any form customizations to validate?
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrderItemLoan.ToString());
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrder.ToString());//all workorder sub items use the workorder key for customization
if (FormCustomization != null)
{
//Yeppers, do the validation, there are two, the custom fields and the regular fields that might be set to required
@@ -3779,7 +3779,7 @@ namespace AyaNova.Biz
//Any form customizations to validate?
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrderItemOutsideService.ToString());
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrder.ToString());//all workorder sub items use the workorder key for customization
if (FormCustomization != null)
{
//Yeppers, do the validation, there are two, the custom fields and the regular fields that might be set to required
@@ -4728,7 +4728,7 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Quantity", await Translate("InventoryRoleRequired"));
//Any form customizations to validate?
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrderItemPart.ToString());
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrder.ToString());//all workorder sub items use the workorder key for customization
if (FormCustomization != null)
{
//Yeppers, do the validation, there are two, the custom fields and the regular fields that might be set to required
@@ -5021,7 +5021,7 @@ namespace AyaNova.Biz
proposedObj.Received = 0;//not a biz rule but a biz adaptation
//Any form customizations to validate?
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrderItemPartRequest.ToString());
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrder.ToString());//all workorder sub items use the workorder key for customization
if (FormCustomization != null)
{
//Yeppers, do the validation, there are two, the custom fields and the regular fields that might be set to required
@@ -5384,7 +5384,7 @@ namespace AyaNova.Biz
}
}
//Any form customizations to validate?
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrderItemScheduledUser.ToString());
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrder.ToString());//all workorder sub items use the workorder key for customization
if (FormCustomization != null)
{
//Yeppers, do the validation, there are two, the custom fields and the regular fields that might be set to required
@@ -5776,7 +5776,7 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Task");
//Any form customizations to validate?
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrderItemTask.ToString());
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrder.ToString());//all workorder sub items use the workorder key for customization
if (FormCustomization != null)
{
//Yeppers, do the validation, there are two, the custom fields and the regular fields that might be set to required
@@ -6165,7 +6165,7 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "NoChargeQuantity");
//Any form customizations to validate?
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrderItemTravel.ToString());
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrder.ToString());//all workorder sub items use the workorder key for customization
if (FormCustomization != null)
{
//Yeppers, do the validation, there are two, the custom fields and the regular fields that might be set to required
@@ -6500,7 +6500,7 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "UnitId");
//Any form customizations to validate?
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrderItemUnit.ToString());
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrder.ToString());//all workorder sub items use the workorder key for customization
if (FormCustomization != null)
{
//Yeppers, do the validation, there are two, the custom fields and the regular fields that might be set to required