This commit is contained in:
@@ -243,11 +243,21 @@ namespace AyaNova.Biz
|
||||
|
||||
//## Name is not required nor required to be unique for a UnitModel so no validation for that here
|
||||
//number is required but also not necessarily unique as two manufacturers could have the same model number for different products
|
||||
//However, a number and vendorid combo must be unique as it's considered that the same vendor would not have two models with identical numbers
|
||||
|
||||
//Number required
|
||||
if (string.IsNullOrWhiteSpace(proposedObj.Name))
|
||||
if (string.IsNullOrWhiteSpace(proposedObj.Number))
|
||||
{
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Number");
|
||||
return;//this is disqualifying outright so no need to check further rules
|
||||
}
|
||||
|
||||
//If Number is otherwise OK, check CONSTRAINT UNQ_UnitModelNumberVendorId UNIQUE (number, vendorid)
|
||||
if (await ct.UnitModel.AnyAsync(m => m.Number == proposedObj.Number && m.VendorId == proposedObj.VendorId && m.Id != proposedObj.Id))
|
||||
{
|
||||
AddError(ApiErrorCode.VALIDATION_NOT_UNIQUE, "Number", "Model number + Vendor must be unique");
|
||||
return;//this is disqualifying outright so no need to check further rules
|
||||
}
|
||||
|
||||
//Any form customizations to validate?
|
||||
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.UnitModel.ToString());
|
||||
|
||||
@@ -108,8 +108,8 @@
|
||||
"CustomerServiceRequestPriorityNotUrgent": "Nicht dringlich",
|
||||
"CustomerServiceRequestStatusAccepted": "Akzeptiert",
|
||||
"CustomerServiceRequestStatusClosed": "Geschlossen",
|
||||
"CustomerServiceRequestStatusDeclined": "Declined",
|
||||
"CustomerServiceRequestStatusOpen": "Open",
|
||||
"CustomerServiceRequestStatusDeclined": "Abgelehnt",
|
||||
"CustomerServiceRequestStatusOpen": "Öffnen",
|
||||
"CustomerServiceRequestCustom1": "Angepasstes Feld 1",
|
||||
"CustomerServiceRequestCustom2": "Angepasstes Feld 2",
|
||||
"CustomerServiceRequestCustom3": "Angepasstes Feld 3",
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
"CustomerServiceRequestPriorityNotUrgent": "Not urgent",
|
||||
"CustomerServiceRequestStatusAccepted": "Accepted",
|
||||
"CustomerServiceRequestStatusClosed": "Closed",
|
||||
"CustomerServiceRequestStatusDeclined": "Declined",
|
||||
"CustomerServiceRequestStatusDeclined": "Rejected",
|
||||
"CustomerServiceRequestStatusOpen": "Open",
|
||||
"CustomerServiceRequestCustom1": "Custom1",
|
||||
"CustomerServiceRequestCustom2": "Custom2",
|
||||
|
||||
@@ -108,8 +108,8 @@
|
||||
"CustomerServiceRequestPriorityNotUrgent": "No urgente",
|
||||
"CustomerServiceRequestStatusAccepted": "Aceptado",
|
||||
"CustomerServiceRequestStatusClosed": "Cerrado",
|
||||
"CustomerServiceRequestStatusDeclined": "Declined",
|
||||
"CustomerServiceRequestStatusOpen": "Open",
|
||||
"CustomerServiceRequestStatusDeclined": "Rechazado",
|
||||
"CustomerServiceRequestStatusOpen": "Abierto",
|
||||
"CustomerServiceRequestCustom1": "Campo personalizado 1",
|
||||
"CustomerServiceRequestCustom2": "Campo personalizado 2",
|
||||
"CustomerServiceRequestCustom3": "Campo personalizado 3",
|
||||
|
||||
@@ -108,8 +108,8 @@
|
||||
"CustomerServiceRequestPriorityNotUrgent": "Pas urgent",
|
||||
"CustomerServiceRequestStatusAccepted": "Accepté",
|
||||
"CustomerServiceRequestStatusClosed": "Fermé",
|
||||
"CustomerServiceRequestStatusDeclined": "Declined",
|
||||
"CustomerServiceRequestStatusOpen": "Open",
|
||||
"CustomerServiceRequestStatusDeclined": "Rejeté",
|
||||
"CustomerServiceRequestStatusOpen": "Ouvert",
|
||||
"CustomerServiceRequestCustom1": "Champ personnalisé 1",
|
||||
"CustomerServiceRequestCustom2": "Champ personnalisé 2",
|
||||
"CustomerServiceRequestCustom3": "Champ personnalisé 3",
|
||||
|
||||
Reference in New Issue
Block a user