Make pier filter combobox dependent on selected harbour
This commit is contained in:
parent
184d15554b
commit
ddae95b784
@ -374,8 +374,18 @@ namespace BreCalClient
|
|||||||
private void comboBoxPorts_ItemSelectionChanged(object sender, Xceed.Wpf.Toolkit.Primitives.ItemSelectionChangedEventArgs e)
|
private void comboBoxPorts_ItemSelectionChanged(object sender, Xceed.Wpf.Toolkit.Primitives.ItemSelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
this.searchFilterControl.SearchFilter.Ports.Clear();
|
this.searchFilterControl.SearchFilter.Ports.Clear();
|
||||||
|
|
||||||
|
List<Berth> berths = new List<Berth>();
|
||||||
foreach (Port port in comboBoxPorts.SelectedItems)
|
foreach (Port port in comboBoxPorts.SelectedItems)
|
||||||
|
{
|
||||||
this.searchFilterControl.SearchFilter.Ports.Add(port.Id);
|
this.searchFilterControl.SearchFilter.Ports.Add(port.Id);
|
||||||
|
berths.AddRange(BreCalLists.GetBerthsByPort(port.Id));
|
||||||
|
}
|
||||||
|
// create list of berths from selected port(s) or return all berths
|
||||||
|
if (berths.Count == 0)
|
||||||
|
berths = BreCalLists.AllBerths;
|
||||||
|
this.searchFilterControl.SetBerths(berths);
|
||||||
|
|
||||||
this.SearchFilterControl_SearchFilterChanged();
|
this.SearchFilterControl_SearchFilterChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user