Merged PR 34240: Updates to PCR3 document section

Updates to PCR3 document section
This commit is contained in:
Tucker Chase (CSC FI SPS MESLEO)
2025-01-15 16:52:17 +01:00
parent b99b721458
commit 123bbdb9fe
8 changed files with 64 additions and 63 deletions

View File

@ -19,6 +19,7 @@
@bind-Value="@document.DocNumbers"
@bind-Text="@document.DocNumbers"
Immediate
Required
AutoGrow
AutoFocus />
@if (DocNumberIsNA()) {
@ -49,8 +50,8 @@
</MudPaper>
</DialogContent>
<DialogActions>
@if ((DocNumberIsNA() && !string.IsNullOrWhiteSpace(document.Comment)) ||
(!DocNumberIsNA() && ecnNoIsValid)) {
@if (!string.IsNullOrWhiteSpace(document.DocNumbers) && ((DocNumberIsNA() && !string.IsNullOrWhiteSpace(document.Comment)) ||
(!DocNumberIsNA() && ecnNoIsValid))) {
<MudButton Variant="Variant.Filled"
Color="Color.Tertiary"
Class="m1-auto"
@ -111,6 +112,10 @@
document.CompletedDate = DateTime.Now;
}
if (string.IsNullOrWhiteSpace(document.DocNumbers)) {
throw new Exception("Document Numbers cannot be empty");
}
if (!DocNumberIsNA() && !ecnNoIsValid)
throw new Exception($"{document.ECNNumber} is not a valid ECN#");
if (DocNumberIsNA() && string.IsNullOrWhiteSpace(document.Comment))
@ -135,7 +140,9 @@
private bool DocNumberIsNA() {
if (document.DocNumbers.ToLower().Equals("na") ||
document.DocNumbers.ToLower().Equals("n/a")) {
document.DocNumbers.ToLower().Equals("n/a") ||
document.DocNumbers.ToLower().Equals("n a") ||
document.DocNumbers.ToLower().Equals("not applicable")) {
return true;
}
return false;