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" />
|
<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.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.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" />
|
<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" />
|
<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" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textContainerNo}" Binding="{Binding ContainerNumber}" IsReadOnly="True" Width="auto" />
|
||||||
|
|||||||
@ -121,7 +121,7 @@ namespace bsmd.database
|
|||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[ReportDisplayName("Expiry date")]
|
[ReportDisplayName("Expiry date")]
|
||||||
[Validation(ValidationCode.NOT_NULL)]
|
[Validation(ValidationCode.PAST_DATE)]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public DateTime? CrewMemberIdentityDocumentExpiryDate { get; set; }
|
public DateTime? CrewMemberIdentityDocumentExpiryDate { get; set; }
|
||||||
|
|
||||||
|
|||||||
@ -83,7 +83,7 @@ namespace bsmd.database
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
foreach (char c in str)
|
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);
|
sb.Append(c);
|
||||||
}
|
}
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
|
|||||||
@ -125,7 +125,7 @@ namespace bsmd.database
|
|||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[ReportDisplayName("Expiry date")]
|
[ReportDisplayName("Expiry date")]
|
||||||
[Validation(ValidationCode.NOT_NULL)]
|
[Validation(ValidationCode.PAST_DATE)]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public DateTime? PassengerIdentityDocumentExpiryDate { get; set; }
|
public DateTime? PassengerIdentityDocumentExpiryDate { get; set; }
|
||||||
|
|
||||||
|
|||||||
@ -354,6 +354,16 @@ namespace bsmd.database
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
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:
|
case ValidationCode.DOT_NO_COMMA:
|
||||||
{
|
{
|
||||||
if(!value.IsNullOrEmpty() && (value.Contains(",")))
|
if(!value.IsNullOrEmpty() && (value.Contains(",")))
|
||||||
|
|||||||
@ -50,8 +50,9 @@ namespace bsmd.database
|
|||||||
OPTIONAL_FLAG_CODE,
|
OPTIONAL_FLAG_CODE,
|
||||||
WORDOVERFLOW,
|
WORDOVERFLOW,
|
||||||
VALUE_TOO_LARGE,
|
VALUE_TOO_LARGE,
|
||||||
|
PAST_DATE,
|
||||||
V181 = 181,
|
V181 = 181,
|
||||||
V182,
|
V182,
|
||||||
E121 = 121,
|
E121 = 121,
|
||||||
E122 = 122,
|
E122 = 122,
|
||||||
E123 = 123,
|
E123 = 123,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user