diff --git a/src/BreCalClient/EditShipcallControl.xaml.cs b/src/BreCalClient/EditShipcallControl.xaml.cs index a823011..ed8b092 100644 --- a/src/BreCalClient/EditShipcallControl.xaml.cs +++ b/src/BreCalClient/EditShipcallControl.xaml.cs @@ -80,6 +80,7 @@ namespace BreCalClient this.comboBoxArrivalBerth.ItemsSource = this.Berths; this.comboBoxDepartureBerth.ItemsSource = this.Berths; + if (this.ShipcallModel.Shipcall == null) this.ShipcallModel.Shipcall = new(); this.CopyToControls(); this.EnableControls(); @@ -167,6 +168,7 @@ namespace BreCalClient this.ShipcallModel.Shipcall.Etd = this.datePickerETD.Value ?? DateTime.Now.AddDays(1); this.ShipcallModel.Shipcall.Anchored = this.checkBoxAnchored.IsChecked; this.ShipcallModel.Shipcall.ShipId = ((Ship)this.comboBoxShip.SelectedItem).Id; + this.ShipcallModel.Ship = (Ship)this.comboBoxShip.SelectedItem; this.ShipcallModel.Shipcall.ArrivalBerthId = (this.comboBoxArrivalBerth.SelectedItem != null) ? ((Berth)this.comboBoxArrivalBerth.SelectedItem).Id : null; this.ShipcallModel.Shipcall.DepartureBerthId = (this.comboBoxDepartureBerth.SelectedItem != null) ? ((Berth)this.comboBoxDepartureBerth.SelectedItem).Id : null; this.ShipcallModel.Shipcall.Bunkering = this.checkBoxBunkering.IsChecked; @@ -185,7 +187,7 @@ namespace BreCalClient { this.ShipcallModel.Shipcall.PierSide = (this.comboBoxPierside.SelectedIndex == 0) ? true : false; } - + // remove all and add selected participants this.ShipcallModel.Shipcall.Participants.Clear(); this.ShipcallModel.AssignedParticipants.Clear(); diff --git a/src/BreCalClient/MainWindow.xaml.cs b/src/BreCalClient/MainWindow.xaml.cs index 5bb87dd..7c7b9a5 100644 --- a/src/BreCalClient/MainWindow.xaml.cs +++ b/src/BreCalClient/MainWindow.xaml.cs @@ -475,7 +475,7 @@ namespace BreCalClient if(!_showCanceled ?? true) // canceled calls are filtered by default { - this._visibleControlModels.RemoveAll(x => x.Shipcall?.Canceled ?? true); + this._visibleControlModels.RemoveAll(x => x.Shipcall?.Canceled ?? false); } if (this._sortOrder != null)