added TrimStringConverter to avoid adding whitespace-only text
This commit is contained in:
parent
7dcaebd32d
commit
d36d625681
@ -7,6 +7,7 @@
|
||||
xmlns:local="clr-namespace:ENI2.DetailViewControls"
|
||||
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||
xmlns:p="clr-namespace:ENI2.Properties"
|
||||
xmlns:util="clr-namespace:ENI2.Util"
|
||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="600" d:DesignWidth="1024">
|
||||
@ -79,7 +80,7 @@
|
||||
<TextBox Name="textBoxStowawaysJoiningLocation" Grid.Row="11" Grid.RowSpan="3" Grid.Column="3" MaxLength="100" Text="{Binding StowawaysJoiningLocationText}" Margin="2" VerticalContentAlignment="Top"/>
|
||||
<CheckBox Name="checkBoxSickAnimalsOrPets" IsChecked="{Binding SickAnimalOrPetOnBoard}" Grid.Row="12" Grid.Column="1" VerticalAlignment="Center"/>
|
||||
<CheckBox Name="checkBoxSanitaryControlExemption" IsChecked="{Binding ValidSanitaryControlExemptionOrCertificateOnBoard}" Grid.Row="13" Grid.Column="1" VerticalAlignment="Center"/>
|
||||
<TextBox Name="textBoxPlaceOfIssue" Grid.Row="14" Grid.Column="1" MaxLength="100" Text="{Binding PlaceOfIssue}" Margin="2" />
|
||||
<TextBox Name="textBoxPlaceOfIssue" Grid.Row="14" Grid.Column="1" MaxLength="100" Text="{Binding PlaceOfIssue, Converter={util:TrimStringConverter}}" Margin="2" />
|
||||
<DatePicker Name="datePickerDateOfIssue" Grid.Row="14" Grid.Column="3" SelectedDate="{Binding DateOfIssue, Mode=TwoWay}" Margin="2" ContextMenu="{DynamicResource ClearContextMenu}" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
||||
<DatePicker.BlackoutDates>
|
||||
<CalendarDateRange Start="1/1/0001" End="12/31/1799"/>
|
||||
|
||||
@ -61,9 +61,9 @@
|
||||
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="3" Content="{x:Static p:Resources.textVisitTransitId}" Margin="0,0,10,0" />
|
||||
<TextBox Name="textBoxDisplayId" Grid.Row="0" Grid.Column="4" Grid.ColumnSpan="2" IsReadOnly="True" Margin="2" VerticalContentAlignment="Center" />
|
||||
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textIMO}" Margin="0,0,10,0" />
|
||||
<TextBox Name="textBoxIMO" Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="1" Text="{Binding IMO, Mode=TwoWay}" Margin="2" IsReadOnly="True" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxIMO" Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="1" Text="{Binding IMO, Mode=TwoWay, Converter={util:TrimStringConverter}}" Margin="2" IsReadOnly="True" VerticalContentAlignment="Center"/>
|
||||
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="3" Content="{x:Static p:Resources.textENI}" Margin="0,0,10,0" />
|
||||
<TextBox Name="textBoxENI" Grid.Row="1" Grid.Column="4" Grid.ColumnSpan="2" Text="{Binding ENI, Mode=TwoWay}" Margin="2" IsReadOnly="True" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxENI" Grid.Row="1" Grid.Column="4" Grid.ColumnSpan="2" Text="{Binding ENI, Mode=TwoWay, Converter={util:TrimStringConverter}}" Margin="2" IsReadOnly="True" VerticalContentAlignment="Center"/>
|
||||
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textETAPortOfCall}" Margin="0,0,10,0" />
|
||||
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="3" Content="{x:Static p:Resources.textETDPortOfCall}" Margin="0,0,10,0" />
|
||||
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textATAPortOfCall}" Margin="0,0,10,0" />
|
||||
@ -81,7 +81,7 @@
|
||||
<Image Source="../Resources/excel.png" Margin="10,0,5,0" Height="16"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<TextBox Name="textBoxTicketNo" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="2" Text="{Binding TicketNo, Mode=TwoWay}" Margin="2" VerticalContentAlignment="Center" MaxLength="50"/>
|
||||
<TextBox Name="textBoxTicketNo" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="2" Text="{Binding TicketNo, Mode=TwoWay, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center" MaxLength="50"/>
|
||||
|
||||
<Label Grid.Column="0" Grid.Row="6" Margin="0,0,10,0" HorizontalContentAlignment="Right" Name="labelBSMDStatusInternal" Content="{Binding BSMDStatusInternal, StringFormat={}{0}}" VerticalContentAlignment="Center" FontWeight="Bold" />
|
||||
<Button IsEnabled="True" Name="buttonStorno" Grid.Column="1" Grid.Row="6" Margin="2" Click="buttonStorno_Click" Content="{x:Static p:Resources.textCancelDeclaration}" Background="Red"/>
|
||||
|
||||
@ -38,13 +38,13 @@
|
||||
<Label Content="{x:Static p:Resources.textTankerCondition}" Grid.Column="0" Grid.Row="2" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxConditionCargoBallastTanks" Margin="2" SelectedIndex="{Binding ConditionCargoBallastTanks, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={util:ByteConverter}}" IsEnabled="{Binding ElementName=checkBoxTanker, Path=IsChecked}" ContextMenu="{DynamicResource ClearContextMenu}"/>
|
||||
<Label Content="{x:Static p:Resources.textTankerNatureOfCargo}" Grid.Column="0" Grid.Row="3" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||
<TextBox Text="{Binding NatureOfCargo, Mode=TwoWay}" Name="textBoxNatureOfCargo" Grid.Column="1" Grid.Row="3" Margin="2,2,2,2" IsEnabled="{Binding ElementName=checkBoxTanker, Path=IsChecked}" VerticalContentAlignment="Center" MaxLength="99" />
|
||||
<TextBox Text="{Binding NatureOfCargo, Mode=TwoWay, Converter={util:TrimStringConverter}}" Name="textBoxNatureOfCargo" Grid.Column="1" Grid.Row="3" Margin="2,2,2,2" IsEnabled="{Binding ElementName=checkBoxTanker, Path=IsChecked}" VerticalContentAlignment="Center" MaxLength="99" />
|
||||
<Label Content="{x:Static p:Resources.textTankerVolumeOfCargo}" Grid.Column="0" Grid.Row="4" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||
<xctk:DoubleUpDown Grid.Row="4" Grid.Column="1" Name="doubleUpDownVolumeOfCargo" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" FormatString="N3" Value="{Binding VolumeOfCargo, Mode=TwoWay}" IsEnabled="{Binding ElementName=checkBoxTanker, Path=IsChecked}" TextAlignment="Left"/>
|
||||
<Label Content="{x:Static p:Resources.textPlannedOperations}" Grid.Column="0" Grid.Row="5" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||
<TextBox Text="{Binding PlannedOperations, Mode=TwoWay}" Name="textBoxPlannedOperations" Grid.Column="1" Grid.Row="5" Margin="2,2,2,2" VerticalContentAlignment="Center" MaxLength="99"/>
|
||||
<TextBox Text="{Binding PlannedOperations, Mode=TwoWay, Converter={util:TrimStringConverter}}" Name="textBoxPlannedOperations" Grid.Column="1" Grid.Row="5" Margin="2,2,2,2" VerticalContentAlignment="Center" MaxLength="99"/>
|
||||
<Label Content="{x:Static p:Resources.textPlannedInspection}" Grid.Column="0" Grid.Row="6" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||
<TextBox Text="{Binding PlannedWorks, Mode=TwoWay}" Name="textBoxPlannedWorks" Grid.Column="1" Grid.Row="6" Margin="2,2,2,2" MaxLength="255" />
|
||||
<TextBox Text="{Binding PlannedWorks, Mode=TwoWay, Converter={util:TrimStringConverter}}" Name="textBoxPlannedWorks" Grid.Column="1" Grid.Row="6" Margin="2,2,2,2" MaxLength="255" />
|
||||
<Label Content="{x:Static p:Resources.textLastExpandedInspection }" Grid.Column="0" Grid.Row="7" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||
<DatePicker Grid.Column="1" Grid.Row="7" Name="datePickerLastExpandedInspection" VerticalAlignment="Center" SelectedDate="{Binding DateOfLastExpandedInspection, Mode=TwoWay}" Margin="2,2,2,2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
||||
<DatePicker.BlackoutDates>
|
||||
|
||||
@ -98,16 +98,16 @@
|
||||
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="2" Content="{x:Static p:Resources.textAgentTemplate}" Name="labelAgentTemplate" Margin="0,0,10,0"/>
|
||||
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="2" Content="{x:Static p:Resources.textTitle}" Name="labelAgentTemplateTitle" Margin="0,0,10,0" Visibility="Hidden" />
|
||||
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Name="textBox_AgentCompanyName" MaxLength="99" Margin="2" Text="{Binding AgentCompanyName}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Name="textBox_AgentStreetAndNumber" MaxLength="99" Margin="2" Text="{Binding AgentStreetAndNumber}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Name="textBox_AgentPostalCode" MaxLength="99" Margin="2" Text="{Binding AgentPostalCode}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="3" Name="textBox_AgentCity" MaxLength="99" Margin="2" Text="{Binding AgentCity}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="1" Name="textBox_AgentCountry" MaxLength="99" Margin="2" Text="{Binding AgentCountry}" VerticalContentAlignment="Center" />
|
||||
<TextBox Grid.Row="5" Grid.Column="1" Name="textBox_AgentLastName" MaxLength="99" Margin="2" Text="{Binding AgentLastName}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="6" Grid.Column="3" Name="textBox_AgentFirstName" MaxLength="99" Margin="2" Text="{Binding AgentFirstName}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="6" Grid.Column="1" Name="textBox_AgentPhone" MaxLength="99" Margin="2" Text="{Binding AgentPhone}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="7" Grid.Column="3" Name="textBox_AgentFax" MaxLength="99" Margin="2" Text="{Binding AgentFax}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="7" Grid.Column="1" Name="textBox_AgentEMail" MaxLength="99" Margin="2" Text="{Binding AgentEMail}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Name="textBox_AgentCompanyName" MaxLength="99" Margin="2" Text="{Binding AgentCompanyName, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Name="textBox_AgentStreetAndNumber" MaxLength="99" Margin="2" Text="{Binding AgentStreetAndNumber, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Name="textBox_AgentPostalCode" MaxLength="99" Margin="2" Text="{Binding AgentPostalCode, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="3" Name="textBox_AgentCity" MaxLength="99" Margin="2" Text="{Binding AgentCity, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="1" Name="textBox_AgentCountry" MaxLength="99" Margin="2" Text="{Binding AgentCountry, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center" />
|
||||
<TextBox Grid.Row="5" Grid.Column="1" Name="textBox_AgentLastName" MaxLength="99" Margin="2" Text="{Binding AgentLastName, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="6" Grid.Column="3" Name="textBox_AgentFirstName" MaxLength="99" Margin="2" Text="{Binding AgentFirstName, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="6" Grid.Column="1" Name="textBox_AgentPhone" MaxLength="99" Margin="2" Text="{Binding AgentPhone, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="7" Grid.Column="3" Name="textBox_AgentFax" MaxLength="99" Margin="2" Text="{Binding AgentFax, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="7" Grid.Column="1" Name="textBox_AgentEMail" MaxLength="99" Margin="2" Text="{Binding AgentEMail, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||
|
||||
<ComboBox Grid.Row="0" Grid.Column="3" Name="comboBox_AgentTemplate" Margin="2" SelectedValuePath="Id" DisplayMemberPath="AgentTitle" SelectionChanged="comboBox_AgentTemplate_SelectionChanged" />
|
||||
<Grid Grid.Column="2" Grid.Row="1" HorizontalAlignment="Right">
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
<ColumnDefinition Width="5*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textNameMaster}" Name="label_nameMaster" Margin="0,0,10,0"/>
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Name="textBox_NameMaster" MaxLength="100" Margin="2" Text="{Binding NameOfMaster}" VerticalContentAlignment="Center" VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Name="textBox_NameMaster" MaxLength="100" Margin="2" Text="{Binding NameOfMaster, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Name="infoGroupBox" Header="{x:Static p:Resources.textInfo}" Grid.Row="1" Margin="0,5,0,5">
|
||||
@ -70,13 +70,13 @@
|
||||
<ComboBox Grid.Row="0" Grid.Column="1" x:Name="comboBoxShippingArea" Margin="2" SelectedIndex="{Binding ShippingArea, Converter={util:ByteConverter}}" ContextMenu="{DynamicResource ClearContextMenu}" />
|
||||
<ComboBox Grid.Row="0" Grid.Column="3" x:Name="comboBoxGroup" Margin="0,2,4,2" ItemsSource="{StaticResource arrList}" DisplayMemberPath="Key" SelectedValuePath="Value" SelectionChanged="comboBoxGroup_SelectionChanged"/>
|
||||
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxPortArea" Margin="2" SelectedValue="{Binding PortArea}" SelectedValuePath="Key" DisplayMemberPath="Value" ContextMenu="{DynamicResource ClearContextMenu}" />
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Name="textRequestedPostionInPortOfCall" Margin="2" Text="{Binding RequestedPositionInPortOfCall}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="1" Name="textBowThrusterPower" Margin="2" Text="{Binding BowThrusterPower}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="4" Grid.Column="1" Name="textSternThrusterPower" Margin="2" Text="{Binding SternThrusterPower}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Name="textRequestedPostionInPortOfCall" Margin="2" Text="{Binding RequestedPositionInPortOfCall, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="1" Name="textBowThrusterPower" Margin="2" Text="{Binding BowThrusterPower, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="4" Grid.Column="1" Name="textSternThrusterPower" Margin="2" Text="{Binding SternThrusterPower, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||
<CheckBox Grid.Row="5" Grid.Column="1" Name="checkBoxFumigatedBulkCargo" VerticalContentAlignment="Center" IsChecked="{Binding FumigatedBulkCargoBool, Mode=TwoWay}" Margin="2"/>
|
||||
<xctk:DoubleUpDown Grid.Row="6" Grid.Column="1" Name="doubleUpDownDisplacementSummerDraught" ShowButtonSpinner="False" ParsingNumberStyle="Any" Value="{Binding DeplacementSummerDraught_TNE}" Margin="4,2,0,2" FormatString="N1" TextAlignment="Left"/>
|
||||
<TextBox Grid.Row="2" Grid.Column="3" Grid.RowSpan="2" Name="textSpecialRequirements" Margin="2" Text="{Binding SpecialRequirementsOfShipAtBerth}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="4" Grid.Column="3" Grid.RowSpan="2" Name="textConstructionCharacteristics" Margin="2" Text="{Binding ConstructionCharacteristicsOfShip}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="2" Grid.Column="3" Grid.RowSpan="2" Name="textSpecialRequirements" Margin="2" Text="{Binding SpecialRequirementsOfShipAtBerth, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||
<TextBox Grid.Row="4" Grid.Column="3" Grid.RowSpan="2" Name="textConstructionCharacteristics" Margin="2" Text="{Binding ConstructionCharacteristicsOfShip, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Name="servGroupBox" Header="{x:Static p:Resources.textServ}" Grid.Row="2">
|
||||
|
||||
@ -74,13 +74,13 @@
|
||||
<ComboBox Name="comboBoxCurrentShipSecurityLevel" Grid.Row="3" Grid.Column="1" SelectedValue="{Binding CurrentShipSecurityLevel}" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
||||
<CheckBox Name="checkBoxSECSimplification" IsChecked="{Binding SECSimplification}" Grid.Row="5" Grid.Column="1" VerticalAlignment="Center"/>
|
||||
<enictrl:LocodeControl x:Name="locodePortOfCallWhereCompleteSECNotified" Grid.Row="6" Grid.Column="1" LocodeValue="{Binding PortOfCallWhereCompleteSECNotified, Mode=TwoWay}" />
|
||||
<TextBox Name="textBoxCSOFirstName" Grid.Row="8" Grid.Column="1" MaxLength="100" Text="{Binding CSOFirstName}" Margin="2" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxCSOLastName" Grid.Row="8" Grid.Column="3" MaxLength="100" Text="{Binding CSOLastName}" Margin="2" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxCSOPhoneName" Grid.Row="9" Grid.Column="1" MaxLength="100" Text="{Binding CSOPhone}" Margin="2" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxCSOFaxName" Grid.Row="9" Grid.Column="3" MaxLength="100" Text="{Binding CSOFax}" Margin="2" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxCSOEMailName" Grid.Row="10" Grid.Column="1" MaxLength="100" Text="{Binding CSOEMail}" Margin="2" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxCSOFirstName" Grid.Row="8" Grid.Column="1" MaxLength="100" Text="{Binding CSOFirstName, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxCSOLastName" Grid.Row="8" Grid.Column="3" MaxLength="100" Text="{Binding CSOLastName, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxCSOPhoneName" Grid.Row="9" Grid.Column="1" MaxLength="100" Text="{Binding CSOPhone, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxCSOFaxName" Grid.Row="9" Grid.Column="3" MaxLength="100" Text="{Binding CSOFax, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxCSOEMailName" Grid.Row="10" Grid.Column="1" MaxLength="100" Text="{Binding CSOEMail, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center"/>
|
||||
<CheckBox Name="checkBoxValidISSCOnBoard" IsChecked="{Binding ValidISSCOnBoard}" Grid.Row="13" Grid.Column="1" VerticalAlignment="Center"/>
|
||||
<TextBox Name="textBoxReasonsForNoValidISSC" Grid.Row="13" Grid.Column="3" MaxLength="255" Text="{Binding ReasonsForNoValidISSC}" Margin="2" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxReasonsForNoValidISSC" Grid.Row="13" Grid.Column="3" MaxLength="255" Text="{Binding ReasonsForNoValidISSC, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center"/>
|
||||
<ComboBox Name="comboBoxISSCType" Grid.Row="14" Grid.Column="1" SelectedIndex="{Binding ISSCType, Converter={util:ByteConverter}}" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True"/>
|
||||
<ComboBox Name="comboBoxISSCIssuerType" Grid.Row="14" Grid.Column="3" SelectedIndex="{Binding ISSCIssuerType, Converter={util:ByteConverter}}" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True"/>
|
||||
<DatePicker Name="datePickerISSCDateOfExpiration" Grid.Row="15" Grid.Column="1" SelectedDate="{Binding ISSCDateOfExpiration}" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
||||
@ -90,9 +90,9 @@
|
||||
</DatePicker.BlackoutDates>
|
||||
|
||||
</DatePicker>
|
||||
<TextBox Name="textBoxISSCIssuerName" Grid.Row="15" Grid.Column="3" MaxLength="100" Text="{Binding ISSCIssuerName}" Margin="2" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxISSCIssuerName" Grid.Row="15" Grid.Column="3" MaxLength="100" Text="{Binding ISSCIssuerName, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center"/>
|
||||
<CheckBox Name="checkBoxApprovedSecurityPlanOnBoard" IsChecked="{Binding ApprovedSecurityPlanOnBoard}" Grid.Row="17" Grid.Column="1" VerticalAlignment="Center"/>
|
||||
<TextBox Name="textBoxPortFacilityOfArrival" Grid.Row="18" Grid.Column="1" MaxLength="100" Text="{Binding PortFacilityOfArrival}" Margin="2" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxPortFacilityOfArrival" Grid.Row="18" Grid.Column="1" MaxLength="100" Text="{Binding PortFacilityOfArrival, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center"/>
|
||||
<ComboBox Name="comboBoxGeneralDescriptionOfCargo" Grid.Row="18" Grid.Column="3" IsEditable="True" StaysOpenOnEdit="True" SelectedIndex="{Binding GeneralDescriptionOfCargo, Converter={util:ByteConverter}}" Margin="2" IsTextSearchEnabled="True"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||
xmlns:util="clr-namespace:ENI2.Util"
|
||||
xmlns:p="clr-namespace:ENI2.Properties"
|
||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
xmlns:local="clr-namespace:ENI2.DetailViewControls"
|
||||
@ -51,9 +52,9 @@
|
||||
<Label HorizontalContentAlignment="Right" Grid.Row="6" Grid.Column="3" Content="{x:Static p:Resources.textInmarsatCallNumber}" Margin="0,0,10,0" />
|
||||
<Label HorizontalContentAlignment="Right" Grid.Row="7" Grid.Column="3" Content="{x:Static p:Resources.textLimitCallNumbers}" Margin="0,0,10,0" />
|
||||
|
||||
<TextBox Name="textBoxVesselName" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2" Text="{Binding ShipName}" Margin="2" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxVesselName" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2" Text="{Binding ShipName, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center"/>
|
||||
<ComboBox Name="comboBoxVesselType" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" SelectedValue="{Binding ShipType}" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
||||
<TextBox Name="textBoxCallsign" Grid.Column="4" Grid.Row="1" Text="{Binding CallSign}" Margin="2" VerticalContentAlignment="Center" MaxLength="7"/>
|
||||
<TextBox Name="textBoxCallsign" Grid.Column="4" Grid.Row="1" Text="{Binding CallSign, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center" MaxLength="7"/>
|
||||
<ComboBox Name="comboBoxTransportMode" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="2" Margin="2" SelectedValue="{Binding TransportMode}" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
||||
<ComboBox Name="comboBoxFlag" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2" Margin="2" SelectedValue="{Binding Flag}" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
||||
<enictrl:LocodeControl x:Name="locodePortOfRegistry" Grid.Column="4" Grid.Row="3" Grid.ColumnSpan="2" LocodeValue="{Binding PortOfRegistry, Mode=TwoWay}" LocodeSource="NO_PORT_FLAG" />
|
||||
@ -64,8 +65,8 @@
|
||||
<Label Content="m" Grid.Column="2" Grid.Row="5" />
|
||||
<xctk:DoubleUpDown Name="doubleUpDownBeam" Grid.Column="4" Grid.Row="5" Margin="2" Value="{Binding Beam_MTR}" ShowButtonSpinner="False" TextAlignment="Left" ParsingNumberStyle="Any" FormatString="N2" />
|
||||
<Label Content="m" Grid.Column="5" Grid.Row="5" />
|
||||
<TextBox Name="textBoxMMSI" Grid.Column="1" Grid.Row="6" Margin="2" Text="{Binding MMSINumber}" VerticalContentAlignment="Center" MaxLength="10"/>
|
||||
<TextBox Name="textBoxInmarsatCallNumber" Grid.Column="4" Grid.ColumnSpan="2" Grid.Row="6" Grid.RowSpan="2" Margin="2" Text="{Binding InmarsatCallNumber}"
|
||||
<TextBox Name="textBoxMMSI" Grid.Column="1" Grid.Row="6" Margin="2" Text="{Binding MMSINumber, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center" MaxLength="10"/>
|
||||
<TextBox Name="textBoxInmarsatCallNumber" Grid.Column="4" Grid.ColumnSpan="2" Grid.Row="6" Grid.RowSpan="2" Margin="2" Text="{Binding InmarsatCallNumber, Converter={util:TrimStringConverter}}"
|
||||
VerticalContentAlignment="Top" TextWrapping="Wrap" AcceptsReturn="True" />
|
||||
|
||||
</Grid>
|
||||
@ -93,12 +94,12 @@
|
||||
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="3" Content="{x:Static p:Resources.textCompanyId}" Margin="0,0,10,0" />
|
||||
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="3" Content="{x:Static p:Resources.textCity}" Margin="0,0,10,0" />
|
||||
|
||||
<TextBox Name="textBoxCompanyName" Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyName}" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxCompanyId" Grid.Row="0" Grid.Column="4" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyId}" MaxLength="7" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxStreetNumber" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyStreetAndNumber}" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxCity" Grid.Row="1" Grid.Column="4" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyCity}" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxPostalCode" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="1" Margin="2" Text="{Binding ISMCompanyPostalCode}" MaxLength="24" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxCountry" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyCountry}" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxCompanyName" Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyName, Converter={util:TrimStringConverter}}" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxCompanyId" Grid.Row="0" Grid.Column="4" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyId, Converter={util:TrimStringConverter}}" MaxLength="7" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxStreetNumber" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyStreetAndNumber, Converter={util:TrimStringConverter}}" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxCity" Grid.Row="1" Grid.Column="4" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyCity, Converter={util:TrimStringConverter}}" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxPostalCode" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="1" Margin="2" Text="{Binding ISMCompanyPostalCode, Converter={util:TrimStringConverter}}" MaxLength="24" VerticalContentAlignment="Center"/>
|
||||
<TextBox Name="textBoxCountry" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyCountry, Converter={util:TrimStringConverter}}" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
@ -53,7 +53,7 @@
|
||||
</DatePicker.BlackoutDates>
|
||||
</DatePicker>
|
||||
<enictrl:LocodeControl Grid.Row="2" Grid.Column="1" x:Name="locodeCtrlLastWastePort" LocodeValue="{Binding LastWasteDisposalPort, Mode=TwoWay}" LocodeSource="SSN" />
|
||||
<TextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Grid.RowSpan="2" Name="textBoxWasteDisposalServiceProviders" Text="{Binding WasteDisposalServiceProviderText}" Margin="2" />
|
||||
<TextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Grid.RowSpan="2" Name="textBoxWasteDisposalServiceProviders" Text="{Binding WasteDisposalServiceProviderText, Converter={util:TrimStringConverter}}" Margin="2" />
|
||||
<Button Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="1" Name="buttonAddMissingEntries" Content="{x:Static p:Resources.textAddMissingEntries}" Margin="2" Click="buttonAddMissingEntries_Click"/>
|
||||
<Button Grid.Row="6" Grid.Column="2" Grid.ColumnSpan="1" Name="buttonImportFromExcel" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Click="buttonImportFromExcel_Click" />
|
||||
</Grid>
|
||||
|
||||
@ -36,8 +36,8 @@
|
||||
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
|
||||
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
||||
<WebPage>publish.html</WebPage>
|
||||
<ApplicationRevision>3</ApplicationRevision>
|
||||
<ApplicationVersion>7.1.0.3</ApplicationVersion>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>7.2.0.0</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||
@ -428,6 +428,7 @@
|
||||
<Compile Include="Util\HighlightService.cs" />
|
||||
<Compile Include="Util\InverseBooleanConverter.cs" />
|
||||
<Compile Include="Util\NullImageConverter.cs" />
|
||||
<Compile Include="Util\TrimStringConverter.cs" />
|
||||
<Compile Include="Util\UIHelper.cs" />
|
||||
<Compile Include="Util\UtcToLocalDateTimeConverter.cs" />
|
||||
<Compile Include="Util\ValidationContext.cs" />
|
||||
|
||||
@ -1052,7 +1052,8 @@ namespace ENI2.Excel
|
||||
}
|
||||
ladg.CargoHandlingType = ladgOperation;
|
||||
ladg.CargoLACode = (int?) reader.ReadCellAsDecimal("cargo", string.Format("C{0}", i + 9));
|
||||
ladg.CargoCodeNST = reader.ReadCellAsText("cargo", string.Format("D{0}", i + 9))?.Substring(0, 2);
|
||||
ladg.CargoCodeNST = reader.ReadCellAsText("cargo", string.Format("D{0}", i + 9));
|
||||
if(ladg.CargoCodeNST?.Length > 2) ladg.CargoCodeNST = ladg.CargoCodeNST.Substring(0, 2);
|
||||
ladg.CargoCodeNST_3 = reader.ReadCellAsText("cargo", string.Format("E{0}", i + 9));
|
||||
ladg.CargoNumberOfItems = (int?)reader.ReadCellAsDecimal("cargo", string.Format("F{0}", i + 9));
|
||||
ladg.CargoGrossQuantity_TNE = reader.ReadCellAsDecimal("cargo", string.Format("G{0}", i + 9));
|
||||
|
||||
41
ENI2/Util/TrimStringConverter.cs
Normal file
41
ENI2/Util/TrimStringConverter.cs
Normal file
@ -0,0 +1,41 @@
|
||||
// Copyright (c) 2017-present schick Informatik
|
||||
// Description: Converter to create trimmed entries for plaintext input text fields
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Markup;
|
||||
|
||||
using bsmd.database;
|
||||
|
||||
namespace ENI2.Util
|
||||
{
|
||||
[ValueConversion(typeof(string), typeof(string))]
|
||||
public class TrimStringConverter : MarkupExtension, IValueConverter
|
||||
{
|
||||
private TrimStringConverter _converter;
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (!((string)value).IsNullOrEmpty())
|
||||
{
|
||||
return ((string)value).Trim();
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||
{
|
||||
if (_converter == null)
|
||||
{
|
||||
_converter = new TrimStringConverter();
|
||||
}
|
||||
return _converter;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user