diff --git a/misc/BreCalApi.cs b/misc/BreCalApi.cs index 3a006be..d139681 100644 --- a/misc/BreCalApi.cs +++ b/misc/BreCalApi.cs @@ -1,7 +1,7 @@ //---------------------- // -// Generated REST API Client Code Generator v1.7.17.0 on 18.08.2023 15:15:15 +// Generated REST API Client Code Generator v1.7.17.0 on 21.08.2023 19:15:39 // Using the tool OpenAPI Generator v6.6.0 // //---------------------- @@ -44,12 +44,13 @@ using System.Threading.Tasks; * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ 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' /// /// Represents a collection of functions to interact with the API endpoints /// @@ -2322,7 +2323,7 @@ namespace BreCalClient.misc.Api * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3057,7 +3058,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3117,7 +3118,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3257,7 +3258,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3475,7 +3476,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3915,7 +3916,7 @@ namespace BreCalClient.misc.Client string report = "C# SDK (BreCalClient.misc) Debug Report:\n"; report += " OS: " + System.Environment.OSVersion + "\n"; report += " .NET Framework Version: " + System.Environment.Version + "\n"; - report += " Version of the API: 0.3.0\n"; + report += " Version of the API: 0.4.0\n"; report += " SDK Package Version: 1.0.0\n"; return report; } @@ -3982,7 +3983,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4002,7 +4003,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4059,7 +4060,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4092,7 +4093,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4125,7 +4126,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4216,7 +4217,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4324,7 +4325,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4408,7 +4409,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4667,7 +4668,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4695,7 +4696,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4765,7 +4766,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4792,7 +4793,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4859,7 +4860,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4972,6 +4973,7 @@ namespace BreCalClient.misc.Model { return false; } + return ( this.Id == input.Id || @@ -5006,6 +5008,7 @@ namespace BreCalClient.misc.Model this.Deleted == input.Deleted || this.Deleted.Equals(input.Deleted) ); + } /// /// Gets the hash code @@ -5063,7 +5066,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5200,7 +5203,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5316,7 +5319,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5528,7 +5531,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5754,7 +5757,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6003,7 +6006,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6310,7 +6313,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6322,33 +6325,6 @@ namespace BreCalClient.misc.Model [DataContract(Name = "shipcall")] public partial class Shipcall : IEquatable, IValidatableObject { - /// - /// Defines Type - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum TypeEnum - { - /// - /// Enum Incoming for value: incoming - /// - [EnumMember(Value = "incoming")] - Incoming = 1, - /// - /// Enum Outgoing for value: outgoing - /// - [EnumMember(Value = "outgoing")] - Outgoing = 2, - /// - /// Enum Shifting for value: shifting - /// - [EnumMember(Value = "shifting")] - Shifting = 3 - } - /// - /// Gets or Sets Type - /// - [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] - public TypeEnum Type { get; set; } /// /// Initializes a new instance of the class. /// @@ -6365,7 +6341,7 @@ namespace BreCalClient.misc.Model /// etd. /// arrivalBerthId. /// departureBerthId. - /// tugReguired. + /// tugRequired. /// pilotRequired. /// flags. /// pierSide. @@ -6383,7 +6359,7 @@ namespace BreCalClient.misc.Model /// participants. /// created. /// modified. - public Shipcall(int id = default(int), int shipId = default(int), TypeEnum type = default(TypeEnum), DateTime eta = default(DateTime), string voyage = default(string), DateTime? etd = default(DateTime?), int? arrivalBerthId = default(int?), int? departureBerthId = default(int?), bool? tugReguired = default(bool?), bool? pilotRequired = default(bool?), int? flags = default(int?), bool? pierSide = default(bool?), bool? bunkering = default(bool?), bool? replenishingTerminal = default(bool?), bool? replenishingLock = default(bool?), float? draft = default(float?), DateTime? tidalWindowFrom = default(DateTime?), DateTime? tidalWindowTo = default(DateTime?), bool? rainSensitiveCargo = default(bool?), int? recommendedTugs = default(int?), bool? anchored = default(bool?), bool? mooredLock = default(bool?), bool? canceled = default(bool?), List participants = default(List), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) + public Shipcall(int id = default(int), int shipId = default(int), int type = default(int), DateTime eta = default(DateTime), string voyage = default(string), DateTime? etd = default(DateTime?), int? arrivalBerthId = default(int?), int? departureBerthId = default(int?), bool? tugRequired = default(bool?), bool? pilotRequired = default(bool?), int? flags = default(int?), bool? pierSide = default(bool?), bool? bunkering = default(bool?), bool? replenishingTerminal = default(bool?), bool? replenishingLock = default(bool?), float? draft = default(float?), DateTime? tidalWindowFrom = default(DateTime?), DateTime? tidalWindowTo = default(DateTime?), bool? rainSensitiveCargo = default(bool?), int? recommendedTugs = default(int?), bool? anchored = default(bool?), bool? mooredLock = default(bool?), bool? canceled = default(bool?), List participants = default(List), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) { this.Id = id; this.ShipId = shipId; @@ -6393,7 +6369,7 @@ namespace BreCalClient.misc.Model this.Etd = etd; this.ArrivalBerthId = arrivalBerthId; this.DepartureBerthId = departureBerthId; - this.TugReguired = tugReguired; + this.TugRequired = tugRequired; this.PilotRequired = pilotRequired; this.Flags = flags; this.PierSide = pierSide; @@ -6424,6 +6400,11 @@ namespace BreCalClient.misc.Model [DataMember(Name = "ship_id", IsRequired = true, EmitDefaultValue = true)] public int ShipId { get; set; } /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] + public int Type { get; set; } + /// /// Gets or Sets Eta /// [DataMember(Name = "eta", IsRequired = true, EmitDefaultValue = true)] @@ -6449,10 +6430,10 @@ namespace BreCalClient.misc.Model [DataMember(Name = "departure_berth_id", EmitDefaultValue = true)] public int? DepartureBerthId { get; set; } /// - /// Gets or Sets TugReguired + /// Gets or Sets TugRequired /// - [DataMember(Name = "tug_reguired", EmitDefaultValue = true)] - public bool? TugReguired { get; set; } + [DataMember(Name = "tug_required", EmitDefaultValue = true)] + public bool? TugRequired { get; set; } /// /// Gets or Sets PilotRequired /// @@ -6554,7 +6535,7 @@ namespace BreCalClient.misc.Model sb.Append(" Etd: ").Append(Etd).Append("\n"); sb.Append(" ArrivalBerthId: ").Append(ArrivalBerthId).Append("\n"); sb.Append(" DepartureBerthId: ").Append(DepartureBerthId).Append("\n"); - sb.Append(" TugReguired: ").Append(TugReguired).Append("\n"); + sb.Append(" TugRequired: ").Append(TugRequired).Append("\n"); sb.Append(" PilotRequired: ").Append(PilotRequired).Append("\n"); sb.Append(" Flags: ").Append(Flags).Append("\n"); sb.Append(" PierSide: ").Append(PierSide).Append("\n"); @@ -6642,9 +6623,9 @@ namespace BreCalClient.misc.Model this.DepartureBerthId.Equals(input.DepartureBerthId)) ) && ( - this.TugReguired == input.TugReguired || - (this.TugReguired != null && - this.TugReguired.Equals(input.TugReguired)) + this.TugRequired == input.TugRequired || + (this.TugRequired != null && + this.TugRequired.Equals(input.TugRequired)) ) && ( this.PilotRequired == input.PilotRequired || @@ -6765,9 +6746,9 @@ namespace BreCalClient.misc.Model { hashCode = (hashCode * 59) + this.DepartureBerthId.GetHashCode(); } - if (this.TugReguired != null) + if (this.TugRequired != null) { - hashCode = (hashCode * 59) + this.TugReguired.GetHashCode(); + hashCode = (hashCode * 59) + this.TugRequired.GetHashCode(); } if (this.PilotRequired != null) { @@ -6862,7 +6843,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -7220,7 +7201,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 0.3.0 + * The version of the OpenAPI document: 0.4.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -7399,5 +7380,6 @@ namespace BreCalClient.misc.Model 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' } diff --git a/misc/BreCalApi.yaml b/misc/BreCalApi.yaml index 0fa15ff..9b8c83b 100644 --- a/misc/BreCalApi.yaml +++ b/misc/BreCalApi.yaml @@ -1,6 +1,6 @@ openapi: "3.0.0" info: - version: "0.3.0" + version: "0.4.0" title: "Bremen calling API" description: Administer DEBRE ship calls, times and notifications termsOfService: "https://www.bsmd.de/" # url to terms page @@ -337,11 +337,8 @@ components: ship_id: type: integer type: - type: string - enum: - - incoming - - outgoing - - shifting + type: integer + # TODO: use an enum eta: type: string format: date-time @@ -359,7 +356,7 @@ components: departure_berth_id: type: integer nullable: true - tug_reguired: + tug_required: type: boolean nullable: true pilot_required: diff --git a/src/BreCalClient/.editorconfig b/src/BreCalClient/.editorconfig index 5d552a4..6c674dd 100644 --- a/src/BreCalClient/.editorconfig +++ b/src/BreCalClient/.editorconfig @@ -1,7 +1,7 @@ [*.cs] # CS8073: The result of the expression is always the same since a value of this type is never equal to 'null' -dotnet_diagnostic.CS8073.severity = silent +dotnet_diagnostic.CS8073.severity = none csharp_using_directive_placement = outside_namespace:silent csharp_prefer_simple_using_statement = true:suggestion csharp_prefer_braces = true:silent diff --git a/src/BreCalClient/App.xaml.cs b/src/BreCalClient/App.xaml.cs index c44620d..6c98fd5 100644 --- a/src/BreCalClient/App.xaml.cs +++ b/src/BreCalClient/App.xaml.cs @@ -1,10 +1,4 @@ using BreCalClient.misc.Model; -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Data; -using System.Linq; -using System.Threading.Tasks; using System.Windows; namespace BreCalClient diff --git a/src/BreCalClient/BoolToIndexConverter.cs b/src/BreCalClient/BoolToIndexConverter.cs new file mode 100644 index 0000000..cae4812 --- /dev/null +++ b/src/BreCalClient/BoolToIndexConverter.cs @@ -0,0 +1,23 @@ +// Copyright (c) 2023 schick Informatik +// Description: Helper for combobox binding of bool to combobox +// + +using System; +using System.Globalization; +using System.Windows.Data; + +namespace BreCalClient +{ + public class BoolToIndexConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return ((bool) value == true) ? 0 : 1; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return ((int)value == 0); + } + } +} diff --git a/src/BreCalClient/BreCalClient.csproj b/src/BreCalClient/BreCalClient.csproj index 2dcf5a8..464f79e 100644 --- a/src/BreCalClient/BreCalClient.csproj +++ b/src/BreCalClient/BreCalClient.csproj @@ -8,8 +8,8 @@ True BreCalClient.App E:\gitlager\git_brcal\misc\brecal.snk - 0.3.0.0 - 0.3.0.0 + 0.4.0.0 + 0.4.0.0 Bremen calling client A Windows WPF client for the Bremen calling API. containership.ico diff --git a/src/BreCalClient/EditShipcallControl.xaml b/src/BreCalClient/EditShipcallControl.xaml index a269c97..25ede33 100644 --- a/src/BreCalClient/EditShipcallControl.xaml +++ b/src/BreCalClient/EditShipcallControl.xaml @@ -9,6 +9,9 @@ xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" mc:Ignorable="d" Title="{x:Static p:Resources.textEditShipcall}" Height="466" Width="800" Loaded="Window_Loaded" ResizeMode="NoResize" Icon="Resources/containership.ico"> + + + @@ -49,7 +52,7 @@ - + - + - - - - - - - - + - + - + - + - +