From 623faa25e1d8ce1d92e98c7503f7b9446d75d405 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 29 Dec 2020 21:59:35 +0000 Subject: [PATCH] --- server/AyaNova/biz/ServiceBankBiz.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/server/AyaNova/biz/ServiceBankBiz.cs b/server/AyaNova/biz/ServiceBankBiz.cs index 0a3cbd23..b45597c2 100644 --- a/server/AyaNova/biz/ServiceBankBiz.cs +++ b/server/AyaNova/biz/ServiceBankBiz.cs @@ -154,6 +154,22 @@ namespace AyaNova.Biz return; } + //valid previous columns? + //either they're all null or none of them are null + if ((proposedObj.LastEntryDate == null + && proposedObj.LastCurrencyBalance == null + && proposedObj.LastHoursBalance == null + && proposedObj.LastIncidentsBalance == null) || + (proposedObj.LastEntryDate != null + && proposedObj.LastCurrencyBalance != null + && proposedObj.LastHoursBalance != null + && proposedObj.LastIncidentsBalance != null) + ) + { + AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "generalerror", "Last* entries must be all empty (opening entry) or none of them empty (any later entry)"); + return; + } + //Any form customizations to validate?