private void uxNew_Click(object sender, RoutedEventArgs e) { var window = new LoanerWindow(); if (window.ShowDialog() == true) { var uiLoanerModel = window.Loaner; var repositoryLoanerModel = uiLoanerModel.ToRepositoryModel(); App.LaptopLoanerRepository.Add(repositoryLoanerModel); LoadLoaners(); } }
private void ModifyLoaner() { if (selectedLoaner == null) { return; } var window = new LoanerWindow(); window.Loaner = selectedLoaner.Clone(); if (window.ShowDialog() == true) { App.LaptopLoanerRepository.Update(window.Loaner.ToRepositoryModel()); LoadLoaners(); } }