Added special case for DEWHV for new Id dialogs (duh)

This commit is contained in:
Daniel Schick 2024-08-12 16:09:27 +02:00
parent 40908e1bb3
commit 36b596709a
4 changed files with 23 additions and 3 deletions

View File

@ -79,6 +79,11 @@ namespace ENI2.Controls
portName = LocodeDB.PortNameFromLocode(value); break;
case RuleEngine.LocodeMode.SSN:
portName = LocodeDB.SSNPortNameFromLocode(value); break;
case RuleEngine.LocodeMode.OLD:
portName = LocodeDB.PortNameFromLocode(value);
if ((portName == null) && value.Equals("DEWHV"))
portName = "Stadthafen Wilhelmshaven";
break;
}
LocodeState locodeState = portName.IsNullOrEmpty() ? LocodeState.INVALID : LocodeState.OK;
this.SetLocodeStateImage(this.imageLocodeState, locodeState);
@ -164,6 +169,18 @@ namespace ENI2.Controls
portname = LocodeDB.PortNameFromLocode(directLocode); break;
case RuleEngine.LocodeMode.SSN:
portname = LocodeDB.SSNPortNameFromLocode(directLocode); break;
case RuleEngine.LocodeMode.OLD:
{
if (directLocode.Equals("DEWHV"))
{
portname = "Stadthafen Wilhelmshaven";
}
else
{
portname = LocodeDB.PortNameFromLocode(directLocode);
}
}
break;
}
bool isLocode = !portname.IsNullOrEmpty();
@ -191,6 +208,8 @@ namespace ENI2.Controls
locodeEntries = LocodeDB.AllLocodesForCityNameAsEntries(lookupString); break;
case RuleEngine.LocodeMode.SSN:
locodeEntries = LocalizedLookup.SSNAllLocodesForCityNameAsEntries(lookupString); break;
case RuleEngine.LocodeMode.OLD:
locodeEntries = LocodeDB.AllLocodesForCityNameAsEntries(lookupString); break;
}
locodeEntries.Sort();

View File

@ -60,7 +60,7 @@
ButtonSpinnerLocation="Right"
ParsingNumberStyle="Integer"
Watermark="Enter ENI" ValueChanged="doubleUpDownENI_ValueChanged" TextAlignment="Left"/>
<enictrl:LocodeControl Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2" Width="Auto" x:Name="locodePoC" />
<enictrl:LocodeControl Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2" Width="Auto" x:Name="locodePoC" LocodeSource="OLD" />
<DatePicker Name="datePickerETA" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" SelectedDateChanged="datePickerETA_SelectedDateChanged" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199">
<DatePicker.BlackoutDates>
<CalendarDateRange Start="1/1/0001" End="12/31/1799"/>

View File

@ -52,7 +52,7 @@
ButtonSpinnerLocation="Right"
ParsingNumberStyle="Integer"
Watermark="Enter ENI" ValueChanged="doubleUpDownENI_ValueChanged" TextAlignment="Left"/>
<enictrl:LocodeControl Grid.Column="1" Grid.Row="2" Width="Auto" x:Name="locodePoC" LocodeValue="{Binding PoC, Mode=TwoWay}" />
<enictrl:LocodeControl Grid.Column="1" Grid.Row="2" Width="Auto" x:Name="locodePoC" LocodeValue="{Binding PoC, Mode=TwoWay}" LocodeSource="OLD" />
<DatePicker Name="datePickerETA" Grid.Row="3" Grid.Column="1" Margin="2" SelectedDateChanged="datePickerETA_SelectedDateChanged" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
<DatePicker.BlackoutDates>
<CalendarDateRange Start="1/1/0001" End="12/31/1799"/>

View File

@ -101,7 +101,8 @@ namespace bsmd.database
{
STANDARD,
NO_PORT_FLAG,
SSN
SSN,
OLD // STANDARD + strange codes
};
public delegate bool LocodeValidHandler(string locode, LocodeMode mode);