Merge branch 'release/0.5.0'

This commit is contained in:
Daniel Schick 2023-09-04 07:55:29 +02:00
commit ccf4ed0565
16 changed files with 632 additions and 99 deletions

View File

@ -1,7 +1,7 @@
//---------------------- //----------------------
// <auto-generated> // <auto-generated>
// Generated REST API Client Code Generator v1.7.17.0 on 21.08.2023 19:15:39 // Generated REST API Client Code Generator v1.7.17.0 on 24.08.2023 08:00:37
// Using the tool OpenAPI Generator v6.6.0 // Using the tool OpenAPI Generator v6.6.0
// </auto-generated> // </auto-generated>
//---------------------- //----------------------
@ -44,13 +44,12 @@ using System.Threading.Tasks;
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
namespace BreCalClient.misc.Api namespace BreCalClient.misc.Api
{ {
#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null'
/// <summary> /// <summary>
/// Represents a collection of functions to interact with the API endpoints /// Represents a collection of functions to interact with the API endpoints
/// </summary> /// </summary>
@ -2323,7 +2322,7 @@ namespace BreCalClient.misc.Api
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -3058,7 +3057,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -3118,7 +3117,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -3258,7 +3257,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -3476,7 +3475,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -3916,7 +3915,7 @@ namespace BreCalClient.misc.Client
string report = "C# SDK (BreCalClient.misc) Debug Report:\n"; string report = "C# SDK (BreCalClient.misc) Debug Report:\n";
report += " OS: " + System.Environment.OSVersion + "\n"; report += " OS: " + System.Environment.OSVersion + "\n";
report += " .NET Framework Version: " + System.Environment.Version + "\n"; report += " .NET Framework Version: " + System.Environment.Version + "\n";
report += " Version of the API: 0.4.0\n"; report += " Version of the API: 0.5.0\n";
report += " SDK Package Version: 1.0.0\n"; report += " SDK Package Version: 1.0.0\n";
return report; return report;
} }
@ -3983,7 +3982,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -4003,7 +4002,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -4060,7 +4059,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -4093,7 +4092,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -4126,7 +4125,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -4217,7 +4216,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -4325,7 +4324,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -4409,7 +4408,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -4668,7 +4667,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -4696,7 +4695,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -4766,7 +4765,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -4793,7 +4792,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -4860,7 +4859,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -5066,7 +5065,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -5203,7 +5202,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -5319,7 +5318,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -5531,7 +5530,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -5757,7 +5756,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -6006,7 +6005,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -6313,7 +6312,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -6843,7 +6842,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -7201,7 +7200,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 0.4.0 * The version of the OpenAPI document: 0.5.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -7380,6 +7379,5 @@ namespace BreCalClient.misc.Model
yield break; yield break;
} }
} }
#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null'
} }

View File

@ -1,6 +1,6 @@
openapi: "3.0.0" openapi: "3.0.0"
info: info:
version: "0.4.0" version: "0.5.0"
title: "Bremen calling API" title: "Bremen calling API"
description: Administer DEBRE ship calls, times and notifications description: Administer DEBRE ship calls, times and notifications
termsOfService: "https://www.bsmd.de/" # url to terms page termsOfService: "https://www.bsmd.de/" # url to terms page

View File

@ -8,8 +8,8 @@
<SignAssembly>True</SignAssembly> <SignAssembly>True</SignAssembly>
<StartupObject>BreCalClient.App</StartupObject> <StartupObject>BreCalClient.App</StartupObject>
<AssemblyOriginatorKeyFile>E:\gitlager\git_brcal\misc\brecal.snk</AssemblyOriginatorKeyFile> <AssemblyOriginatorKeyFile>E:\gitlager\git_brcal\misc\brecal.snk</AssemblyOriginatorKeyFile>
<AssemblyVersion>0.4.0.0</AssemblyVersion> <AssemblyVersion>0.5.0.0</AssemblyVersion>
<FileVersion>0.4.0.0</FileVersion> <FileVersion>0.5.0.0</FileVersion>
<Title>Bremen calling client</Title> <Title>Bremen calling client</Title>
<Description>A Windows WPF client for the Bremen calling API.</Description> <Description>A Windows WPF client for the Bremen calling API.</Description>
<ApplicationIcon>containership.ico</ApplicationIcon> <ApplicationIcon>containership.ico</ApplicationIcon>

View File

@ -0,0 +1,55 @@
<Window x:Class="BreCalClient.EditTimesControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BreCalClient"
xmlns:p = "clr-namespace:BreCalClient.Resources"
xmlns:db="clr-namespace:BreCalClient;assembly=BreCalClient"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
Title="{x:Static p:Resources.textEditTimes}" Height="320" Width="400" Loaded="Window_Loaded" ResizeMode="NoResize" Icon="Resources/containership.ico">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width=".25*" />
<ColumnDefinition Width=".75*" />
<ColumnDefinition Width="40" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="56" />
<RowDefinition Height="28" />
</Grid.RowDefinitions>
<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" />
<Label Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textETDBerth}" HorizontalContentAlignment="Right" />
<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="5" Grid.Column="0" Content="{x:Static p:Resources.textOperationsStart}" HorizontalContentAlignment="Right" />
<Label Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textOperationsEnd}" HorizontalContentAlignment="Right" />
<Label Grid.Row="7" 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" />
<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" />
<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" />
<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" />
<CheckBox IsEnabled="False" Grid.Row="4" Grid.Column="2" Margin="4,0,0,0" Name="checkBoxZoneEntryFixed" VerticalAlignment="Center" />
<xctk:DateTimePicker IsEnabled="False" Grid.Row="5" Grid.Column="1" Margin="2" Name="datePickerOperationStart" />
<xctk:DateTimePicker IsEnabled="False" Grid.Row="6" Grid.Column="1" Margin="2" Name="datePickerOperationEnd" />
<TextBox Grid.Row="7" Grid.Column="1" Margin="2" Name="textBoxRemarks" TextWrapping="Wrap" AcceptsReturn="True" SpellCheck.IsEnabled="True" AcceptsTab="True" />
<StackPanel Grid.Row="8" 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" />
<Button Width="80" Margin="2" Content="{x:Static p:Resources.textCancel}" x:Name="buttonCancel" Click="buttonCancel_Click"/>
</StackPanel>
</Grid>
</Window>

