Added agency port dependency when editing shipcalls
This commit is contained in:
parent
6215449bc8
commit
3b3601baeb
@ -148,6 +148,17 @@ namespace BreCalClient
|
||||
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
|
||||
|
||||
#region Internal initializer methods
|
||||
|
||||
@ -445,9 +445,9 @@ namespace BreCalClient
|
||||
this.comboBoxDepartureBerth.ItemsSource = availableBerths;
|
||||
|
||||
// Filter agency combobox by port
|
||||
|
||||
// TODO
|
||||
|
||||
List<Participant> availableAgencies = BreCalLists.GetParticipants(port.Id, ParticipantType.AGENCY);
|
||||
this.comboBoxAgency.ItemsSource = null;
|
||||
this.comboBoxAgency.ItemsSource = availableAgencies;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@ -45,6 +45,12 @@ namespace RoleEditor
|
||||
else
|
||||
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.Close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user