Added agency port dependency when editing shipcalls
This commit is contained in:
parent
6215449bc8
commit
3b3601baeb
@ -148,6 +148,17 @@ namespace BreCalClient
|
|||||||
return berths;
|
return berths;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<Participant> GetParticipants(int port, Extensions.ParticipantType type)
|
||||||
|
{
|
||||||
|
List<Participant> participants = new();
|
||||||
|
foreach(Participant participant in _participants)
|
||||||
|
{
|
||||||
|
if(participant.IsTypeFlagSet(type) && participant.Ports.Contains(port))
|
||||||
|
participants.Add(participant);
|
||||||
|
}
|
||||||
|
return participants;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Internal initializer methods
|
#region Internal initializer methods
|
||||||
|
|||||||
@ -445,9 +445,9 @@ namespace BreCalClient
|
|||||||
this.comboBoxDepartureBerth.ItemsSource = availableBerths;
|
this.comboBoxDepartureBerth.ItemsSource = availableBerths;
|
||||||
|
|
||||||
// Filter agency combobox by port
|
// Filter agency combobox by port
|
||||||
|
List<Participant> availableAgencies = BreCalLists.GetParticipants(port.Id, ParticipantType.AGENCY);
|
||||||
// TODO
|
this.comboBoxAgency.ItemsSource = null;
|
||||||
|
this.comboBoxAgency.ItemsSource = availableAgencies;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@ -45,6 +45,12 @@ namespace RoleEditor
|
|||||||
else
|
else
|
||||||
this.Berth.Authority_Id = null;
|
this.Berth.Authority_Id = null;
|
||||||
|
|
||||||
|
this.Berth.Port = this.comboBoxPorts.SelectedItem as Port;
|
||||||
|
if (this.Berth.Port != null)
|
||||||
|
this.Berth.Port_Id = this.Berth.Port.Id;
|
||||||
|
else
|
||||||
|
this.Berth.Port_Id = null;
|
||||||
|
|
||||||
this.DialogResult = true;
|
this.DialogResult = true;
|
||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user