74 lines
3.0 KiB
C#
74 lines
3.0 KiB
C#
// Copyright (c) 2017- schick Informatik
|
|
// Description: Waste receipts bearbeiten..
|
|
//
|
|
|
|
using System;
|
|
using System.Windows;
|
|
|
|
using bsmd.database;
|
|
using ENI2.Controls;
|
|
|
|
namespace ENI2.EditControls
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for EditWasteReceiptDialog.xaml
|
|
/// </summary>
|
|
public partial class EditWasteReceiptDialog : EditWindowBase
|
|
{
|
|
public EditWasteReceiptDialog()
|
|
{
|
|
InitializeComponent();
|
|
Loaded += EditWasteReceiptDialog_Loaded;
|
|
AddClicked += () => { /* this.comboBoxWasteCode.Focus(); */ };
|
|
}
|
|
|
|
public WAS_RCPT WAS_RCPT { get; set; }
|
|
|
|
private void EditWasteReceiptDialog_Loaded(object sender, RoutedEventArgs e)
|
|
{
|
|
/*
|
|
Dictionary<int, string> codeDict = new Dictionary<int, string>();
|
|
for (int i = 0; i < WAS.RequiredCodes.Length; i++)
|
|
{
|
|
codeDict[WAS.RequiredCodes[i]] = string.Format("{0} - {1}", WAS.RequiredCodes[i], WAS.RequiredTypes[i]);
|
|
}
|
|
this.comboBoxWasteCode.ItemsSource = codeDict;
|
|
this.comboBoxWasteCode.SelectedValue = this.Waste.WasteType;
|
|
this.textBoxDescription.Text = this.Waste.WasteDescription;
|
|
this.doubleUpDownAmountWasteDischargedLastPort.Value = this.Waste.WasteDisposedAtLastPort_MTQ;
|
|
this.doubleUpDownAmountDisposed.Value = this.Waste.WasteDisposalAmount_MTQ;
|
|
this.doubleUpDownAmountGeneratedTilNextPort.Value = this.Waste.WasteAmountGeneratedTillNextPort_MTQ;
|
|
this.doubleUpDownAmountRetained.Value = this.Waste.WasteAmountRetained_MTQ;
|
|
this.doubleUpDownMaxCapacity.Value = this.Waste.WasteCapacity_MTQ;
|
|
this.locodePortOfDeliveryRemainingWaste.LocodeValue = this.Waste.WasteDisposalPort;
|
|
*/
|
|
|
|
OKClicked += EditWasteReceiptDialog_OKClicked;
|
|
this.AddVisible = true;
|
|
}
|
|
public void CopyValuesToEntity()
|
|
{
|
|
// copy back
|
|
/*
|
|
if (this.comboBoxWasteCode.SelectedValue != null)
|
|
this.Waste.WasteType = (int)this.comboBoxWasteCode.SelectedValue;
|
|
else
|
|
this.Waste.WasteType = null;
|
|
this.Waste.WasteDescription = this.textBoxDescription.Text?.Trim();
|
|
this.Waste.WasteDisposedAtLastPort_MTQ = this.doubleUpDownAmountWasteDischargedLastPort.Value;
|
|
this.Waste.WasteDisposalAmount_MTQ = this.doubleUpDownAmountDisposed.Value;
|
|
this.Waste.WasteAmountGeneratedTillNextPort_MTQ = this.doubleUpDownAmountGeneratedTilNextPort.Value;
|
|
this.Waste.WasteAmountRetained_MTQ = this.doubleUpDownAmountRetained.Value;
|
|
this.Waste.WasteCapacity_MTQ = this.doubleUpDownMaxCapacity.Value;
|
|
this.Waste.WasteDisposalPort = this.locodePortOfDeliveryRemainingWaste.LocodeValue;
|
|
*/
|
|
}
|
|
|
|
private void EditWasteReceiptDialog_OKClicked()
|
|
{
|
|
this.CopyValuesToEntity();
|
|
}
|
|
|
|
}
|
|
}
|