ATA / ATD in Times. In between version with single field
This commit is contained in:
parent
1dfa4e7b5e
commit
5f7a4ab874
@ -8,7 +8,7 @@
|
||||
xmlns:db="clr-namespace:BreCalClient;assembly=BreCalClient"
|
||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
mc:Ignorable="d" Left="{local:SettingBinding W1Left}" Top="{local:SettingBinding W1Top}"
|
||||
Title="{x:Static p:Resources.textEditTimes}" Height="265" Width="400" Loaded="Window_Loaded" ResizeMode="NoResize" Icon="Resources/containership.ico">
|
||||
Title="{x:Static p:Resources.textEditTimes}" Height="293" Width="400" Loaded="Window_Loaded" ResizeMode="NoResize" Icon="Resources/containership.ico">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width=".25*" />
|
||||
@ -21,6 +21,7 @@
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="56" />
|
||||
<RowDefinition Height="28" />
|
||||
</Grid.RowDefinitions>
|
||||
@ -30,10 +31,11 @@
|
||||
<!-- Label Grid.Row="0" Grid.Column="2" Content="{x:Static p:Resources.textFixed}" /-->
|
||||
<Label Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textETABerth}" HorizontalContentAlignment="Right" x:Name="labelETA" />
|
||||
<Label Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textETDBerth}" HorizontalContentAlignment="Right" x:Name="labelETD" />
|
||||
<Label Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textLockTime}" HorizontalContentAlignment="Right" />
|
||||
<Label Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textZoneEntryTime}" HorizontalContentAlignment="Right" />
|
||||
<Label Grid.Row="3" Grid.Column="0" Content="ATA" HorizontalContentAlignment="Right" x:Name="labelATA" />
|
||||
<Label Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textLockTime}" HorizontalContentAlignment="Right" />
|
||||
<Label Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textZoneEntryTime}" HorizontalContentAlignment="Right" />
|
||||
|
||||
<Label Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textRemarks}" HorizontalContentAlignment="Right" />
|
||||
<Label Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textRemarks}" HorizontalContentAlignment="Right" />
|
||||
|
||||
<xctk:DateTimePicker IsEnabled="False" Grid.Row="1" Grid.Column="1" Margin="2" Name="datePickerETABerth" Format="Custom" FormatString="dd.MM. yyyy HH:mm">
|
||||
<xctk:DateTimePicker.ContextMenu>
|
||||
@ -46,7 +48,7 @@
|
||||
</ContextMenu>
|
||||
</xctk:DateTimePicker.ContextMenu>
|
||||
</xctk:DateTimePicker>
|
||||
<!--CheckBox IsEnabled="False" Grid.Row="1" Grid.Column="2" Margin="4,0,0,0" Name="checkBoxEtaBerthFixed" VerticalAlignment="Center" /-->
|
||||
|
||||
<xctk:DateTimePicker IsEnabled="False" Grid.Row="2" Grid.Column="1" Margin="2" Name="datePickerETDBerth" Format="Custom" FormatString="dd.MM. yyyy HH:mm">
|
||||
<xctk:DateTimePicker.ContextMenu>
|
||||
<ContextMenu>
|
||||
@ -58,8 +60,20 @@
|
||||
</ContextMenu>
|
||||
</xctk:DateTimePicker.ContextMenu>
|
||||
</xctk:DateTimePicker>
|
||||
<!--CheckBox IsEnabled="False" Grid.Row="2" Grid.Column="2" Margin="4,0,0,0" Name="checkBoxEtDBerthFixed" VerticalAlignment="Center" /-->
|
||||
<xctk:DateTimePicker IsEnabled="False" Grid.Row="3" Grid.Column="1" Margin="2" Name="datePickerLockTime" Format="Custom" FormatString="dd.MM. yyyy HH:mm">
|
||||
|
||||
<xctk:DateTimePicker IsEnabled="False" Grid.Row="3" Grid.Column="1" Margin="2" Name="datePickerATAATD" Format="Custom" FormatString="dd.MM. yyyy HH:mm">
|
||||
<xctk:DateTimePicker.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="{x:Static p:Resources.textClearValue}" Name="contextMenuItemClearATAATD" Click="contextMenuItemClearATAATD_Click" >
|
||||
<MenuItem.Icon>
|
||||
<Image Source="Resources\delete.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</xctk:DateTimePicker.ContextMenu>
|
||||
</xctk:DateTimePicker>
|
||||
|
||||
<xctk:DateTimePicker IsEnabled="False" Grid.Row="4" Grid.Column="1" Margin="2" Name="datePickerLockTime" Format="Custom" FormatString="dd.MM. yyyy HH:mm">
|
||||
<xctk:DateTimePicker.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="{x:Static p:Resources.textClearValue}" Name="contextMenuItemClearLockTime" Click="contextMenuItemClearLockTime_Click" >
|
||||
@ -71,7 +85,7 @@
|
||||
</xctk:DateTimePicker.ContextMenu>
|
||||
</xctk:DateTimePicker>
|
||||
<!--CheckBox IsEnabled="False" Grid.Row="3" Grid.Column="2" Margin="4,0,0,0" Name="checkBoxLockTimeFixed" VerticalAlignment="Center" /-->
|
||||
<xctk:DateTimePicker IsEnabled="False" Grid.Row="4" Grid.Column="1" Margin="2" Name="datePickerZoneEntry" Format="Custom" FormatString="dd.MM. yyyy HH:mm">
|
||||
<xctk:DateTimePicker IsEnabled="False" Grid.Row="5" Grid.Column="1" Margin="2" Name="datePickerZoneEntry" Format="Custom" FormatString="dd.MM. yyyy HH:mm">
|
||||
<xctk:DateTimePicker.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="{x:Static p:Resources.textClearValue}" Name="contextMenuItemClearZoneEntry" Click="contextMenuItemClearZoneEntry_Click" >
|
||||
@ -84,8 +98,8 @@
|
||||
</xctk:DateTimePicker>
|
||||
<!--CheckBox IsEnabled="False" Grid.Row="4" Grid.Column="2" Margin="4,0,0,0" Name="checkBoxZoneEntryFixed" VerticalAlignment="Center" /-->
|
||||
|
||||
<TextBox Grid.Row="5" Grid.Column="1" Margin="2" Name="textBoxRemarks" TextWrapping="Wrap" AcceptsReturn="True" SpellCheck.IsEnabled="True" AcceptsTab="False" IsEnabled="False" MaxLength="512"/>
|
||||
<StackPanel Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<TextBox Grid.Row="6" Grid.Column="1" Margin="2" Name="textBoxRemarks" TextWrapping="Wrap" AcceptsReturn="True" SpellCheck.IsEnabled="True" AcceptsTab="False" IsEnabled="False" MaxLength="512"/>
|
||||
<StackPanel Grid.Row="7" Grid.Column="1" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Width= "80" Margin="2" Content="{x:Static p:Resources.textOK}" x:Name="buttonOK" Click="buttonOK_Click" IsEnabled="False" />
|
||||
<Button Width="80" Margin="2" Content="{x:Static p:Resources.textCancel}" x:Name="buttonCancel" Click="buttonCancel_Click"/>
|
||||
</StackPanel>
|
||||
|
||||
@ -73,6 +73,7 @@ namespace BreCalClient
|
||||
this.Times.EtdBerth = this.datePickerETDBerth.Value;
|
||||
this.Times.LockTime = this.datePickerLockTime.Value;
|
||||
this.Times.ZoneEntry = this.datePickerZoneEntry.Value;
|
||||
this.Times.AtaAtd = this.datePickerATAATD.Value;
|
||||
}
|
||||
|
||||
private void CopyToControls()
|
||||
@ -82,6 +83,7 @@ namespace BreCalClient
|
||||
this.datePickerETDBerth.Value = this.Times.EtdBerth;
|
||||
this.datePickerLockTime.Value = this.Times.LockTime;
|
||||
this.datePickerZoneEntry.Value = this.Times.ZoneEntry;
|
||||
this.datePickerATAATD.Value = this.Times.AtaAtd;
|
||||
|
||||
this.labelETA.Content = string.Format("ETA {0}", BreCalLists.TimeRefs[this.ShipcallModel.Shipcall?.TimeRefPoint ?? 0]);
|
||||
this.labelETD.Content = string.Format("ETD {0}", BreCalLists.TimeRefs[this.ShipcallModel.Shipcall?.TimeRefPoint ?? 0]);
|
||||
@ -105,10 +107,22 @@ namespace BreCalClient
|
||||
private void EnableControls()
|
||||
{
|
||||
Extensions.ParticipantType pType = (Extensions.ParticipantType) this.Times.ParticipantType;
|
||||
|
||||
if (pType != Extensions.ParticipantType.MOORING)
|
||||
{
|
||||
this.labelATA.Visibility = Visibility.Hidden;
|
||||
this.datePickerATAATD.Visibility = Visibility.Hidden;
|
||||
}
|
||||
|
||||
if (this.Times.ParticipantId != App.Participant.Id)
|
||||
{
|
||||
this.buttonFixedOrder.IsEnabled = false;
|
||||
return; // if this is not "my" entry, there is no editing!
|
||||
}
|
||||
|
||||
if(ShipcallModel.Shipcall?.Type != ShipcallType.Arrival)
|
||||
{
|
||||
this.labelATA.Content = "ATD";
|
||||
}
|
||||
|
||||
switch (pType)
|
||||
@ -121,6 +135,7 @@ namespace BreCalClient
|
||||
this.datePickerLockTime.IsEnabled = (ShipcallModel.Shipcall?.Type == ShipcallType.Arrival || ShipcallModel.Shipcall?.Type == ShipcallType.Shifting);
|
||||
this.datePickerZoneEntry.IsEnabled = false;
|
||||
this.textBoxRemarks.IsEnabled = true;
|
||||
this.datePickerATAATD.IsEnabled = true;
|
||||
break;
|
||||
case Extensions.ParticipantType.PILOT:
|
||||
this.datePickerETABerth.IsEnabled = (ShipcallModel.Shipcall?.Type == ShipcallType.Arrival);
|
||||
@ -128,8 +143,11 @@ namespace BreCalClient
|
||||
this.datePickerLockTime.IsEnabled = (ShipcallModel.Shipcall?.Type == ShipcallType.Arrival || ShipcallModel.Shipcall?.Type == ShipcallType.Shifting);
|
||||
this.datePickerZoneEntry.IsEnabled = (ShipcallModel.Shipcall?.Type == ShipcallType.Arrival);
|
||||
this.textBoxRemarks.IsEnabled = true;
|
||||
this.datePickerATAATD.IsEnabled = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
this.buttonOK.IsEnabled = true;
|
||||
}
|
||||
|
||||
@ -169,10 +187,14 @@ namespace BreCalClient
|
||||
private void contextMenuItemClearZoneEntry_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.datePickerZoneEntry.Value = null;
|
||||
}
|
||||
|
||||
private void contextMenuItemClearATAATD_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.datePickerATAATD.Value = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user