Added entries for Elbe Bulk and Fct Junge to port notification / SERV comboboxes

This commit is contained in:
Daniel Schick 2024-02-23 12:14:04 +01:00
parent c5411570e4
commit e36804e735
3 changed files with 59 additions and 3 deletions

View File

@ -19,6 +19,8 @@
<col:DictionaryEntry Key="SeaGo BHV" Value="2" /> <col:DictionaryEntry Key="SeaGo BHV" Value="2" />
<col:DictionaryEntry Key="SeaGo WHV" Value="4" /> <col:DictionaryEntry Key="SeaGo WHV" Value="4" />
<col:DictionaryEntry Key="Hoegh BHV" Value="8" /> <col:DictionaryEntry Key="Hoegh BHV" Value="8" />
<col:DictionaryEntry Key="Elbe Bulk" Value="16" />
<col:DictionaryEntry Key="Fct Junge" Value="32" />
</col:ArrayList> </col:ArrayList>
</UserControl.Resources> </UserControl.Resources>
<GroupBox Name="portNotificationGroupBox" Header="{x:Static p:Resources.textPortNotification}"> <GroupBox Name="portNotificationGroupBox" Header="{x:Static p:Resources.textPortNotification}">

View File

@ -163,9 +163,11 @@ namespace ENI2.DetailViewControls
if (this.Core.IsFlagSet(MessageCore.CoreFlags.SEAGO_BHV)) this.comboBoxGroup.SelectedIndex = 2; if (this.Core.IsFlagSet(MessageCore.CoreFlags.SEAGO_BHV)) this.comboBoxGroup.SelectedIndex = 2;
if (this.Core.IsFlagSet(MessageCore.CoreFlags.SEAGO_WHV)) this.comboBoxGroup.SelectedIndex = 3; if (this.Core.IsFlagSet(MessageCore.CoreFlags.SEAGO_WHV)) this.comboBoxGroup.SelectedIndex = 3;
if (this.Core.IsFlagSet(MessageCore.CoreFlags.HOEGH)) this.comboBoxGroup.SelectedIndex = 4; if (this.Core.IsFlagSet(MessageCore.CoreFlags.HOEGH)) this.comboBoxGroup.SelectedIndex = 4;
if (this.Core.IsFlagSet(MessageCore.CoreFlags.ELBE_BULK)) this.comboBoxGroup.SelectedIndex = 5;
if (this.Core.IsFlagSet(MessageCore.CoreFlags.FCT_JUNGE)) this.comboBoxGroup.SelectedIndex = 6;
#endregion #endregion
} }
#region datagrid LADG #region datagrid LADG
@ -376,6 +378,8 @@ namespace ENI2.DetailViewControls
this.Core.SetFlag(false, MessageCore.CoreFlags.SEAGO_BHV); this.Core.SetFlag(false, MessageCore.CoreFlags.SEAGO_BHV);
this.Core.SetFlag(false, MessageCore.CoreFlags.SEAGO_WHV); this.Core.SetFlag(false, MessageCore.CoreFlags.SEAGO_WHV);
this.Core.SetFlag(false, MessageCore.CoreFlags.HOEGH); this.Core.SetFlag(false, MessageCore.CoreFlags.HOEGH);
this.Core.SetFlag(false, MessageCore.CoreFlags.ELBE_BULK);
this.Core.SetFlag(false, MessageCore.CoreFlags.FCT_JUNGE);
DictionaryEntry selectedItem = (DictionaryEntry) this.comboBoxGroup.SelectedItem; DictionaryEntry selectedItem = (DictionaryEntry) this.comboBoxGroup.SelectedItem;
if(Int32.TryParse((string)selectedItem.Value, out int selectedValue)) if(Int32.TryParse((string)selectedItem.Value, out int selectedValue))
@ -383,10 +387,12 @@ namespace ENI2.DetailViewControls
if (selectedValue == (int)MessageCore.CoreFlags.MAERSK_BHV) CheckServiceEntryMaerskBHV(); if (selectedValue == (int)MessageCore.CoreFlags.MAERSK_BHV) CheckServiceEntryMaerskBHV();
if (selectedValue == (int)MessageCore.CoreFlags.SEAGO_BHV) CheckServiceEntrySeaGoBHV(); if (selectedValue == (int)MessageCore.CoreFlags.SEAGO_BHV) CheckServiceEntrySeaGoBHV();
if (selectedValue == (int)MessageCore.CoreFlags.HOEGH) CheckServiceEntryHoegh(); if (selectedValue == (int)MessageCore.CoreFlags.HOEGH) CheckServiceEntryHoegh();
if (selectedValue == (int)MessageCore.CoreFlags.ELBE_BULK) CheckServiceEntryElbeBulk();
if (selectedValue == (int)MessageCore.CoreFlags.FCT_JUNGE) CheckServiceEntryFctJunge();
this.Core.SetFlag(true, (MessageCore.CoreFlags)selectedValue); this.Core.SetFlag(true, (MessageCore.CoreFlags)selectedValue);
DBManager.Instance.Save(this.Core); DBManager.Instance.Save(this.Core);
} }
} }
#endregion #endregion
@ -461,6 +467,52 @@ namespace ENI2.DetailViewControls
} }
} }
private void CheckServiceEntryFctJunge()
{
bool found = false;
foreach (SERV serv in this._servMessage.Elements)
{
if (serv.ServiceBeneficiary.Equals("Fct Junge - Hamburg"))
found = true;
}
if (!found)
{
SERV newServ = new SERV();
newServ.ServiceBeneficiary = "";
newServ.ServiceInvoiceRecipient = " Frachtcontor Junge & Co. GmbH";
newServ.ServiceName = "FCT JUNGE";
newServ.MessageHeader = this._servMessage;
newServ.Identifier = SERV.GetNewIdentifier(_servMessage.Elements);
this._servMessage.Elements.Add(newServ);
this.dataGridSERV.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.SERV);
}
}
private void CheckServiceEntryElbeBulk()
{
bool found = false;
foreach (SERV serv in this._servMessage.Elements)
{
if (serv.ServiceBeneficiary.Equals("Elbe Bulk Schiffe - Hamburg"))
found = true;
}
if (!found)
{
SERV newServ = new SERV();
newServ.ServiceBeneficiary = "";
newServ.ServiceInvoiceRecipient = " Division Elbe Bulk, Frachtcontor Junge & Co. GmbH";
newServ.ServiceName = "ELBE BULK";
newServ.MessageHeader = this._servMessage;
newServ.Identifier = SERV.GetNewIdentifier(_servMessage.Elements);
this._servMessage.Elements.Add(newServ);
this.dataGridSERV.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.SERV);
}
}
private void buttonSearchPortArea_Click(object sender, RoutedEventArgs e) private void buttonSearchPortArea_Click(object sender, RoutedEventArgs e)
{ {
SelectPortAreaDialog spad = new SelectPortAreaDialog(this.Core.PoC); SelectPortAreaDialog spad = new SelectPortAreaDialog(this.Core.PoC);

View File

@ -98,7 +98,9 @@ namespace bsmd.database
MAERSK_BHV = 1, MAERSK_BHV = 1,
SEAGO_BHV = 2, SEAGO_BHV = 2,
SEAGO_WHV = 4, SEAGO_WHV = 4,
HOEGH = 8 HOEGH = 8,
ELBE_BULK = 16,
FCT_JUNGE = 32
} }
#endregion #endregion