8.0.3 release
This commit is contained in:
@@ -1687,8 +1687,8 @@ namespace AyaNova.Biz
|
||||
return null;
|
||||
else
|
||||
{
|
||||
if(newObject.UserId==0)
|
||||
newObject.UserId=UserId;
|
||||
if (newObject.UserId == 0)
|
||||
newObject.UserId = UserId;
|
||||
|
||||
await ct.WorkOrderState.AddAsync(newObject);
|
||||
var wo = await ct.WorkOrder.FirstOrDefaultAsync(x => x.Id == newObject.WorkOrderId);
|
||||
@@ -3261,12 +3261,13 @@ namespace AyaNova.Biz
|
||||
if (proposedObj.ServiceStartDate > proposedObj.ServiceStopDate)
|
||||
AddError(ApiErrorCode.VALIDATION_STARTDATE_AFTER_ENDDATE, "ServiceStartDate");
|
||||
|
||||
|
||||
//case 4171 removed
|
||||
// if (proposedObj.ServiceRateQuantity < 0)//negative quantities are not allowed
|
||||
// AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "ServiceRateQuantity");
|
||||
|
||||
if (proposedObj.NoChargeQuantity < 0)//negative quantities are not allowed
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "NoChargeQuantity");
|
||||
//case 4171 removed
|
||||
// if (proposedObj.NoChargeQuantity < 0)//negative quantities are not allowed
|
||||
// AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "NoChargeQuantity");
|
||||
|
||||
//Any form customizations to validate?
|
||||
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrder.ToString());//all workorder sub items use the workorder key for customization
|
||||
@@ -3703,11 +3704,12 @@ namespace AyaNova.Biz
|
||||
}
|
||||
}
|
||||
|
||||
if (proposedObj.LoanUnitId < 1 || !await ct.LoanUnit.AnyAsync(x => x.Id == proposedObj.LoanUnitId))
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "LoanUnitId");
|
||||
//case 4171 removed
|
||||
// if (proposedObj.LoanUnitId < 1 || !await ct.LoanUnit.AnyAsync(x => x.Id == proposedObj.LoanUnitId))
|
||||
// AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "LoanUnitId");
|
||||
|
||||
if (proposedObj.Quantity < 0)//negative quantities are not allowed
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Quantity");
|
||||
// if (proposedObj.Quantity < 0)//negative quantities are not allowed
|
||||
// AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Quantity");
|
||||
|
||||
|
||||
//Any form customizations to validate?
|
||||
@@ -5605,8 +5607,9 @@ namespace AyaNova.Biz
|
||||
}
|
||||
}
|
||||
|
||||
if (proposedObj.EstimatedQuantity < 0)//negative quantities are not allowed
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "EstimatedQuantity");
|
||||
//case 4171 removed
|
||||
// if (proposedObj.EstimatedQuantity < 0)//negative quantities are not allowed
|
||||
// AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "EstimatedQuantity");
|
||||
|
||||
|
||||
//Start date AND end date must both be null or both contain values
|
||||
@@ -6422,11 +6425,12 @@ namespace AyaNova.Biz
|
||||
return;
|
||||
}
|
||||
|
||||
if (proposedObj.TravelRateQuantity < 0)//negative quantities are not allowed
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "TravelRateQuantity");
|
||||
//case 4171 removed
|
||||
// if (proposedObj.TravelRateQuantity < 0)//negative quantities are not allowed
|
||||
// AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "TravelRateQuantity");
|
||||
|
||||
if (proposedObj.NoChargeQuantity < 0)//negative quantities are not allowed
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "NoChargeQuantity");
|
||||
// if (proposedObj.NoChargeQuantity < 0)//negative quantities are not allowed
|
||||
// AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "NoChargeQuantity");
|
||||
|
||||
//Any form customizations to validate?
|
||||
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrder.ToString());//all workorder sub items use the workorder key for customization
|
||||
@@ -6650,7 +6654,7 @@ namespace AyaNova.Biz
|
||||
//cache it
|
||||
var unitInfo = await ct.Unit.AsNoTracking()
|
||||
.Where(x => x.Id == o.UnitId)
|
||||
.Select(x => new { x.Serial, x.Description, x.UnitModelId, x.Address, x.City, x.Region, x.Country, x.Latitude, x.Longitude, x.Metered})
|
||||
.Select(x => new { x.Serial, x.Description, x.UnitModelId, x.Address, x.City, x.Region, x.Country, x.Latitude, x.Longitude, x.Metered })
|
||||
.FirstOrDefaultAsync();
|
||||
vc.Add(unitInfo.Serial, "unitserial", o.UnitId);
|
||||
vc.Add(unitInfo.Description, "unitdesc", o.UnitId);
|
||||
|
||||
Reference in New Issue
Block a user