Fixed orders part 1
This commit is contained in:
parent
0ca8e1f916
commit
b8c0d665af
@ -34,6 +34,8 @@
|
||||
<None Remove="Resources\delete2.png" />
|
||||
<None Remove="Resources\edit.png" />
|
||||
<None Remove="Resources\emergency_stop_button.png" />
|
||||
<None Remove="Resources\lock.png" />
|
||||
<None Remove="Resources\lock_open.png" />
|
||||
<None Remove="Resources\logo_bremen_calling.png" />
|
||||
<None Remove="Resources\ship2.png" />
|
||||
<None Remove="Resources\sign_warning.png" />
|
||||
@ -87,6 +89,8 @@
|
||||
<Resource Include="Resources\delete2.png" />
|
||||
<Resource Include="Resources\edit.png" />
|
||||
<Resource Include="Resources\emergency_stop_button.png" />
|
||||
<Resource Include="Resources\lock.png" />
|
||||
<Resource Include="Resources\lock_open.png" />
|
||||
<Resource Include="Resources\logo_bremen_calling.png" />
|
||||
<Resource Include="Resources\ship2.png" />
|
||||
<Resource Include="Resources\sign_warning.png" />
|
||||
|
||||
@ -24,6 +24,9 @@
|
||||
<RowDefinition Height="56" />
|
||||
<RowDefinition Height="28" />
|
||||
</Grid.RowDefinitions>
|
||||
<Button x:Name="buttonFixedOrder" Grid.Row="0" Grid.Column="1" Margin="2" Click="buttonFixedOrder_Click" Width="28" HorizontalAlignment="Left">
|
||||
<Image x:Name="imageFixedOrder" Source="Resources\lock_open.png" />
|
||||
</Button>
|
||||
<!-- 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" />
|
||||
|
||||
@ -4,7 +4,9 @@
|
||||
//
|
||||
|
||||
using BreCalClient.misc.Model;
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace BreCalClient
|
||||
{
|
||||
@ -52,6 +54,14 @@ namespace BreCalClient
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void buttonFixedOrder_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
bool newValue = true;
|
||||
if (this.Times.EtaBerthFixed ?? false)
|
||||
newValue = false;
|
||||
SetLockButton(newValue);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region private methods
|
||||
@ -87,13 +97,19 @@ namespace BreCalClient
|
||||
this.labelETD.FontWeight = FontWeights.Bold;
|
||||
this.datePickerETDBerth.ContextMenu.IsEnabled = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this.SetLockButton(this.Times.EtaBerthFixed ?? false);
|
||||
}
|
||||
|
||||
private void EnableControls()
|
||||
{
|
||||
Extensions.ParticipantType pType = (Extensions.ParticipantType) this.Times.ParticipantType;
|
||||
if (this.Times.ParticipantId != App.Participant.Id) return; // if this is not "my" entry, there is no editing!
|
||||
if (this.Times.ParticipantId != App.Participant.Id)
|
||||
{
|
||||
this.buttonFixedOrder.IsEnabled = false;
|
||||
return; // if this is not "my" entry, there is no editing!
|
||||
}
|
||||
|
||||
switch (pType)
|
||||
{
|
||||
@ -117,6 +133,20 @@ namespace BreCalClient
|
||||
this.buttonOK.IsEnabled = true;
|
||||
}
|
||||
|
||||
private void SetLockButton(bool newValue)
|
||||
{
|
||||
if (newValue)
|
||||
{
|
||||
this.Times.EtaBerthFixed = true;
|
||||
this.imageFixedOrder.Source = new BitmapImage(new Uri(@"pack://application:,,,/Resources/lock.png", UriKind.RelativeOrAbsolute));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Times.EtaBerthFixed = false;
|
||||
this.imageFixedOrder.Source = new BitmapImage(new Uri(@"pack://application:,,,/Resources/lock_open.png", UriKind.RelativeOrAbsolute));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region clear value event handler
|
||||
@ -139,9 +169,10 @@ namespace BreCalClient
|
||||
private void contextMenuItemClearZoneEntry_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.datePickerZoneEntry.Value = null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
20
src/BreCalClient/Resources/Resources.Designer.cs
generated
20
src/BreCalClient/Resources/Resources.Designer.cs
generated
@ -60,6 +60,16 @@ namespace BreCalClient.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
public static byte[] _lock {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("_lock", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
@ -210,6 +220,16 @@ namespace BreCalClient.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
public static byte[] lock_open {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("lock_open", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
|
||||
@ -163,6 +163,9 @@
|
||||
<data name="emergency_stop_button" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>emergency_stop_button.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="lock_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>lock_open.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="logo_bremen_calling" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>logo_bremen_calling.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
@ -496,4 +499,7 @@
|
||||
<data name="worker2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>worker2.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="_lock" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>lock.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
||||
BIN
src/BreCalClient/Resources/lock.png
Normal file
BIN
src/BreCalClient/Resources/lock.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
BIN
src/BreCalClient/Resources/lock_open.png
Normal file
BIN
src/BreCalClient/Resources/lock_open.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Reference in New Issue
Block a user