View File

@ -0,0 +1,114 @@
// Copyright (c) 2023 schick Informatik
// Description: Single dialog to edit times for all participant types
// (we might use different controls at a later time)
//
using BreCalClient.misc.Model;
using System.Windows;
namespace BreCalClient
{
/// <summary>
/// Interaction logic for EditTimesControl.xaml
/// </summary>
public partial class EditTimesControl : Window
{
#region Construction
public EditTimesControl()
{
InitializeComponent();
}
#endregion
#region Properties
public Times Times { get; set; } = new();
internal Extensions.ParticipantType ParticipantType { get; set; } = Extensions.ParticipantType.NONE;
#endregion
#region event handler
private void Window_Loaded(object sender, RoutedEventArgs e)
{
this.CopyToControls();
// enable controls according to participant type
this.datePickerETABerth.IsEnabled = App.Participant.IsFlagSet(Extensions.ParticipantType.AGENCY) ||
App.Participant.IsFlagSet(Extensions.ParticipantType.MOORING) ||
App.Participant.IsFlagSet(Extensions.ParticipantType.PILOT) ||
App.Participant.IsFlagSet(Extensions.ParticipantType.PORT_ADMINISTRATION) ||
App.Participant.IsFlagSet(Extensions.ParticipantType.TUG);
this.checkBoxEtaBerthFixed.IsEnabled = this.datePickerETABerth.IsEnabled;
this.datePickerETDBerth.IsEnabled = this.datePickerETABerth.IsEnabled;
this.checkBoxEtDBerthFixed.IsEnabled = this.datePickerETABerth.IsEnabled;
this.datePickerLockTime.IsEnabled = App.Participant.IsFlagSet(Extensions.ParticipantType.AGENCY) ||
App.Participant.IsFlagSet(Extensions.ParticipantType.MOORING) ||
App.Participant.IsFlagSet(Extensions.ParticipantType.PORT_ADMINISTRATION);
this.checkBoxLockTimeFixed.IsEnabled = this.datePickerLockTime.IsEnabled;
this.datePickerZoneEntry.IsEnabled = App.Participant.IsFlagSet(Extensions.ParticipantType.AGENCY) ||
App.Participant.IsFlagSet(Extensions.ParticipantType.PILOT);
this.checkBoxZoneEntryFixed.IsEnabled = this.datePickerZoneEntry.IsEnabled;
this.datePickerOperationStart.IsEnabled = App.Participant.IsFlagSet(Extensions.ParticipantType.TERMINAL);
this.datePickerOperationEnd.IsEnabled = App.Participant.IsFlagSet(Extensions.ParticipantType.TERMINAL);
}
private void buttonOK_Click(object sender, RoutedEventArgs e)
{
this.CopyToModel();
this.DialogResult = true;
this.Close();
}
private void buttonCancel_Click(object sender, RoutedEventArgs e)
{
this.DialogResult = false;
this.Close();
}
#endregion
#region private methods
private void CopyToModel()
{
this.Times.Remarks = this.textBoxRemarks.Text.Trim().Truncate(512);
this.Times.EtaBerth = this.datePickerETABerth.Value;
this.Times.EtdBerth = this.datePickerETDBerth.Value;
this.Times.LockTime = this.datePickerLockTime.Value;
this.Times.ZoneEntry = this.datePickerZoneEntry.Value;
this.Times.OperationsStart = this.datePickerOperationStart.Value;
this.Times.OperationsEnd = this.datePickerOperationEnd.Value;
this.Times.EtaBerthFixed = this.checkBoxEtaBerthFixed.IsChecked;
this.Times.EtdBerthFixed = this.checkBoxEtDBerthFixed.IsChecked;
this.Times.LockTimeFixed = this.checkBoxLockTimeFixed.IsChecked;
this.Times.ZoneEntryFixed = this.checkBoxZoneEntryFixed.IsChecked;
}
private void CopyToControls()
{
this.textBoxRemarks.Text = this.Times.Remarks;
this.datePickerETABerth.Value = this.Times.EtaBerth;
this.datePickerETDBerth.Value = this.Times.EtdBerth;
this.datePickerLockTime.Value = this.Times.LockTime;
this.datePickerZoneEntry.Value = this.Times.ZoneEntry;
this.datePickerOperationStart.Value = this.Times.OperationsStart;
this.datePickerOperationEnd.Value = this.Times.OperationsEnd;
this.checkBoxEtaBerthFixed.IsChecked = this.Times.EtaBerthFixed;
this.checkBoxEtDBerthFixed.IsChecked = this.Times.EtdBerthFixed;
this.checkBoxLockTimeFixed.IsChecked = this.Times.LockTimeFixed;
this.checkBoxZoneEntryFixed.IsChecked = this.Times.ZoneEntryFixed;
}
#endregion
}
}

View File

@ -66,6 +66,20 @@ namespace BreCalClient
else participant.Type &= (int)~flag; else participant.Type &= (int)~flag;
} }
public static string Truncate(this string value, int maxLength)
{
if (string.IsNullOrEmpty(value)) return value;
return value.Length <= maxLength ? value : value.Substring(0, maxLength);
}
public static string TruncateDots(this string value, int maxLength)
{
if(string.IsNullOrEmpty(value)) return value;
if (value.Length <= maxLength) return value;
if (value.Length > (maxLength + 1)) return $"{value.Substring(0, maxLength)}..";
return value.Substring(0, maxLength);
}
#endregion #endregion
} }

View File

