66 lines
1.9 KiB
C#
66 lines
1.9 KiB
C#
// Copyright (c) 2017 schick Informatik
|
|
// Description: Dialog zum Bearbeiten von Bunker-Informationen
|
|
//
|
|
|
|
using System.Windows;
|
|
|
|
using bsmd.database;
|
|
using ENI2.Controls;
|
|
|
|
namespace ENI2.EditControls
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for EditBKRDialog.xaml
|
|
/// </summary>
|
|
public partial class EditBKRDialog : EditWindowBase
|
|
{
|
|
public EditBKRDialog()
|
|
{
|
|
InitializeComponent();
|
|
Loaded += EditBKRDialog_Loaded; ;
|
|
}
|
|
|
|
#region Properties
|
|
|
|
public bool IsDeparture { get; set; }
|
|
|
|
public BRKA BRKA { get; set; }
|
|
|
|
public BRKD BRKD { get; set; }
|
|
|
|
#endregion
|
|
|
|
#region event handler
|
|
|
|
private void EditBKRDialog_Loaded(object sender, RoutedEventArgs e)
|
|
{
|
|
this.OKClicked += EditBKRDialog_OKClicked; ;
|
|
|
|
this.Title = this.IsDeparture ? Properties.Resources.textBunkerOnDeparture : Properties.Resources.textBunkerOnArrival;
|
|
|
|
// copy into fields
|
|
this.textBoxBunkerType.Text = this.IsDeparture ? this.BRKD.BunkerFuelType : this.BRKA.BunkerFuelType;
|
|
this.doubleUpDownBunkerQuantity.Value = this.IsDeparture ? this.BRKD.BunkerFuelQuantity_TNE : this.BRKA.BunkerFuelQuantity_TNE;
|
|
this.OKClicked += EditBKRDialog_OKClicked;
|
|
}
|
|
|
|
private void EditBKRDialog_OKClicked()
|
|
{
|
|
// copy back
|
|
if (this.IsDeparture)
|
|
{
|
|
this.BRKD.BunkerFuelType = this.textBoxBunkerType.Text.Trim();
|
|
this.BRKD.BunkerFuelQuantity_TNE = this.doubleUpDownBunkerQuantity.Value;
|
|
}
|
|
else
|
|
{
|
|
this.BRKA.BunkerFuelType = this.textBoxBunkerType.Text.Trim();
|
|
this.BRKA.BunkerFuelQuantity_TNE = this.doubleUpDownBunkerQuantity.Value;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
}
|
|
}
|