diff --git a/ENI2/DetailViewControls/PortNotificationDetailControl.xaml.cs b/ENI2/DetailViewControls/PortNotificationDetailControl.xaml.cs index 8e681dc9..b8da8be2 100644 --- a/ENI2/DetailViewControls/PortNotificationDetailControl.xaml.cs +++ b/ENI2/DetailViewControls/PortNotificationDetailControl.xaml.cs @@ -123,7 +123,7 @@ namespace ENI2.DetailViewControls _infoMessage.Elements.Add(info); } - portAreas = PortArea.getPortAreasForLocode(this.Core.PoC); + portAreas = await PortArea.getPortAreasForLocode(this.Core.PoC); this.comboBoxPortArea.ItemsSource = portAreas; this.comboBoxShippingArea.ItemsSource = shippingAreas; diff --git a/ENI2/SheetDisplayControls/PortControl.xaml.cs b/ENI2/SheetDisplayControls/PortControl.xaml.cs index 31deb744..47497c90 100644 --- a/ENI2/SheetDisplayControls/PortControl.xaml.cs +++ b/ENI2/SheetDisplayControls/PortControl.xaml.cs @@ -108,7 +108,7 @@ namespace ENI2.SheetDisplayControls this.dataGridCallPurposes.CreateRequested += DataGridCallPurposes_CreateRequested; this.dataGridCallPurposes.DeleteRequested += DataGridCallPurposes_DeleteRequested; - portAreas = PortArea.getPortAreasForLocode(this.Core.PoC); + portAreas = await PortArea.getPortAreasForLocode(this.Core.PoC); this.comboBoxPortArea.ItemsSource = portAreas; this.comboBoxPortArea.DataContext = this._info; this.textRequestedPostionInPortOfCall.DataContext = this._info; diff --git a/bsmd.database/PortArea.cs b/bsmd.database/PortArea.cs index be44b03d..3fad1442 100644 --- a/bsmd.database/PortArea.cs +++ b/bsmd.database/PortArea.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; +using System.Threading.Tasks; namespace bsmd.database { @@ -67,11 +68,11 @@ namespace bsmd.database return result; } - public static Dictionary getPortAreasForLocode(string locode) + public static async Task> getPortAreasForLocode(string locode) { Dictionary result = new Dictionary(); - List portAreas = DBManagerAsync.LoadPortAreasAsync().Result; + List portAreas = await DBManagerAsync.LoadPortAreasAsync(); foreach (PortArea portArea in portAreas) {