@ -293,7 +293,8 @@ namespace BreCalClient
ShipcallControl sc = new() ShipcallControl sc = new()
{ {
Height = 120, Height = 120,
ShipcallControlModel = selectedSCMModel ShipcallControlModel = selectedSCMModel,
ParticipantDict = _participantLookupDict
}; };
sc.EditTimesRequested += Sc_EditTimesRequested; sc.EditTimesRequested += Sc_EditTimesRequested;
sc.EditRequested += Sc_EditRequested; sc.EditRequested += Sc_EditRequested;
@ -337,11 +338,41 @@ namespace BreCalClient
} }
} }
private void Sc_EditTimesRequested(ShipcallControl obj, Times times) private async void Sc_EditTimesRequested(ShipcallControl obj, Times? times)
{ {
// show a dialog that lets the user create / update times for the given shipcall // show a dialog that lets the user create / update times for the given shipcall
EditTimesControl etc = new();
bool wasEdit = false;
if (times != null)
{
etc.Times = times;
wasEdit = true;
}
if(etc.ShowDialog() ?? false)
{
try
{
if (wasEdit)
{
await _api.TimesPutAsync(etc.Times);
}
else
{
etc.Times.ParticipantId = App.Participant.Id;
if ((obj.ShipcallControlModel != null) && (obj.ShipcallControlModel.Shipcall != null))
{
etc.Times.ShipcallId = obj.ShipcallControlModel.Shipcall.Id;
}
await _api.TimesPostAsync(etc.Times);
obj.ShipcallControlModel?.Times.Add(etc.Times);
}
obj.RefreshData();
}
catch (Exception ex)
{
ShowErrorDialog(ex.Message, "Error saving times");
}
}
} }
private void ShowErrorDialog(string message, string caption) private void ShowErrorDialog(string message, string caption)

View File

@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<ApplicationRevision>0</ApplicationRevision> <ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>0.4.0.0</ApplicationVersion> <ApplicationVersion>0.5.0.0</ApplicationVersion>
<BootstrapperEnabled>False</BootstrapperEnabled> <BootstrapperEnabled>False</BootstrapperEnabled>
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<CreateWebPageOnPublish>True</CreateWebPageOnPublish> <CreateWebPageOnPublish>True</CreateWebPageOnPublish>

View File

