CREW/PAS Dokument Validierung: Expiry date muss in der Zukunft liegen
This commit is contained in:
parent
a434dd3f72
commit
cccc2aee3c
@ -70,7 +70,7 @@
|
||||
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textExceptedQuantities}" Binding="{Binding ExceptedQuantities}" IsReadOnly="True" Width="auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textNetQuantity}" Binding="{Binding NetQuantity_KGM, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textGrossQuantity}" Binding="{Binding GrossQuantity_KGM, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textExceptedQuantities}" Binding="{Binding ExceptedQuantities, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
|
||||
<!--DataGridTextColumn Header="{x:Static p:Resources.textExceptedQuantities}" Binding="{Binding ExceptedQuantities, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" /-->
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCargoVolume}" Binding="{Binding Volume_MTQ, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
|
||||
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textGeneralCargo}" Binding="{Binding GeneralCargoIBC}" IsReadOnly="True" Width="auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textContainerNo}" Binding="{Binding ContainerNumber}" IsReadOnly="True" Width="auto" />
|
||||
|
||||
@ -121,7 +121,7 @@ namespace bsmd.database
|
||||
|
||||
[ShowReport]
|
||||
[ReportDisplayName("Expiry date")]
|
||||
[Validation(ValidationCode.NOT_NULL)]
|
||||
[Validation(ValidationCode.PAST_DATE)]
|
||||
[ENI2Validation]
|
||||
public DateTime? CrewMemberIdentityDocumentExpiryDate { get; set; }
|
||||
|
||||
|
||||
@ -83,7 +83,7 @@ namespace bsmd.database
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (char c in str)
|
||||
{
|
||||
if ((c > '\u0020' && c < '\u007E') || c == ' ' || c == '\t' || c == '\n')
|
||||
if (!char.IsControl(c) || c == ' ' || c == '\t' || c == '\n')
|
||||
sb.Append(c);
|
||||
}
|
||||
return sb.ToString();
|
||||
|
||||
@ -125,7 +125,7 @@ namespace bsmd.database
|
||||
|
||||
[ShowReport]
|
||||
[ReportDisplayName("Expiry date")]
|
||||
[Validation(ValidationCode.NOT_NULL)]
|
||||
[Validation(ValidationCode.PAST_DATE)]
|
||||
[ENI2Validation]
|
||||
public DateTime? PassengerIdentityDocumentExpiryDate { get; set; }
|
||||
|
||||
|
||||
@ -354,6 +354,16 @@ namespace bsmd.database
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ValidationCode.PAST_DATE:
|
||||
{
|
||||
if (value.Length == 0) errors.Add(RuleEngine.CreateError(ValidationCode.NOT_NULL, property.Name, value, entity.Title, identifier, entity.Tablename));
|
||||
if (DateTime.TryParse(value, out DateTime aTime))
|
||||
{
|
||||
if (aTime < DateTime.UtcNow)
|
||||
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ValidationCode.DOT_NO_COMMA:
|
||||
{
|
||||
if(!value.IsNullOrEmpty() && (value.Contains(",")))
|
||||
|
||||
@ -50,8 +50,9 @@ namespace bsmd.database
|
||||
OPTIONAL_FLAG_CODE,
|
||||
WORDOVERFLOW,
|
||||
VALUE_TOO_LARGE,
|
||||
PAST_DATE,
|
||||
V181 = 181,
|
||||
V182,
|
||||
V182,
|
||||
E121 = 121,
|
||||
E122 = 122,
|
||||
E123 = 123,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user