Copy function BRKD to BRKA
This commit is contained in:
parent
6e38685531
commit
c35ce294c5
@ -165,8 +165,6 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void copyBKR(object sender, RoutedEventArgs e)
|
private void copyBKR(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
// aus dem aktuell selektierten IBC Element ein neues IBC Element machen und nach HAZD kopieren
|
|
||||||
|
|
||||||
foreach (BRKA brka in this.dataGridBKRA.Items)
|
foreach (BRKA brka in this.dataGridBKRA.Items)
|
||||||
{
|
{
|
||||||
BRKD copyBRKD = new BRKD();
|
BRKD copyBRKD = new BRKD();
|
||||||
@ -176,7 +174,6 @@ namespace ENI2.DetailViewControls
|
|||||||
this._brkdMessage.Elements.Add(copyBRKD);
|
this._brkdMessage.Elements.Add(copyBRKD);
|
||||||
this.SublistElementChanged(Message.NotificationClass.BKRD);
|
this.SublistElementChanged(Message.NotificationClass.BKRD);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region BKRA grid events
|
#region BKRA grid events
|
||||||
|
|||||||
@ -9,6 +9,7 @@ using bsmd.database;
|
|||||||
using ENI2.EditControls;
|
using ENI2.EditControls;
|
||||||
using ENI2.Util;
|
using ENI2.Util;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
|
||||||
namespace ENI2.DetailViewControls
|
namespace ENI2.DetailViewControls
|
||||||
{
|
{
|
||||||
@ -22,6 +23,7 @@ namespace ENI2.DetailViewControls
|
|||||||
private Message _tiefdMessage;
|
private Message _tiefdMessage;
|
||||||
private Message _pobdMessage;
|
private Message _pobdMessage;
|
||||||
private Message _bkrdMessage;
|
private Message _bkrdMessage;
|
||||||
|
private Message _brkaMessage;
|
||||||
bool startupComplete = false;
|
bool startupComplete = false;
|
||||||
|
|
||||||
public DepartureNotificationDetailControl()
|
public DepartureNotificationDetailControl()
|
||||||
@ -51,6 +53,7 @@ namespace ENI2.DetailViewControls
|
|||||||
if (aMessage.MessageNotificationClass == Message.NotificationClass.TIEFD) { this._tiefdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.TIEFD) { this._tiefdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
if (aMessage.MessageNotificationClass == Message.NotificationClass.POBD) { this._pobdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.POBD) { this._pobdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
if (aMessage.MessageNotificationClass == Message.NotificationClass.BKRD) { this._bkrdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.BKRD) { this._bkrdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.BKRA) { this._brkaMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
}
|
}
|
||||||
|
|
||||||
#region ATD
|
#region ATD
|
||||||
@ -147,6 +150,15 @@ namespace ENI2.DetailViewControls
|
|||||||
this.dataGridBKRD.DeleteRequested += DataGridBKRD_DeleteRequested;
|
this.dataGridBKRD.DeleteRequested += DataGridBKRD_DeleteRequested;
|
||||||
this.dataGridBKRD.CreateRequested += DataGridBKRD_CreateRequested;
|
this.dataGridBKRD.CreateRequested += DataGridBKRD_CreateRequested;
|
||||||
|
|
||||||
|
// Extra Menüpunkt um alle Bunker Positionen nach BKRA zu kopieren
|
||||||
|
|
||||||
|
this.dataGridBKRD.ContextMenu.Items.Add(new Separator());
|
||||||
|
MenuItem copyBKRItem = new MenuItem();
|
||||||
|
copyBKRItem.Header = string.Format(Properties.Resources.textCopyTo, "BKRA");
|
||||||
|
copyBKRItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
||||||
|
copyBKRItem.Click += this.copyBKR;
|
||||||
|
this.dataGridBKRD.ContextMenu.Items.Add(copyBKRItem);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -184,7 +196,7 @@ namespace ENI2.DetailViewControls
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void DataGridBKRD_DeleteRequested(DatabaseEntity obj)
|
private void DataGridBKRD_DeleteRequested(DatabaseEntity obj)
|
||||||
{
|
{
|
||||||
if (obj is BRKD brkd)
|
if (obj is BRKD brkd)
|
||||||
{
|
{
|
||||||
// are you sure dialog is in base class
|
// are you sure dialog is in base class
|
||||||
@ -228,6 +240,19 @@ namespace ENI2.DetailViewControls
|
|||||||
this.DataGridBKRD_CreateRequested();
|
this.DataGridBKRD_CreateRequested();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void copyBKR(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
foreach (BRKD brkd in this.dataGridBKRD.Items)
|
||||||
|
{
|
||||||
|
BRKA copyBRKA = new BRKA();
|
||||||
|
copyBRKA.MessageHeader = this._brkaMessage;
|
||||||
|
copyBRKA.CopyFromBKRD(brkd);
|
||||||
|
copyBRKA.Identifier = DatabaseEntity.GetNewIdentifier(this._brkaMessage.Elements);
|
||||||
|
this._brkaMessage.Elements.Add(copyBRKA);
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.BKRA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Highlighting
|
#region Highlighting
|
||||||
|
|||||||
@ -130,5 +130,16 @@ namespace bsmd.database
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region public funcs
|
||||||
|
|
||||||
|
public void CopyFromBKRD(BRKD brkd)
|
||||||
|
{
|
||||||
|
if (brkd == null) return;
|
||||||
|
this.BunkerFuelType = brkd.BunkerFuelType;
|
||||||
|
this.BunkerFuelQuantity_TNE = brkd.BunkerFuelQuantity_TNE;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -126,6 +126,10 @@ namespace bsmd.database
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region public funcs
|
||||||
|
|
||||||
public void CopyFromBKRA(BRKA brka)
|
public void CopyFromBKRA(BRKA brka)
|
||||||
{
|
{
|
||||||
if (brka == null) return;
|
if (brka == null) return;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user