From 722ea94ae001b46f305ad3802c081e82def41ae1 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Mon, 15 Jan 2024 16:02:27 +0100 Subject: [PATCH] fixed some bugs in the dialog, but still cannot save a ship --- misc/BreCalApi.cs | 1387 +---------------- misc/BreCalApi.yaml | 6 +- src/BreCalClient/EditShipDialog.xaml | 20 +- src/BreCalClient/EditShipDialog.xaml.cs | 41 +- src/BreCalClient/EditShipcallControl.xaml | 2 +- src/BreCalClient/EditShipcallControl.xaml.cs | 16 +- src/BreCalClient/MainWindow.xaml.cs | 4 +- .../Resources/Resources.Designer.cs | 9 + src/BreCalClient/Resources/Resources.de.resx | 3 + src/BreCalClient/Resources/Resources.resx | 3 + src/BreCalClient/ShipListDialog.xaml | 20 +- src/BreCalClient/ShipListDialog.xaml.cs | 110 +- src/BreCalClient/ShipModel.cs | 10 + 13 files changed, 211 insertions(+), 1420 deletions(-) diff --git a/misc/BreCalApi.cs b/misc/BreCalApi.cs index 49e523b..78f70c7 100644 --- a/misc/BreCalApi.cs +++ b/misc/BreCalApi.cs @@ -1,7 +1,7 @@ //---------------------- // -// Generated REST API Client Code Generator v1.9.3.0 on 14.01.2024 13:10:51 +// Generated REST API Client Code Generator v1.9.4.0 on 15.01.2024 15:58:12 // Using the tool OpenAPI Generator v7.2.0 // //---------------------- @@ -52,7 +52,7 @@ using System.Web; */ namespace BreCalClient.misc.Api { - #pragma warning disable CS8073 +#pragma warning disable CS8073 /// /// Represents a collection of functions to interact with the API endpoints /// @@ -4879,7 +4879,7 @@ namespace BreCalClient.misc.Client /// /// Gets or sets the base path for API access. /// - public virtual string BasePath + public virtual string BasePath { get { return _basePath; } set { _basePath = value; } @@ -6162,7 +6162,7 @@ namespace BreCalClient.misc.Model /// Ship berth used for a ship call /// [DataContract(Name = "berth")] - public partial class Berth : IEquatable, IValidatableObject + public partial class Berth : IValidatableObject { /// /// Initializes a new instance of the class. @@ -6257,104 +6257,6 @@ namespace BreCalClient.misc.Model return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Berth); - } - /// - /// Returns true if Berth instances are equal - /// - /// Instance of Berth to be compared - /// Boolean - public bool Equals(Berth input) - { - if (input == null) - { - return false; - } - return - ( - this.Id == input.Id || - this.Id.Equals(input.Id) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.OwnerId == input.OwnerId || - (this.OwnerId != null && - this.OwnerId.Equals(input.OwnerId)) - ) && - ( - this.AuthorityId == input.AuthorityId || - (this.AuthorityId != null && - this.AuthorityId.Equals(input.AuthorityId)) - ) && - ( - this.VarLock == input.VarLock || - (this.VarLock != null && - this.VarLock.Equals(input.VarLock)) - ) && - ( - this.Created == input.Created || - (this.Created != null && - this.Created.Equals(input.Created)) - ) && - ( - this.Modified == input.Modified || - (this.Modified != null && - this.Modified.Equals(input.Modified)) - ) && - ( - this.Deleted == input.Deleted || - this.Deleted.Equals(input.Deleted) - ); - } - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - if (this.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - if (this.OwnerId != null) - { - hashCode = (hashCode * 59) + this.OwnerId.GetHashCode(); - } - if (this.AuthorityId != null) - { - hashCode = (hashCode * 59) + this.AuthorityId.GetHashCode(); - } - if (this.VarLock != null) - { - hashCode = (hashCode * 59) + this.VarLock.GetHashCode(); - } - if (this.Created != null) - { - hashCode = (hashCode * 59) + this.Created.GetHashCode(); - } - if (this.Modified != null) - { - hashCode = (hashCode * 59) + this.Modified.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Deleted.GetHashCode(); - return hashCode; - } - } - /// /// To validate all properties of the instance /// /// Validation context @@ -6386,7 +6288,7 @@ namespace BreCalClient.misc.Model /// Credentials /// [DataContract(Name = "credentials")] - public partial class Credentials : IEquatable, IValidatableObject + public partial class Credentials : IValidatableObject { /// /// Initializes a new instance of the class. @@ -6445,58 +6347,6 @@ namespace BreCalClient.misc.Model return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Credentials); - } - /// - /// Returns true if Credentials instances are equal - /// - /// Instance of Credentials to be compared - /// Boolean - public bool Equals(Credentials input) - { - if (input == null) - { - return false; - } - return - ( - this.Username == input.Username || - (this.Username != null && - this.Username.Equals(input.Username)) - ) && - ( - this.Password == input.Password || - (this.Password != null && - this.Password.Equals(input.Password)) - ); - } - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Username != null) - { - hashCode = (hashCode * 59) + this.Username.GetHashCode(); - } - if (this.Password != null) - { - hashCode = (hashCode * 59) + this.Password.GetHashCode(); - } - return hashCode; - } - } - /// /// To validate all properties of the instance /// /// Validation context @@ -6523,7 +6373,7 @@ namespace BreCalClient.misc.Model /// Error /// [DataContract(Name = "Error")] - public partial class Error : IEquatable, IValidatableObject + public partial class Error : IValidatableObject { /// /// Initializes a new instance of the class. @@ -6570,49 +6420,6 @@ namespace BreCalClient.misc.Model return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Error); - } - /// - /// Returns true if Error instances are equal - /// - /// Instance of Error to be compared - /// Boolean - public bool Equals(Error input) - { - if (input == null) - { - return false; - } - return - ( - this.Message == input.Message || - (this.Message != null && - this.Message.Equals(input.Message)) - ); - } - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Message != null) - { - hashCode = (hashCode * 59) + this.Message.GetHashCode(); - } - return hashCode; - } - } - /// /// To validate all properties of the instance /// /// Validation context @@ -6679,7 +6486,7 @@ namespace BreCalClient.misc.Model /// Single history entry with references /// [DataContract(Name = "history")] - public partial class History : IEquatable, IValidatableObject + public partial class History : IValidatableObject { /// /// Gets or Sets Operation @@ -6763,83 +6570,6 @@ namespace BreCalClient.misc.Model return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as History); - } - /// - /// Returns true if History instances are equal - /// - /// Instance of History to be compared - /// Boolean - public bool Equals(History input) - { - if (input == null) - { - return false; - } - return - ( - this.Id == input.Id || - this.Id.Equals(input.Id) - ) && - ( - this.ParticipantId == input.ParticipantId || - this.ParticipantId.Equals(input.ParticipantId) - ) && - ( - this.ShipcallId == input.ShipcallId || - this.ShipcallId.Equals(input.ShipcallId) - ) && - ( - this.Timestamp == input.Timestamp || - (this.Timestamp != null && - this.Timestamp.Equals(input.Timestamp)) - ) && - ( - this.Eta == input.Eta || - (this.Eta != null && - this.Eta.Equals(input.Eta)) - ) && - ( - this.Operation == input.Operation || - this.Operation.Equals(input.Operation) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); - } - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); - hashCode = (hashCode * 59) + this.ShipcallId.GetHashCode(); - if (this.Timestamp != null) - { - hashCode = (hashCode * 59) + this.Timestamp.GetHashCode(); - } - if (this.Eta != null) - { - hashCode = (hashCode * 59) + this.Eta.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Operation.GetHashCode(); - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } - } - /// /// To validate all properties of the instance /// /// Validation context @@ -6866,7 +6596,7 @@ namespace BreCalClient.misc.Model /// A unique identifier for an entity /// [DataContract(Name = "Id")] - public partial class Id : IEquatable, IValidatableObject + public partial class Id : IValidatableObject { /// /// Initializes a new instance of the class. @@ -6902,45 +6632,6 @@ namespace BreCalClient.misc.Model return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Id); - } - /// - /// Returns true if Id instances are equal - /// - /// Instance of Id to be compared - /// Boolean - public bool Equals(Id input) - { - if (input == null) - { - return false; - } - return - ( - this.VarId == input.VarId || - this.VarId.Equals(input.VarId) - ); - } - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.VarId.GetHashCode(); - return hashCode; - } - } - /// /// To validate all properties of the instance /// /// Validation context @@ -6967,7 +6658,7 @@ namespace BreCalClient.misc.Model /// result structure of a successful login attempt /// [DataContract(Name = "login_result")] - public partial class LoginResult : IEquatable, IValidatableObject + public partial class LoginResult : IValidatableObject { /// /// Initializes a new instance of the class. @@ -7067,109 +6758,6 @@ namespace BreCalClient.misc.Model return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as LoginResult); - } - /// - /// Returns true if LoginResult instances are equal - /// - /// Instance of LoginResult to be compared - /// Boolean - public bool Equals(LoginResult input) - { - if (input == null) - { - return false; - } - return - ( - this.Id == input.Id || - this.Id.Equals(input.Id) - ) && - ( - this.ParticipantId == input.ParticipantId || - this.ParticipantId.Equals(input.ParticipantId) - ) && - ( - this.FirstName == input.FirstName || - (this.FirstName != null && - this.FirstName.Equals(input.FirstName)) - ) && - ( - this.LastName == input.LastName || - (this.LastName != null && - this.LastName.Equals(input.LastName)) - ) && - ( - this.UserName == input.UserName || - (this.UserName != null && - this.UserName.Equals(input.UserName)) - ) && - ( - this.UserPhone == input.UserPhone || - (this.UserPhone != null && - this.UserPhone.Equals(input.UserPhone)) - ) && - ( - this.UserEmail == input.UserEmail || - (this.UserEmail != null && - this.UserEmail.Equals(input.UserEmail)) - ) && - ( - this.Exp == input.Exp || - this.Exp.Equals(input.Exp) - ) && - ( - this.Token == input.Token || - (this.Token != null && - this.Token.Equals(input.Token)) - ); - } - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); - if (this.FirstName != null) - { - hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); - } - if (this.LastName != null) - { - hashCode = (hashCode * 59) + this.LastName.GetHashCode(); - } - if (this.UserName != null) - { - hashCode = (hashCode * 59) + this.UserName.GetHashCode(); - } - if (this.UserPhone != null) - { - hashCode = (hashCode * 59) + this.UserPhone.GetHashCode(); - } - if (this.UserEmail != null) - { - hashCode = (hashCode * 59) + this.UserEmail.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Exp.GetHashCode(); - if (this.Token != null) - { - hashCode = (hashCode * 59) + this.Token.GetHashCode(); - } - return hashCode; - } - } - /// /// To validate all properties of the instance /// /// Validation context @@ -7196,7 +6784,7 @@ namespace BreCalClient.misc.Model /// a notification created by the engine if a times entry violates a rule /// [DataContract(Name = "notification")] - public partial class Notification : IEquatable, IValidatableObject + public partial class Notification : IValidatableObject { /// /// Gets or Sets NotificationType @@ -7274,82 +6862,6 @@ namespace BreCalClient.misc.Model return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Notification); - } - /// - /// Returns true if Notification instances are equal - /// - /// Instance of Notification to be compared - /// Boolean - public bool Equals(Notification input) - { - if (input == null) - { - return false; - } - return - ( - this.Id == input.Id || - this.Id.Equals(input.Id) - ) && - ( - this.ShipcallId == input.ShipcallId || - this.ShipcallId.Equals(input.ShipcallId) - ) && - ( - this.NotificationType == input.NotificationType || - this.NotificationType.Equals(input.NotificationType) - ) && - ( - this.Message == input.Message || - (this.Message != null && - this.Message.Equals(input.Message)) - ) && - ( - this.Created == input.Created || - (this.Created != null && - this.Created.Equals(input.Created)) - ) && - ( - this.Modified == input.Modified || - (this.Modified != null && - this.Modified.Equals(input.Modified)) - ); - } - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - hashCode = (hashCode * 59) + this.ShipcallId.GetHashCode(); - hashCode = (hashCode * 59) + this.NotificationType.GetHashCode(); - if (this.Message != null) - { - hashCode = (hashCode * 59) + this.Message.GetHashCode(); - } - if (this.Created != null) - { - hashCode = (hashCode * 59) + this.Created.GetHashCode(); - } - if (this.Modified != null) - { - hashCode = (hashCode * 59) + this.Modified.GetHashCode(); - } - return hashCode; - } - } - /// /// To validate all properties of the instance /// /// Validation context @@ -7476,7 +6988,7 @@ namespace BreCalClient.misc.Model /// A organisational entity that participates in Bremen Calling /// [DataContract(Name = "participant")] - public partial class Participant : IEquatable, IValidatableObject + public partial class Participant : IValidatableObject { /// /// Initializes a new instance of the class. @@ -7587,118 +7099,6 @@ namespace BreCalClient.misc.Model return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Participant); - } - /// - /// Returns true if Participant instances are equal - /// - /// Instance of Participant to be compared - /// Boolean - public bool Equals(Participant input) - { - if (input == null) - { - return false; - } - return - ( - this.Id == input.Id || - this.Id.Equals(input.Id) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.Street == input.Street || - (this.Street != null && - this.Street.Equals(input.Street)) - ) && - ( - this.PostalCode == input.PostalCode || - (this.PostalCode != null && - this.PostalCode.Equals(input.PostalCode)) - ) && - ( - this.City == input.City || - (this.City != null && - this.City.Equals(input.City)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ) && - ( - this.Flags == input.Flags || - (this.Flags != null && - this.Flags.Equals(input.Flags)) - ) && - ( - this.Created == input.Created || - (this.Created != null && - this.Created.Equals(input.Created)) - ) && - ( - this.Modified == input.Modified || - (this.Modified != null && - this.Modified.Equals(input.Modified)) - ) && - ( - this.Deleted == input.Deleted || - this.Deleted.Equals(input.Deleted) - ); - } - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - if (this.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - if (this.Street != null) - { - hashCode = (hashCode * 59) + this.Street.GetHashCode(); - } - if (this.PostalCode != null) - { - hashCode = (hashCode * 59) + this.PostalCode.GetHashCode(); - } - if (this.City != null) - { - hashCode = (hashCode * 59) + this.City.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - if (this.Flags != null) - { - hashCode = (hashCode * 59) + this.Flags.GetHashCode(); - } - if (this.Created != null) - { - hashCode = (hashCode * 59) + this.Created.GetHashCode(); - } - if (this.Modified != null) - { - hashCode = (hashCode * 59) + this.Modified.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Deleted.GetHashCode(); - return hashCode; - } - } - /// /// To validate all properties of the instance /// /// Validation context @@ -7745,7 +7145,7 @@ namespace BreCalClient.misc.Model /// Participant assigned to a shipcall with a given role (type) /// [DataContract(Name = "participant_assignment")] - public partial class ParticipantAssignment : IEquatable, IValidatableObject + public partial class ParticipantAssignment : IValidatableObject { /// /// Initializes a new instance of the class. @@ -7795,50 +7195,6 @@ namespace BreCalClient.misc.Model return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as ParticipantAssignment); - } - /// - /// Returns true if ParticipantAssignment instances are equal - /// - /// Instance of ParticipantAssignment to be compared - /// Boolean - public bool Equals(ParticipantAssignment input) - { - if (input == null) - { - return false; - } - return - ( - this.ParticipantId == input.ParticipantId || - this.ParticipantId.Equals(input.ParticipantId) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); - } - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } - } - /// /// To validate all properties of the instance /// /// Validation context @@ -7865,7 +7221,7 @@ namespace BreCalClient.misc.Model /// a ship /// [DataContract(Name = "ship")] - public partial class Ship : IEquatable, IValidatableObject + public partial class Ship : IValidatableObject { /// /// Initializes a new instance of the class. @@ -7883,7 +7239,7 @@ namespace BreCalClient.misc.Model /// created. /// modified. /// deleted (default to false). - public Ship(int id = default(int), string name = default(string), int? imo = default(int?), string callsign = default(string), int? participantId = default(int?), float? length = default(float?), float? width = default(float?), bool isTug = false, int? bollardPull = default(int?), int? eni = default(int?), DateTime created = default(DateTime), DateTime? modified = default(DateTime?), bool deleted = false) + public Ship(int id = default(int), string name = default(string), int? imo = default(int?), string callsign = default(string), int? participantId = default(int?), double? length = default(double?), double? width = default(double?), bool isTug = false, int? bollardPull = default(int?), int? eni = default(int?), DateTime created = default(DateTime), DateTime? modified = default(DateTime?), bool deleted = false) { this.Id = id; this.Name = name; @@ -7929,12 +7285,12 @@ namespace BreCalClient.misc.Model /// Gets or Sets Length /// [DataMember(Name = "length", EmitDefaultValue = true)] - public float? Length { get; set; } + public double? Length { get; set; } /// /// Gets or Sets Width /// [DataMember(Name = "width", EmitDefaultValue = true)] - public float? Width { get; set; } + public double? Width { get; set; } /// /// Gets or Sets IsTug /// @@ -7999,145 +7355,6 @@ namespace BreCalClient.misc.Model return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Ship); - } - /// - /// Returns true if Ship instances are equal - /// - /// Instance of Ship to be compared - /// Boolean - public bool Equals(Ship input) - { - if (input == null) - { - return false; - } - return - ( - this.Id == input.Id || - this.Id.Equals(input.Id) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.Imo == input.Imo || - (this.Imo != null && - this.Imo.Equals(input.Imo)) - ) && - ( - this.Callsign == input.Callsign || - (this.Callsign != null && - this.Callsign.Equals(input.Callsign)) - ) && - ( - this.ParticipantId == input.ParticipantId || - (this.ParticipantId != null && - this.ParticipantId.Equals(input.ParticipantId)) - ) && - ( - this.Length == input.Length || - (this.Length != null && - this.Length.Equals(input.Length)) - ) && - ( - this.Width == input.Width || - (this.Width != null && - this.Width.Equals(input.Width)) - ) && - ( - this.IsTug == input.IsTug || - this.IsTug.Equals(input.IsTug) - ) && - ( - this.BollardPull == input.BollardPull || - (this.BollardPull != null && - this.BollardPull.Equals(input.BollardPull)) - ) && - ( - this.Eni == input.Eni || - (this.Eni != null && - this.Eni.Equals(input.Eni)) - ) && - ( - this.Created == input.Created || - (this.Created != null && - this.Created.Equals(input.Created)) - ) && - ( - this.Modified == input.Modified || - (this.Modified != null && - this.Modified.Equals(input.Modified)) - ) && - ( - this.Deleted == input.Deleted || - this.Deleted.Equals(input.Deleted) - ); - } - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - if (this.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - if (this.Imo != null) - { - hashCode = (hashCode * 59) + this.Imo.GetHashCode(); - } - if (this.Callsign != null) - { - hashCode = (hashCode * 59) + this.Callsign.GetHashCode(); - } - if (this.ParticipantId != null) - { - hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); - } - if (this.Length != null) - { - hashCode = (hashCode * 59) + this.Length.GetHashCode(); - } - if (this.Width != null) - { - hashCode = (hashCode * 59) + this.Width.GetHashCode(); - } - hashCode = (hashCode * 59) + this.IsTug.GetHashCode(); - if (this.BollardPull != null) - { - hashCode = (hashCode * 59) + this.BollardPull.GetHashCode(); - } - if (this.Eni != null) - { - hashCode = (hashCode * 59) + this.Eni.GetHashCode(); - } - if (this.Created != null) - { - hashCode = (hashCode * 59) + this.Created.GetHashCode(); - } - if (this.Modified != null) - { - hashCode = (hashCode * 59) + this.Modified.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Deleted.GetHashCode(); - return hashCode; - } - } - /// /// To validate all properties of the instance /// /// Validation context @@ -8174,7 +7391,7 @@ namespace BreCalClient.misc.Model /// Shipcall /// [DataContract(Name = "shipcall")] - public partial class Shipcall : IEquatable, IValidatableObject + public partial class Shipcall : IValidatableObject { /// /// Gets or Sets Type @@ -8222,7 +7439,7 @@ namespace BreCalClient.misc.Model /// participants. /// Readonly field set by the database. /// Readonly field set by the database. - public Shipcall(int id = default(int), int shipId = default(int), ShipcallType type = default(ShipcallType), 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?), EvaluationType? evaluation = default(EvaluationType?), string evaluationMessage = default(string), List participants = default(List), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) + public Shipcall(int id = default(int), int shipId = default(int), ShipcallType type = default(ShipcallType), 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?), double? draft = default(double?), 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?), EvaluationType? evaluation = default(EvaluationType?), string evaluationMessage = default(string), List participants = default(List), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) { this.Id = id; this.ShipId = shipId; @@ -8328,7 +7545,7 @@ namespace BreCalClient.misc.Model /// Gets or Sets Draft /// [DataMember(Name = "draft", EmitDefaultValue = true)] - public float? Draft { get; set; } + public double? Draft { get; set; } /// /// Gets or Sets TidalWindowFrom /// @@ -8434,277 +7651,6 @@ namespace BreCalClient.misc.Model return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Shipcall); - } - /// - /// Returns true if Shipcall instances are equal - /// - /// Instance of Shipcall to be compared - /// Boolean - public bool Equals(Shipcall input) - { - if (input == null) - { - return false; - } - return - ( - this.Id == input.Id || - this.Id.Equals(input.Id) - ) && - ( - this.ShipId == input.ShipId || - this.ShipId.Equals(input.ShipId) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ) && - ( - this.Eta == input.Eta || - (this.Eta != null && - this.Eta.Equals(input.Eta)) - ) && - ( - this.Voyage == input.Voyage || - (this.Voyage != null && - this.Voyage.Equals(input.Voyage)) - ) && - ( - this.Etd == input.Etd || - (this.Etd != null && - this.Etd.Equals(input.Etd)) - ) && - ( - this.ArrivalBerthId == input.ArrivalBerthId || - (this.ArrivalBerthId != null && - this.ArrivalBerthId.Equals(input.ArrivalBerthId)) - ) && - ( - this.DepartureBerthId == input.DepartureBerthId || - (this.DepartureBerthId != null && - this.DepartureBerthId.Equals(input.DepartureBerthId)) - ) && - ( - this.TugRequired == input.TugRequired || - (this.TugRequired != null && - this.TugRequired.Equals(input.TugRequired)) - ) && - ( - this.PilotRequired == input.PilotRequired || - (this.PilotRequired != null && - this.PilotRequired.Equals(input.PilotRequired)) - ) && - ( - this.Flags == input.Flags || - (this.Flags != null && - this.Flags.Equals(input.Flags)) - ) && - ( - this.PierSide == input.PierSide || - (this.PierSide != null && - this.PierSide.Equals(input.PierSide)) - ) && - ( - this.Bunkering == input.Bunkering || - (this.Bunkering != null && - this.Bunkering.Equals(input.Bunkering)) - ) && - ( - this.ReplenishingTerminal == input.ReplenishingTerminal || - (this.ReplenishingTerminal != null && - this.ReplenishingTerminal.Equals(input.ReplenishingTerminal)) - ) && - ( - this.ReplenishingLock == input.ReplenishingLock || - (this.ReplenishingLock != null && - this.ReplenishingLock.Equals(input.ReplenishingLock)) - ) && - ( - this.Draft == input.Draft || - (this.Draft != null && - this.Draft.Equals(input.Draft)) - ) && - ( - this.TidalWindowFrom == input.TidalWindowFrom || - (this.TidalWindowFrom != null && - this.TidalWindowFrom.Equals(input.TidalWindowFrom)) - ) && - ( - this.TidalWindowTo == input.TidalWindowTo || - (this.TidalWindowTo != null && - this.TidalWindowTo.Equals(input.TidalWindowTo)) - ) && - ( - this.RainSensitiveCargo == input.RainSensitiveCargo || - (this.RainSensitiveCargo != null && - this.RainSensitiveCargo.Equals(input.RainSensitiveCargo)) - ) && - ( - this.RecommendedTugs == input.RecommendedTugs || - (this.RecommendedTugs != null && - this.RecommendedTugs.Equals(input.RecommendedTugs)) - ) && - ( - this.Anchored == input.Anchored || - (this.Anchored != null && - this.Anchored.Equals(input.Anchored)) - ) && - ( - this.MooredLock == input.MooredLock || - (this.MooredLock != null && - this.MooredLock.Equals(input.MooredLock)) - ) && - ( - this.Canceled == input.Canceled || - (this.Canceled != null && - this.Canceled.Equals(input.Canceled)) - ) && - ( - this.Evaluation == input.Evaluation || - this.Evaluation.Equals(input.Evaluation) - ) && - ( - this.EvaluationMessage == input.EvaluationMessage || - (this.EvaluationMessage != null && - this.EvaluationMessage.Equals(input.EvaluationMessage)) - ) && - ( - this.Participants == input.Participants || - this.Participants != null && - input.Participants != null && - this.Participants.SequenceEqual(input.Participants) - ) && - ( - this.Created == input.Created || - (this.Created != null && - this.Created.Equals(input.Created)) - ) && - ( - this.Modified == input.Modified || - (this.Modified != null && - this.Modified.Equals(input.Modified)) - ); - } - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - hashCode = (hashCode * 59) + this.ShipId.GetHashCode(); - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - if (this.Eta != null) - { - hashCode = (hashCode * 59) + this.Eta.GetHashCode(); - } - if (this.Voyage != null) - { - hashCode = (hashCode * 59) + this.Voyage.GetHashCode(); - } - if (this.Etd != null) - { - hashCode = (hashCode * 59) + this.Etd.GetHashCode(); - } - if (this.ArrivalBerthId != null) - { - hashCode = (hashCode * 59) + this.ArrivalBerthId.GetHashCode(); - } - if (this.DepartureBerthId != null) - { - hashCode = (hashCode * 59) + this.DepartureBerthId.GetHashCode(); - } - if (this.TugRequired != null) - { - hashCode = (hashCode * 59) + this.TugRequired.GetHashCode(); - } - if (this.PilotRequired != null) - { - hashCode = (hashCode * 59) + this.PilotRequired.GetHashCode(); - } - if (this.Flags != null) - { - hashCode = (hashCode * 59) + this.Flags.GetHashCode(); - } - if (this.PierSide != null) - { - hashCode = (hashCode * 59) + this.PierSide.GetHashCode(); - } - if (this.Bunkering != null) - { - hashCode = (hashCode * 59) + this.Bunkering.GetHashCode(); - } - if (this.ReplenishingTerminal != null) - { - hashCode = (hashCode * 59) + this.ReplenishingTerminal.GetHashCode(); - } - if (this.ReplenishingLock != null) - { - hashCode = (hashCode * 59) + this.ReplenishingLock.GetHashCode(); - } - if (this.Draft != null) - { - hashCode = (hashCode * 59) + this.Draft.GetHashCode(); - } - if (this.TidalWindowFrom != null) - { - hashCode = (hashCode * 59) + this.TidalWindowFrom.GetHashCode(); - } - if (this.TidalWindowTo != null) - { - hashCode = (hashCode * 59) + this.TidalWindowTo.GetHashCode(); - } - if (this.RainSensitiveCargo != null) - { - hashCode = (hashCode * 59) + this.RainSensitiveCargo.GetHashCode(); - } - if (this.RecommendedTugs != null) - { - hashCode = (hashCode * 59) + this.RecommendedTugs.GetHashCode(); - } - if (this.Anchored != null) - { - hashCode = (hashCode * 59) + this.Anchored.GetHashCode(); - } - if (this.MooredLock != null) - { - hashCode = (hashCode * 59) + this.MooredLock.GetHashCode(); - } - if (this.Canceled != null) - { - hashCode = (hashCode * 59) + this.Canceled.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Evaluation.GetHashCode(); - if (this.EvaluationMessage != null) - { - hashCode = (hashCode * 59) + this.EvaluationMessage.GetHashCode(); - } - if (this.Participants != null) - { - hashCode = (hashCode * 59) + this.Participants.GetHashCode(); - } - if (this.Created != null) - { - hashCode = (hashCode * 59) + this.Created.GetHashCode(); - } - if (this.Modified != null) - { - hashCode = (hashCode * 59) + this.Modified.GetHashCode(); - } - return hashCode; - } - } - /// /// To validate all properties of the instance /// /// Validation context @@ -8781,7 +7727,7 @@ namespace BreCalClient.misc.Model /// the id parameter needs to be missing on POST and to be present on PUT (Update) calls, otherwise a 400 response will be generated /// [DataContract(Name = "times")] - public partial class Times : IEquatable, IValidatableObject + public partial class Times : IValidatableObject { /// /// Initializes a new instance of the class. @@ -8991,204 +7937,6 @@ namespace BreCalClient.misc.Model return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Times); - } - /// - /// Returns true if Times instances are equal - /// - /// Instance of Times to be compared - /// Boolean - public bool Equals(Times input) - { - if (input == null) - { - return false; - } - return - ( - this.Id == input.Id || - this.Id.Equals(input.Id) - ) && - ( - this.EtaBerth == input.EtaBerth || - (this.EtaBerth != null && - this.EtaBerth.Equals(input.EtaBerth)) - ) && - ( - this.EtaBerthFixed == input.EtaBerthFixed || - (this.EtaBerthFixed != null && - this.EtaBerthFixed.Equals(input.EtaBerthFixed)) - ) && - ( - this.EtdBerth == input.EtdBerth || - (this.EtdBerth != null && - this.EtdBerth.Equals(input.EtdBerth)) - ) && - ( - this.EtdBerthFixed == input.EtdBerthFixed || - (this.EtdBerthFixed != null && - this.EtdBerthFixed.Equals(input.EtdBerthFixed)) - ) && - ( - this.LockTime == input.LockTime || - (this.LockTime != null && - this.LockTime.Equals(input.LockTime)) - ) && - ( - this.LockTimeFixed == input.LockTimeFixed || - (this.LockTimeFixed != null && - this.LockTimeFixed.Equals(input.LockTimeFixed)) - ) && - ( - this.ZoneEntry == input.ZoneEntry || - (this.ZoneEntry != null && - this.ZoneEntry.Equals(input.ZoneEntry)) - ) && - ( - this.ZoneEntryFixed == input.ZoneEntryFixed || - (this.ZoneEntryFixed != null && - this.ZoneEntryFixed.Equals(input.ZoneEntryFixed)) - ) && - ( - this.OperationsStart == input.OperationsStart || - (this.OperationsStart != null && - this.OperationsStart.Equals(input.OperationsStart)) - ) && - ( - this.OperationsEnd == input.OperationsEnd || - (this.OperationsEnd != null && - this.OperationsEnd.Equals(input.OperationsEnd)) - ) && - ( - this.Remarks == input.Remarks || - (this.Remarks != null && - this.Remarks.Equals(input.Remarks)) - ) && - ( - this.ShipcallId == input.ShipcallId || - this.ShipcallId.Equals(input.ShipcallId) - ) && - ( - this.ParticipantId == input.ParticipantId || - this.ParticipantId.Equals(input.ParticipantId) - ) && - ( - this.BerthId == input.BerthId || - (this.BerthId != null && - this.BerthId.Equals(input.BerthId)) - ) && - ( - this.BerthInfo == input.BerthInfo || - (this.BerthInfo != null && - this.BerthInfo.Equals(input.BerthInfo)) - ) && - ( - this.PierSide == input.PierSide || - (this.PierSide != null && - this.PierSide.Equals(input.PierSide)) - ) && - ( - this.ParticipantType == input.ParticipantType || - this.ParticipantType.Equals(input.ParticipantType) - ) && - ( - this.Created == input.Created || - (this.Created != null && - this.Created.Equals(input.Created)) - ) && - ( - this.Modified == input.Modified || - (this.Modified != null && - this.Modified.Equals(input.Modified)) - ); - } - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - if (this.EtaBerth != null) - { - hashCode = (hashCode * 59) + this.EtaBerth.GetHashCode(); - } - if (this.EtaBerthFixed != null) - { - hashCode = (hashCode * 59) + this.EtaBerthFixed.GetHashCode(); - } - if (this.EtdBerth != null) - { - hashCode = (hashCode * 59) + this.EtdBerth.GetHashCode(); - } - if (this.EtdBerthFixed != null) - { - hashCode = (hashCode * 59) + this.EtdBerthFixed.GetHashCode(); - } - if (this.LockTime != null) - { - hashCode = (hashCode * 59) + this.LockTime.GetHashCode(); - } - if (this.LockTimeFixed != null) - { - hashCode = (hashCode * 59) + this.LockTimeFixed.GetHashCode(); - } - if (this.ZoneEntry != null) - { - hashCode = (hashCode * 59) + this.ZoneEntry.GetHashCode(); - } - if (this.ZoneEntryFixed != null) - { - hashCode = (hashCode * 59) + this.ZoneEntryFixed.GetHashCode(); - } - if (this.OperationsStart != null) - { - hashCode = (hashCode * 59) + this.OperationsStart.GetHashCode(); - } - if (this.OperationsEnd != null) - { - hashCode = (hashCode * 59) + this.OperationsEnd.GetHashCode(); - } - if (this.Remarks != null) - { - hashCode = (hashCode * 59) + this.Remarks.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ShipcallId.GetHashCode(); - hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); - if (this.BerthId != null) - { - hashCode = (hashCode * 59) + this.BerthId.GetHashCode(); - } - if (this.BerthInfo != null) - { - hashCode = (hashCode * 59) + this.BerthInfo.GetHashCode(); - } - if (this.PierSide != null) - { - hashCode = (hashCode * 59) + this.PierSide.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ParticipantType.GetHashCode(); - if (this.Created != null) - { - hashCode = (hashCode * 59) + this.Created.GetHashCode(); - } - if (this.Modified != null) - { - hashCode = (hashCode * 59) + this.Modified.GetHashCode(); - } - return hashCode; - } - } - /// /// To validate all properties of the instance /// /// Validation context @@ -9225,7 +7973,7 @@ namespace BreCalClient.misc.Model /// fields that a user may change /// [DataContract(Name = "user_details")] - public partial class UserDetails : IEquatable, IValidatableObject + public partial class UserDetails : IValidatableObject { /// /// Initializes a new instance of the class. @@ -9309,99 +8057,6 @@ namespace BreCalClient.misc.Model return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as UserDetails); - } - /// - /// Returns true if UserDetails instances are equal - /// - /// Instance of UserDetails to be compared - /// Boolean - public bool Equals(UserDetails input) - { - if (input == null) - { - return false; - } - return - ( - this.Id == input.Id || - this.Id.Equals(input.Id) - ) && - ( - this.OldPassword == input.OldPassword || - (this.OldPassword != null && - this.OldPassword.Equals(input.OldPassword)) - ) && - ( - this.NewPassword == input.NewPassword || - (this.NewPassword != null && - this.NewPassword.Equals(input.NewPassword)) - ) && - ( - this.FirstName == input.FirstName || - (this.FirstName != null && - this.FirstName.Equals(input.FirstName)) - ) && - ( - this.LastName == input.LastName || - (this.LastName != null && - this.LastName.Equals(input.LastName)) - ) && - ( - this.UserPhone == input.UserPhone || - (this.UserPhone != null && - this.UserPhone.Equals(input.UserPhone)) - ) && - ( - this.UserEmail == input.UserEmail || - (this.UserEmail != null && - this.UserEmail.Equals(input.UserEmail)) - ); - } - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - if (this.OldPassword != null) - { - hashCode = (hashCode * 59) + this.OldPassword.GetHashCode(); - } - if (this.NewPassword != null) - { - hashCode = (hashCode * 59) + this.NewPassword.GetHashCode(); - } - if (this.FirstName != null) - { - hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); - } - if (this.LastName != null) - { - hashCode = (hashCode * 59) + this.LastName.GetHashCode(); - } - if (this.UserPhone != null) - { - hashCode = (hashCode * 59) + this.UserPhone.GetHashCode(); - } - if (this.UserEmail != null) - { - hashCode = (hashCode * 59) + this.UserEmail.GetHashCode(); - } - return hashCode; - } - } - /// /// To validate all properties of the instance /// /// Validation context diff --git a/misc/BreCalApi.yaml b/misc/BreCalApi.yaml index 91c27db..9864996 100644 --- a/misc/BreCalApi.yaml +++ b/misc/BreCalApi.yaml @@ -531,7 +531,7 @@ components: nullable: true draft: type: number - format: float + format: double nullable: true tidal_window_from: type: string @@ -733,11 +733,11 @@ components: description: Optional reference to participant (tug role) length: type: number - format: float + format: double nullable: true width: type: number - format: float + format: double nullable: true is_tug: type: boolean diff --git a/src/BreCalClient/EditShipDialog.xaml b/src/BreCalClient/EditShipDialog.xaml index 6ffead4..8b5e324 100644 --- a/src/BreCalClient/EditShipDialog.xaml +++ b/src/BreCalClient/EditShipDialog.xaml @@ -4,9 +4,11 @@ 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:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" - mc:Ignorable="d" Left="{local:SettingBinding W1Left}" Top="{local:SettingBinding W1Top}" - Title="Edit ship" Height="250" Width="500" Loaded="buttonOK_Click"> + mc:Ignorable="d" + Left="{local:SettingBinding W1Left}" Top="{local:SettingBinding W1Top}" + Title="{x:Static p:Resources.textEditShip}" Height="250" Width="500" Loaded="Window_Loaded" ResizeMode="NoResize"> @@ -24,27 +26,27 @@