@ -333,6 +333,15 @@ namespace BreCalClient.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Edit times.
/// </summary>
public static string textEditTimes {
get {
return ResourceManager.GetString("textEditTimes", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Enter keyword. /// Looks up a localized string similar to Enter keyword.
/// </summary> /// </summary>
@ -342,6 +351,24 @@ namespace BreCalClient.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to ETA berth.
/// </summary>
public static string textETABerth {
get {
return ResourceManager.GetString("textETABerth", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ETD berth.
/// </summary>
public static string textETDBerth {
get {
return ResourceManager.GetString("textETDBerth", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Exit. /// Looks up a localized string similar to Exit.
/// </summary> /// </summary>
@ -351,6 +378,15 @@ namespace BreCalClient.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Fixed.
/// </summary>
public static string textFixed {
get {
return ResourceManager.GetString("textFixed", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to from. /// Looks up a localized string similar to from.
/// </summary> /// </summary>
@ -378,6 +414,15 @@ namespace BreCalClient.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Lock time.
/// </summary>
public static string textLockTime {
get {
return ResourceManager.GetString("textLockTime", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Login. /// Looks up a localized string similar to Login.
/// </summary> /// </summary>
@ -450,6 +495,24 @@ namespace BreCalClient.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Operations end.
/// </summary>
public static string textOperationsEnd {
get {
return ResourceManager.GetString("textOperationsEnd", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Operations start.
/// </summary>
public static string textOperationsStart {
get {
return ResourceManager.GetString("textOperationsStart", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Participants. /// Looks up a localized string similar to Participants.
/// </summary> /// </summary>
@ -513,6 +576,15 @@ namespace BreCalClient.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Remarks.
/// </summary>
public static string textRemarks {
get {
return ResourceManager.GetString("textRemarks", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Repeat new password. /// Looks up a localized string similar to Repeat new password.
/// </summary> /// </summary>
@ -666,6 +738,15 @@ namespace BreCalClient.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Zone entry.
/// </summary>
public static string textZoneEntryTime {
get {
return ResourceManager.GetString("textZoneEntryTime", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Byte[]. /// Looks up a localized resource of type System.Byte[].
/// </summary> /// </summary>

View File

@ -196,6 +196,15 @@
<data name="textEditShipcall" xml:space="preserve"> <data name="textEditShipcall" xml:space="preserve">
<value>Schiffsanlauf bearbeiten</value> <value>Schiffsanlauf bearbeiten</value>
</data> </data>
<data name="textEditTimes" xml:space="preserve">
<value>Zeiten bearbeiten</value>
</data>
<data name="textETABerth" xml:space="preserve">
<value>ETA Liegeplatz</value>
</data>
<data name="textETDBerth" xml:space="preserve">
<value>ETD Liegeplatz</value>
</data>
<data name="textEnterKeyword" xml:space="preserve"> <data name="textEnterKeyword" xml:space="preserve">
<value>Suchbegriff eingeben</value> <value>Suchbegriff eingeben</value>
</data> </data>
@ -214,6 +223,18 @@
<data name="textLogin" xml:space="preserve"> <data name="textLogin" xml:space="preserve">
<value>Anmelden</value> <value>Anmelden</value>
</data> </data>
<data name="textFixed" xml:space="preserve">
<value>Fest</value>
</data>
<data name="textLockTime" xml:space="preserve">
<value>Zeit Schleuse</value>
</data>
<data name="textOperationsEnd" xml:space="preserve">
<value>Operation Ende</value>
</data>
<data name="textOperationsStart" xml:space="preserve">
<value>Operation Start</value>
</data>
<data name="textMooredLock" xml:space="preserve"> <data name="textMooredLock" xml:space="preserve">
<value>Festmacher in Schleuse</value> <value>Festmacher in Schleuse</value>
</data> </data>
@ -229,6 +250,9 @@
<data name="textNotRotated" xml:space="preserve"> <data name="textNotRotated" xml:space="preserve">
<value>Ungedreht</value> <value>Ungedreht</value>
</data> </data>
<data name="textZoneEntryTime" xml:space="preserve">
<value>Reviereintritt</value>
</data>
<data name="textOK" xml:space="preserve"> <data name="textOK" xml:space="preserve">
<value>OK</value> <value>OK</value>
</data> </data>

View File

@ -205,12 +205,24 @@
<data name="textEditShipcall" xml:space="preserve"> <data name="textEditShipcall" xml:space="preserve">
<value>Edit ship call</value> <value>Edit ship call</value>
</data> </data>
<data name="textEditTimes" xml:space="preserve">
<value>Edit times</value>
</data>
<data name="textEnterKeyword" xml:space="preserve"> <data name="textEnterKeyword" xml:space="preserve">
<value>Enter keyword</value> <value>Enter keyword</value>
</data> </data>
<data name="textETABerth" xml:space="preserve">
<value>ETA berth</value>
</data>
<data name="textETDBerth" xml:space="preserve">
<value>ETD berth</value>
</data>
<data name="textExit" xml:space="preserve"> <data name="textExit" xml:space="preserve">
<value>Exit</value> <value>Exit</value>
</data> </data>
<data name="textFixed" xml:space="preserve">
<value>Fixed</value>
</data>
<data name="textFrom" xml:space="preserve"> <data name="textFrom" xml:space="preserve">
<value>from</value> <value>from</value>
</data> </data>
@ -220,6 +232,9 @@
<data name="textLengthWidth" xml:space="preserve"> <data name="textLengthWidth" xml:space="preserve">
<value>L/W</value> <value>L/W</value>
</data> </data>
<data name="textLockTime" xml:space="preserve">
<value>Lock time</value>
</data>
<data name="textLogin" xml:space="preserve"> <data name="textLogin" xml:space="preserve">
<value>Login</value> <value>Login</value>
</data> </data>
@ -244,6 +259,12 @@
<data name="textOldPassword" xml:space="preserve"> <data name="textOldPassword" xml:space="preserve">
<value>Old password</value> <value>Old password</value>
</data> </data>
<data name="textOperationsEnd" xml:space="preserve">
<value>Operations end</value>
</data>
<data name="textOperationsStart" xml:space="preserve">
<value>Operations start</value>
</data>
<data name="textParticipants" xml:space="preserve"> <data name="textParticipants" xml:space="preserve">
<value>Participants</value> <value>Participants</value>
</data> </data>
@ -265,6 +286,9 @@
<data name="textRecommendedTugs" xml:space="preserve"> <data name="textRecommendedTugs" xml:space="preserve">
<value>Recommended tugs</value> <value>Recommended tugs</value>
</data> </data>
<data name="textRemarks" xml:space="preserve">
<value>Remarks</value>
</data>
<data name="textRepeatNewPassword" xml:space="preserve"> <data name="textRepeatNewPassword" xml:space="preserve">
<value>Repeat new password</value> <value>Repeat new password</value>
</data> </data>
@ -316,6 +340,9 @@
<data name="textVoyage" xml:space="preserve"> <data name="textVoyage" xml:space="preserve">
<value>Voyage</value> <value>Voyage</value>
</data> </data>
<data name="textZoneEntryTime" xml:space="preserve">
<value>Zone entry</value>
</data>
<data name="trafficlight_green" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="trafficlight_green" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>trafficlight_green.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>trafficlight_green.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>

View File

@ -49,40 +49,40 @@
<Label Grid.Column="1" FontSize="12" x:Name="labelShipName" Foreground="White" Background="#203864" VerticalAlignment="Stretch" <Label Grid.Column="1" FontSize="12" x:Name="labelShipName" Foreground="White" Background="#203864" VerticalAlignment="Stretch"
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" PreviewMouseUp="Image_PreviewMouseUp"/> HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" PreviewMouseUp="Image_PreviewMouseUp"/>
</Grid> </Grid>
<Viewbox Grid.Row="1" Grid.Column="0"> <Viewbox Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left">
<TextBlock Text="IMO" /> <TextBlock Text="IMO" />
</Viewbox> </Viewbox>
<Viewbox Grid.Row="1" Grid.Column="1"> <Viewbox Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left">
<TextBlock x:Name="textBlockIMO" /> <TextBlock x:Name="textBlockIMO" Padding="0" FontWeight="DemiBold" />
</Viewbox> </Viewbox>
<Viewbox Grid.Row="2" Grid.Column="0"> <Viewbox Grid.Row="2" Grid.Column="0" HorizontalAlignment="Left">
<TextBlock Text="{x:Static p:Resources.textCallsign}" /> <TextBlock Text="{x:Static p:Resources.textCallsign}" />
</Viewbox> </Viewbox>
<Viewbox Grid.Row="2" Grid.Column="1"> <Viewbox Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left">
<TextBlock x:Name="textBlockCallsign" /> <TextBlock x:Name="textBlockCallsign" Padding="0"/>
</Viewbox> </Viewbox>
<Viewbox Grid.Row="3" Grid.Column="0"> <Viewbox Grid.Row="3" Grid.Column="0" HorizontalAlignment="Left">
<TextBlock Text="{x:Static p:Resources.textLengthWidth}" /> <TextBlock Text="{x:Static p:Resources.textLengthWidth}" Padding="0" />
</Viewbox> </Viewbox>
<Viewbox Grid.Row="3" Grid.Column="1"> <Viewbox Grid.Row="3" Grid.Column="1" HorizontalAlignment="Left">
<TextBlock x:Name="textBlockLengthWidth" /> <TextBlock x:Name="textBlockLengthWidth" Padding="0"/>
</Viewbox> </Viewbox>
<Viewbox Grid.Row="5" Grid.Column="0"> <Viewbox Grid.Row="5" Grid.Column="0" HorizontalAlignment="Left">
<TextBlock Text="ETA" x:Name="labelETA"/> <TextBlock Text="ETA" x:Name="labelETA"/>
</Viewbox> </Viewbox>
<Viewbox Grid.Row="5" Grid.Column="1"> <Viewbox Grid.Row="5" Grid.Column="1" HorizontalAlignment="Left">
<TextBlock x:Name="textBlockETA" /> <TextBlock x:Name="textBlockETA" />
</Viewbox> </Viewbox>
<Viewbox Grid.Row="6" Grid.Column="0"> <Viewbox Grid.Row="6" Grid.Column="0" HorizontalAlignment="Left">
<TextBlock Text="{x:Static p:Resources.textBerth}" /> <TextBlock Text="{x:Static p:Resources.textBerth}" />
</Viewbox> </Viewbox>
<Viewbox Grid.Row="6" Grid.Column="1"> <Viewbox Grid.Row="6" Grid.Column="1" HorizontalAlignment="Left">
<TextBlock x:Name="textBlockBerth" /> <TextBlock x:Name="textBlockBerth" />
</Viewbox> </Viewbox>
<Viewbox Grid.Row="7" Grid.Column="0"> <Viewbox Grid.Row="7" Grid.Column="0" HorizontalAlignment="Left">
<TextBlock Text="{x:Static p:Resources.textAgency}" /> <TextBlock Text="{x:Static p:Resources.textAgency}" />
</Viewbox> </Viewbox>
<Viewbox Grid.Row="7" Grid.Column="1"> <Viewbox Grid.Row="7" Grid.Column="1" HorizontalAlignment="Left">
<TextBlock x:Name="textBlockAgency" /> <TextBlock x:Name="textBlockAgency" />
</Viewbox> </Viewbox>
@ -101,7 +101,131 @@
<Label Grid.Row="0" Grid.Column="6" Grid.RowSpan="1" FontSize="12" Content="- / -" Foreground="White" Background="#203864" VerticalAlignment="Stretch" <Label Grid.Row="0" Grid.Column="6" Grid.RowSpan="1" FontSize="12" Content="- / -" Foreground="White" Background="#203864" VerticalAlignment="Stretch"
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Name="labelTerminal" PreviewMouseUp="labelTerminal_PreviewMouseUp" /> HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Name="labelTerminal" PreviewMouseUp="labelTerminal_PreviewMouseUp" />
<Grid Grid.Row="2" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*" />
<ColumnDefinition Width="0.7*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="14" />
<RowDefinition Height="20" />
<RowDefinition Height="20" />
<RowDefinition Height="14" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Content="{x:Static p:Resources.textBerth}" Padding="0" VerticalContentAlignment="Center" FontSize="9"/>
<Label Grid.Row="1" Grid.Column="0" Content="ETA" Padding="0" VerticalContentAlignment="Center" />
<Label Grid.Row="2" Grid.Column="0" Content="ETD" Padding="0" VerticalContentAlignment="Center" />
<Label Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Content="{x:Static p:Resources.textRemarks}" Padding="0" VerticalContentAlignment="Center" FontSize="9"/>
<Label Grid.Row="1" Grid.Column="1" Padding="0" VerticalContentAlignment="Center" x:Name="labelAgencyETA" FontWeight="DemiBold"/>
<Label Grid.Row="2" Grid.Column="1" Padding="0" VerticalContentAlignment="Center" x:Name="labelAgencyETD" FontWeight="DemiBold"/>
<TextBlock Grid.Row="3" Grid.Column="1" Grid.RowSpan="2" Padding="0" TextWrapping="Wrap" VerticalAlignment="Top" x:Name="textBlockAgencyRemarks" />
</Grid>
<Grid Grid.Row="2" Grid.Column="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*" />
<ColumnDefinition Width="0.7*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="14" />
<RowDefinition Height="20" />
<RowDefinition Height="20" />
<RowDefinition Height="14" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Content="{x:Static p:Resources.textBerth}" Padding="0" VerticalContentAlignment="Center" FontSize="9"/>
<Label Grid.Row="1" Grid.Column="0" Content="ETA" Padding="0" VerticalContentAlignment="Center" />
<Label Grid.Row="2" Grid.Column="0" Content="ETD" Padding="0" VerticalContentAlignment="Center" />
<Label Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Content="{x:Static p:Resources.textRemarks}" Padding="0" VerticalContentAlignment="Center" FontSize="9"/>
<Label Grid.Row="1" Grid.Column="1" Padding="0" VerticalContentAlignment="Center" x:Name="labelMooringETA" FontWeight="DemiBold"/>
<Label Grid.Row="2" Grid.Column="1" Padding="0" VerticalContentAlignment="Center" x:Name="labelMooringETD" FontWeight="DemiBold"/>
<TextBlock Grid.Row="3" Grid.Column="1" Grid.RowSpan="2" Padding="0" TextWrapping="Wrap" VerticalAlignment="Top" x:Name="textBlockMooringRemarks"/>
</Grid>
<Grid Grid.Row="2" Grid.Column="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*" />
<ColumnDefinition Width="0.7*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="14" />
<RowDefinition Height="20" />
<RowDefinition Height="20" />
<RowDefinition Height="14" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Content="{x:Static p:Resources.textBerth}" Padding="0" VerticalContentAlignment="Center" FontSize="9"/>
<Label Grid.Row="1" Grid.Column="0" Content="ETA" Padding="0" VerticalContentAlignment="Center" />
<Label Grid.Row="2" Grid.Column="0" Content="ETD" Padding="0" VerticalContentAlignment="Center" />
<Label Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Content="{x:Static p:Resources.textRemarks}" Padding="0" VerticalContentAlignment="Center" FontSize="9"/>
<Label Grid.Row="1" Grid.Column="1" Padding="0" VerticalContentAlignment="Center" x:Name="labelPortAuthorityETA" FontWeight="DemiBold"/>
<Label Grid.Row="2" Grid.Column="1" Padding="0" VerticalContentAlignment="Center" x:Name="labelPortAuthorityETD" FontWeight="DemiBold"/>
<TextBlock Grid.Row="3" Grid.Column="1" Grid.RowSpan="2" Padding="0" TextWrapping="Wrap" VerticalAlignment="Top" x:Name="textBlockPortAuthorityRemarks"/>
</Grid>
<Grid Grid.Row="2" Grid.Column="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*" />
<ColumnDefinition Width="0.7*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="14" />
<RowDefinition Height="20" />
<RowDefinition Height="20" />
<RowDefinition Height="14" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Content="{x:Static p:Resources.textBerth}" Padding="0" VerticalContentAlignment="Center" FontSize="9"/>
<Label Grid.Row="1" Grid.Column="0" Content="ETA" Padding="0" VerticalContentAlignment="Center" />
<Label Grid.Row="2" Grid.Column="0" Content="ETD" Padding="0" VerticalContentAlignment="Center" />
<Label Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Content="{x:Static p:Resources.textRemarks}" Padding="0" VerticalContentAlignment="Center" FontSize="9"/>
<Label Grid.Row="1" Grid.Column="1" Padding="0" VerticalContentAlignment="Center" x:Name="labelPilotETA" FontWeight="DemiBold"/>
<Label Grid.Row="2" Grid.Column="1" Padding="0" VerticalContentAlignment="Center" x:Name="labelPilotETD" FontWeight="DemiBold"/>
<TextBlock Grid.Row="3" Grid.Column="1" Grid.RowSpan="2" Padding="0" TextWrapping="Wrap" VerticalAlignment="Top" x:Name="textBlockPilotRemarks"/>
</Grid>
<Grid Grid.Row="2" Grid.Column="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*" />
<ColumnDefinition Width="0.7*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="14" />
<RowDefinition Height="20" />
<RowDefinition Height="20" />
<RowDefinition Height="14" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Content="{x:Static p:Resources.textBerth}" Padding="0" VerticalContentAlignment="Center" FontSize="9"/>
<Label Grid.Row="1" Grid.Column="0" Content="ETA" Padding="0" VerticalContentAlignment="Center" />
<Label Grid.Row="2" Grid.Column="0" Content="ETD" Padding="0" VerticalContentAlignment="Center" />
<Label Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Content="{x:Static p:Resources.textRemarks}" Padding="0" VerticalContentAlignment="Center" FontSize="9"/>
<Label Grid.Row="1" Grid.Column="1" Padding="0" VerticalContentAlignment="Center" x:Name="labelTugETA" FontWeight="DemiBold"/>
<Label Grid.Row="2" Grid.Column="1" Padding="0" VerticalContentAlignment="Center" x:Name="labelTugETD" FontWeight="DemiBold"/>
<TextBlock Grid.Row="3" Grid.Column="1" Grid.RowSpan="2" Padding="0" TextWrapping="Wrap" VerticalAlignment="Top" x:Name="textBlockTugRemarks" />
</Grid>
<Grid Grid.Row="2" Grid.Column="6">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*" />
<ColumnDefinition Width="0.7*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="14" />
<RowDefinition Height="20" />
<RowDefinition Height="20" />
<RowDefinition Height="14" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Content="{x:Static p:Resources.textBerth}" Padding="0" VerticalContentAlignment="Center" FontSize="9"/>
<Label Grid.Row="1" Grid.Column="0" Content="ETA" Padding="0" VerticalContentAlignment="Center" />
<Label Grid.Row="2" Grid.Column="0" Content="ETD" Padding="0" VerticalContentAlignment="Center" />
<Label Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Content="{x:Static p:Resources.textRemarks}" Padding="0" VerticalContentAlignment="Center" FontSize="9"/>
<Label Grid.Row="1" Grid.Column="1" Padding="0" VerticalContentAlignment="Center" x:Name="labelTerminalETA" FontWeight="DemiBold"/>
<Label Grid.Row="2" Grid.Column="1" Padding="0" VerticalContentAlignment="Center" x:Name="labelTerminalETD" FontWeight="DemiBold"/>
<TextBlock Grid.Row="3" Grid.Column="1" Grid.RowSpan="2" Padding="0" TextWrapping="Wrap" VerticalAlignment="Top" x:Name="textBlockTerminalRemarks" />
</Grid>
<!-- Image Margin="2" Grid.Column="3" Grid.Row="0" Grid.RowSpan="3"> <!-- Image Margin="2" Grid.Column="3" Grid.Row="0" Grid.RowSpan="3">
<Image.Style> <Image.Style>

View File

@ -4,6 +4,7 @@
using BreCalClient.misc.Model; using BreCalClient.misc.Model;
using System; using System;
using System.Collections.Generic;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Media; using System.Windows.Media;
@ -30,7 +31,7 @@ namespace BreCalClient
public event Action<ShipcallControl>? EditRequested; public event Action<ShipcallControl>? EditRequested;
public event Action<ShipcallControl, Times>? EditTimesRequested; public event Action<ShipcallControl, Times?>? EditTimesRequested;
public event Action<ShipcallControl>? OpenExtraRequested; public event Action<ShipcallControl>? OpenExtraRequested;
@ -43,17 +44,26 @@ namespace BreCalClient
/// </summary> /// </summary>
public ShipcallControlModel? ShipcallControlModel { get; set; } public ShipcallControlModel? ShipcallControlModel { get; set; }
/// <summary>
/// these are all participants (currently loaded)
/// </summary>
public Dictionary<int, Participant>? ParticipantDict { get; set; }
#endregion #endregion
#region public methods #region public methods
public void RefreshData() public void RefreshData()
{ {
if (this.ShipcallControlModel == null) return; if (this.ShipcallControlModel == null) return;
string agentName = "";
string? name; string? name;
name = this.ShipcallControlModel.GetParticipantNameForType(Extensions.ParticipantType.AGENCY); name = this.ShipcallControlModel.GetParticipantNameForType(Extensions.ParticipantType.AGENCY);
if (name != null) if (name != null)
{
this.labelAgent.Content = name; this.labelAgent.Content = name;
agentName = name;
}
name = this.ShipcallControlModel.GetParticipantNameForType(Extensions.ParticipantType.MOORING); name = this.ShipcallControlModel.GetParticipantNameForType(Extensions.ParticipantType.MOORING);
if (name != null) if (name != null)
this.labelMooring.Content = name; this.labelMooring.Content = name;
@ -120,17 +130,66 @@ namespace BreCalClient
this.textBlockCallsign.Text = this.ShipcallControlModel?.Ship?.Callsign; this.textBlockCallsign.Text = this.ShipcallControlModel?.Ship?.Callsign;
if ((this.ShipcallControlModel?.Shipcall?.Type == 1) || (this.ShipcallControlModel?.Shipcall?.Type == 3)) if ((this.ShipcallControlModel?.Shipcall?.Type == 1) || (this.ShipcallControlModel?.Shipcall?.Type == 3))
{ {
this.textBlockETA.Text = this.ShipcallControlModel?.Shipcall?.Eta.ToString(); this.textBlockETA.Text = this.ShipcallControlModel?.Shipcall?.Eta.ToString("dd.MM. HH:mm");
} }
if(this.ShipcallControlModel?.Shipcall?.Type == 2) if(this.ShipcallControlModel?.Shipcall?.Type == 2)
{ {
this.labelETA.Text = "ETD"; this.labelETA.Text = "ETD";
this.textBlockETA.Text = this.ShipcallControlModel?.Shipcall?.Etd.ToString(); this.textBlockETA.Text = this.ShipcallControlModel?.Shipcall?.Etd?.ToString("dd.MM. HH:mm");
} }
this.textBlockIMO.Text = this.ShipcallControlModel?.Ship?.Imo.ToString(); this.textBlockIMO.Text = this.ShipcallControlModel?.Ship?.Imo.ToString();
this.textBlockLengthWidth.Text = $"{this.ShipcallControlModel?.Ship?.Length} / {this.ShipcallControlModel?.Ship?.Width}"; this.textBlockLengthWidth.Text = $"{this.ShipcallControlModel?.Ship?.Length} / {this.ShipcallControlModel?.Ship?.Width}";
this.textBlockAgency.Text = agentName.TruncateDots(10);
if (this.ParticipantDict != null)
{
if (this.ShipcallControlModel != null)
{
foreach (Times times in this.ShipcallControlModel.Times)
{
if(this.ParticipantDict.ContainsKey(times.ParticipantId))
{
if (this.ParticipantDict[times.ParticipantId].IsFlagSet(Extensions.ParticipantType.AGENCY))
{
this.labelAgencyETA.Content = times.EtaBerth.HasValue ? times.EtaBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
this.labelAgencyETD.Content = times.EtdBerth.HasValue ? times.EtdBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
this.textBlockAgency.Text = times.Remarks;
}
if (this.ParticipantDict[times.ParticipantId].IsFlagSet(Extensions.ParticipantType.MOORING))
{
this.labelMooringETA.Content = times.EtaBerth.HasValue ? times.EtaBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
this.labelMooringETD.Content = times.EtdBerth.HasValue ? times.EtdBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
this.textBlockMooringRemarks.Text = times.Remarks;
}
if (this.ParticipantDict[times.ParticipantId].IsFlagSet(Extensions.ParticipantType.PORT_ADMINISTRATION))
{
this.labelPortAuthorityETA.Content = times.EtaBerth.HasValue ? times.EtaBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
this.labelPortAuthorityETD.Content = times.EtdBerth.HasValue ? times.EtdBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
this.textBlockPortAuthorityRemarks.Text = times.Remarks;
}
if (this.ParticipantDict[times.ParticipantId].IsFlagSet(Extensions.ParticipantType.PILOT))
{
this.labelPilotETA.Content = times.EtaBerth.HasValue ? times.EtaBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
this.labelPilotETD.Content = times.EtdBerth.HasValue ? times.EtdBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
this.textBlockPilotRemarks.Text = times.Remarks;
}
if (this.ParticipantDict[times.ParticipantId].IsFlagSet(Extensions.ParticipantType.TUG))
{
this.labelTugETA.Content = times.EtaBerth.HasValue ? times.EtaBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
this.labelTugETD.Content = times.EtdBerth.HasValue ? times.EtdBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
this.textBlockTugRemarks.Text = times.Remarks;
}
if (this.ParticipantDict[times.ParticipantId].IsFlagSet(Extensions.ParticipantType.TERMINAL))
{
this.labelTerminalETA.Content = times.EtaBerth.HasValue ? times.EtaBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
this.labelTerminalETD.Content = times.EtdBerth.HasValue ? times.EtdBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
this.textBlockTerminalRemarks.Text = times.Remarks;
}
}
}
}
}
} }
#endregion #endregion
@ -161,11 +220,8 @@ namespace BreCalClient
{ {
if (App.Participant.IsFlagSet(Extensions.ParticipantType.AGENCY)) if (App.Participant.IsFlagSet(Extensions.ParticipantType.AGENCY))
{ {
Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.AGENCY); Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.AGENCY);
if (times != null) this.EditTimesRequested?.Invoke(this, times);
{
this.EditTimesRequested?.Invoke(this, times);
}
} }
} }
@ -174,10 +230,7 @@ namespace BreCalClient
if (App.Participant.IsFlagSet(Extensions.ParticipantType.MOORING)) if (App.Participant.IsFlagSet(Extensions.ParticipantType.MOORING))
{ {
Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.MOORING); Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.MOORING);
if(times != null) this.EditTimesRequested?.Invoke(this, times);
{
this.EditTimesRequested?.Invoke(this, times);
}
} }
} }
@ -185,11 +238,8 @@ namespace BreCalClient
{ {
if (App.Participant.IsFlagSet(Extensions.ParticipantType.PORT_ADMINISTRATION)) if (App.Participant.IsFlagSet(Extensions.ParticipantType.PORT_ADMINISTRATION))
{ {
Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.PORT_ADMINISTRATION); Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.PORT_ADMINISTRATION);
if (times != null) this.EditTimesRequested?.Invoke(this, times);
{
this.EditTimesRequested?.Invoke(this, times);
}
} }
} }
@ -198,10 +248,7 @@ namespace BreCalClient
if (App.Participant.IsFlagSet(Extensions.ParticipantType.PILOT)) if (App.Participant.IsFlagSet(Extensions.ParticipantType.PILOT))
{ {
Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.PILOT); Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.PILOT);
if (times != null) this.EditTimesRequested?.Invoke(this, times);
{
this.EditTimesRequested?.Invoke(this, times);
}
} }
} }
@ -210,10 +257,7 @@ namespace BreCalClient
if (App.Participant.IsFlagSet(Extensions.ParticipantType.TUG)) if (App.Participant.IsFlagSet(Extensions.ParticipantType.TUG))
{ {
Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.TUG); Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.TUG);
if (times != null) this.EditTimesRequested?.Invoke(this, times);
{
this.EditTimesRequested?.Invoke(this, times);
}
} }
} }
@ -222,10 +266,7 @@ namespace BreCalClient
if (App.Participant.IsFlagSet(Extensions.ParticipantType.TERMINAL)) if (App.Participant.IsFlagSet(Extensions.ParticipantType.TERMINAL))
{ {
Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.TERMINAL); Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.TERMINAL);
if (times != null) this.EditTimesRequested?.Invoke(this, times);
{
this.EditTimesRequested?.Invoke(this, times);
}
} }
} }

View File

@ -59,6 +59,10 @@ def PostShipcalls(schemaModel):
continue continue
if key == "participants": if key == "participants":
continue continue
if key == "created":
continue
if key == "modified":
continue
if isNotFirst: if isNotFirst:
query += "," query += ","
isNotFirst = True isNotFirst = True
@ -70,6 +74,10 @@ def PostShipcalls(schemaModel):
continue continue
if key == "participants": if key == "participants":
continue continue
if key == "created":
continue
if key == "modified":
continue
if isNotFirst: if isNotFirst:
query += "," query += ","
isNotFirst = True isNotFirst = True
@ -125,6 +133,10 @@ def PutShipcalls(schemaModel):
continue continue
if key == "participants": if key == "participants":
continue continue
if key == "created":
continue
if key == "modified":
continue
if isNotFirst: if isNotFirst:
query += ", " query += ", "
isNotFirst = True isNotFirst = True

View File

@ -53,6 +53,10 @@ def PostTimes(schemaModel):
for key in schemaModel.keys(): for key in schemaModel.keys():
if key == "id": if key == "id":
continue continue
if key == "created":
continue
if key == "modified":
continue
if isNotFirst: if isNotFirst:
query += "," query += ","
isNotFirst = True isNotFirst = True
@ -62,6 +66,10 @@ def PostTimes(schemaModel):
for key in schemaModel.keys(): for key in schemaModel.keys():
if key == "id": if key == "id":
continue continue
if key == "created":
continue
if key == "modified":
continue
if isNotFirst: if isNotFirst:
query += "," query += ","
isNotFirst = True isNotFirst = True
@ -100,6 +108,10 @@ def PutTimes(schemaModel):
for key in schemaModel.keys(): for key in schemaModel.keys():
if key == "id": if key == "id":
continue continue
if key == "created":
continue
if key == "modified":
continue
if isNotFirst: if isNotFirst:
query += ", " query += ", "
isNotFirst = True isNotFirst = True

View File

@ -130,21 +130,21 @@ class TimesSchema(Schema):
pass pass
id = fields.Int(Required=False) id = fields.Int(Required=False)
eta_berth = fields.DateTime(Required = False) eta_berth = fields.DateTime(Required = False, allow_none=True)
eta_berth_fixed = fields.Bool(Required = False) eta_berth_fixed = fields.Bool(Required = False, allow_none=True)
etd_berth = fields.DateTime(Required = False) etd_berth = fields.DateTime(Required = False, allow_none=True)
etd_berth_fixed = fields.Bool(Required = False) etd_berth_fixed = fields.Bool(Required = False, allow_none=True)
lock_time = fields.DateTime(Required = False) lock_time = fields.DateTime(Required = False, allow_none=True)
lock_time_fixed = fields.Bool(Required = False) lock_time_fixed = fields.Bool(Required = False, allow_none=True)
zone_entry = fields.DateTime(Required = False) zone_entry = fields.DateTime(Required = False, allow_none=True)
zone_entry_fixed = fields.Bool(Required = False) zone_entry_fixed = fields.Bool(Required = False, allow_none=True)
operations_start = fields.DateTime(Required = False) operations_start = fields.DateTime(Required = False, allow_none=True)
operations_end = fields.DateTime(Required = False) operations_end = fields.DateTime(Required = False, allow_none=True)
remarks = fields.String(Required = False) remarks = fields.String(Required = False, allow_none=True)
participant_id = fields.Int(Required = True) participant_id = fields.Int(Required = True)
shipcall_id = fields.Int(Required = True) shipcall_id = fields.Int(Required = True)
created = fields.DateTime(Required = False) created = fields.DateTime(Required = False, allow_none=True)
modified = fields.DateTime(Required = False) modified = fields.DateTime(Required = False, allow_none=True)
# deserialize PUT object target # deserialize PUT object target