// Copyright (c) 2017 schick Informatik // Description: // using System.Windows; using bsmd.database; using ENI2.Controls; namespace ENI2.EditControls { /// /// Interaction logic for EditSERVDialog.xaml /// public partial class EditSERVDialog : EditWindowBase { public EditSERVDialog() { InitializeComponent(); Loaded += EditSERVDialog_Loaded; } private void EditSERVDialog_Loaded(object sender, RoutedEventArgs e) { this.OKClicked += EditSERVDialog_OKClicked; // copy into fields this.textBoxServiceName.Text = this.SERV.ServiceName; this.textBoxServiceBeneficiary.Text = this.SERV.ServiceBeneficiary; this.textBoxServiceInvoiceRecipient.Text = this.SERV.ServiceInvoiceRecipient; this.AddVisible = true; } public void CopyValuesToEntity() { // copy back this.SERV.ServiceName = this.textBoxServiceName.Text.Trim(); this.SERV.ServiceBeneficiary = this.textBoxServiceBeneficiary.Text.Trim(); this.SERV.ServiceInvoiceRecipient = this.textBoxServiceInvoiceRecipient.Text.Trim(); } private void EditSERVDialog_OKClicked() { this.CopyValuesToEntity(); } public SERV SERV { get; set; } } }