// Copyright (c) 2017- schick Informatik // Description: Waste receipts bearbeiten.. // using System; using System.Windows; using bsmd.database; using ENI2.Controls; namespace ENI2.EditControls { /// /// Interaction logic for EditWasteReceiptDialog.xaml /// 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) { this.textIdentificationNumber.Text = this.WAS_RCPT.IdentificationNumber; this.textBoxPortReceptionFacilityName.Text = this.WAS_RCPT.PortReceptionFacilityName; this.textBoxPortReceptionFacilityProviderName.Text = this.WAS_RCPT.PortReceptionFacilityProviderName; this.textBoxTreatmentFacilityProvider.Text = this.WAS_RCPT.TreatmentFacilityProviderText; this.dateTimePickerWasteDeliveryDateFrom.Value = this.WAS_RCPT.WasteDeliveryDateFrom?.ToLocalTime(); this.dateTimePickerWasteDeliveryDateTo.Value = this.WAS_RCPT.WasteDeliveryDateTo?.ToLocalTime(); OKClicked += EditWasteReceiptDialog_OKClicked; this.AddVisible = true; } public void CopyValuesToEntity() { // copy back this.WAS_RCPT.IdentificationNumber = this.textIdentificationNumber.Text?.Trim(); this.WAS_RCPT.PortReceptionFacilityName = this.textBoxPortReceptionFacilityName.Text?.Trim(); this.WAS_RCPT.PortReceptionFacilityProviderName = this.textBoxPortReceptionFacilityProviderName.Text?.Trim(); this.WAS_RCPT.TreatmentFacilityProviderText = this.textBoxTreatmentFacilityProvider.Text?.Trim(); this.WAS_RCPT.WasteDeliveryDateFrom = this.dateTimePickerWasteDeliveryDateFrom.Value?.ToUniversalTime(); this.WAS_RCPT.WasteDeliveryDateTo = this.dateTimePickerWasteDeliveryDateTo.Value?.ToUniversalTime(); } private void EditWasteReceiptDialog_OKClicked() { this.CopyValuesToEntity(); } // private void buttonAddEntries_Click(object sender, RoutedEventArgs e) // { // this.WAS_RCPT.AddMissingWasteReceived(); // } } }