From 19c596dfe10de5acbd6d6823c1db594de0b6ad33 Mon Sep 17 00:00:00 2001 From: Lyndon Date: Fri, 5 Jan 2018 19:13:18 -0400 Subject: [PATCH] Textbausteine... --- BeWo/View/Detail/ServiceRecordView2.xaml.cs | 42 ++--- BeWo/View/Detail/SupportConceptView.xaml | 8 +- BeWo/View/Detail/TextModuleView.xaml.cs | 2 +- BeWo/View/Detail/TextbausteinView.xaml | 156 +++++------------- BeWo/View/Detail/TextbausteinView.xaml.cs | 156 ++++++++++++------ .../ListViewModel/TextModuleListVM.cs | 1 + BeWo/ViewModel/TextModuleVM.cs | 64 ++++--- BeWo/ViewModel/VMFactory.cs | 1 + Data/Entities/TextModule.cs | 49 +++--- Data/Entities/Textbaustein.cs | 85 +++++++--- Data/Mappings/TextModule.hbm.xml | 1 + Data/Mappings/Textbaustein.hbm.xml | 7 +- Model/Changes_2018_01_03.txt | 1 + .../DCEntityMapper/TextModuleDC_TextModule.cs | 40 ++--- .../ClientPartials/TextModuleDC.cs | 15 +- Shared/DataContracts/TextModuleDC.cs | 5 +- 16 files changed, 326 insertions(+), 307 deletions(-) create mode 100644 Model/Changes_2018_01_03.txt diff --git a/BeWo/View/Detail/ServiceRecordView2.xaml.cs b/BeWo/View/Detail/ServiceRecordView2.xaml.cs index b67d79740..fce726a68 100644 --- a/BeWo/View/Detail/ServiceRecordView2.xaml.cs +++ b/BeWo/View/Detail/ServiceRecordView2.xaml.cs @@ -3379,50 +3379,28 @@ namespace BeWo.View.Detail { var tbv = new TextbausteinView(x) { Background = FindResource("ApplicationBackground") as LinearGradientBrush }; - var rootGrid2 = (Grid)tbv.root.Content; - var zielGrid = (Grid)rootGrid2.Children[0]; - var cb = new CheckBox - { - Content = "Nur für mich sichtbar", - Margin = new Thickness(3), - HorizontalAlignment = HorizontalAlignment.Left, - VerticalAlignment = VerticalAlignment.Center - }; - - if (BeWoApp.LoggedOnUser.HasRight(UserRightType.TextbausteineNurEigeneBearbeiten) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.TextbausteineAlleBearbeiten)) - { - cb.IsEnabled = false; - } - - var IsOnlyForEmployeeBinding = new Binding("NewVM.IsOnlyForEmployee") { Source = tbv.ViewModel, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged }; - BindingOperations.SetBinding(cb, ToggleButton.IsCheckedProperty, IsOnlyForEmployeeBinding); - - Grid.SetColumn(cb, 0); - Grid.SetRow(cb, 2); - Grid.SetColumnSpan(cb, 4); - - zielGrid.Children.Add(cb); + var rootGrid2 = (Grid) tbv.root.Content; var stackPanel = new StackPanel { Orientation = Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Right }; var speichernBtn = new Button { - Content = "Speichern und schließen", + Content = "Speichern", HorizontalAlignment = HorizontalAlignment.Right, Margin = new Thickness(3), VerticalAlignment = VerticalAlignment.Center }; - var abbrechenBtn = new Button + var schliessenBtn = new Button { - Content = "Abbrechen", + Content = "Schließen", HorizontalAlignment = HorizontalAlignment.Right, Margin = new Thickness(3), VerticalAlignment = VerticalAlignment.Center }; stackPanel.Children.Add(speichernBtn); - stackPanel.Children.Add(abbrechenBtn); + stackPanel.Children.Add(schliessenBtn); Grid.SetRow(stackPanel, 2); rootGrid2.Children.Add(stackPanel); @@ -3432,13 +3410,13 @@ namespace BeWo.View.Detail speichernBtn.Click += (o, args) => { tbv.Focus(); - if (x.IsDirty || x.VMList.Any(vm => vm.IsDirty)) + if(x.IsDirty || x.VMList.Any(vm => vm.IsDirty)) + { tbv.Save(() => { textbausteineSearchView.ServiceCategoryOid = textbausteineSearchView.ServiceCategoryOid; }); - - window.Close(); + } }; - abbrechenBtn.Click += (o, args) => + schliessenBtn.Click += (o, args) => { tbv.Focus(); tbv.DoSaveCheck(); @@ -3446,6 +3424,8 @@ namespace BeWo.View.Detail window.Close(); }; + window.WindowStartupLocation = WindowStartupLocation.CenterScreen; + window.Show(); })); } diff --git a/BeWo/View/Detail/SupportConceptView.xaml b/BeWo/View/Detail/SupportConceptView.xaml index 95eef130c..765c92b28 100644 --- a/BeWo/View/Detail/SupportConceptView.xaml +++ b/BeWo/View/Detail/SupportConceptView.xaml @@ -503,10 +503,10 @@ Height="23"/>