fixed saving of new shipcalls, reversed logic of cancelled ship filter

This commit is contained in:
Daniel Schick 2023-09-22 16:21:53 +02:00 committed by puls200
parent 6872df4278
commit 2f0ca85c19
2 changed files with 4 additions and 2 deletions

View File

@ -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();

View File

@ -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)