From b9b5a0cae3a7a7d42bf73a18aeb35c0edff7ff99 Mon Sep 17 00:00:00 2001 From: Waldi Date: Wed, 28 Sep 2016 13:33:36 +0200 Subject: [PATCH] update treeview und sort bei leistuung in verwaltung --- BeWo/View/Detail/ServiceDescriptionView.xaml | 22 +++---- BeWo/View/Detail/SupportConceptView.xaml | 28 ++++++++- BeWo/View/Detail/SupportConceptView.xaml.cs | 63 +++++++++++++++++++ BeWo/ViewModel/ServiceDescriptionVM.cs | 1 + .../ClientPartials/ServiceCategoryDC.cs | 17 ++++- 5 files changed, 115 insertions(+), 16 deletions(-) diff --git a/BeWo/View/Detail/ServiceDescriptionView.xaml b/BeWo/View/Detail/ServiceDescriptionView.xaml index f1542aee2..cb701c6ce 100644 --- a/BeWo/View/Detail/ServiceDescriptionView.xaml +++ b/BeWo/View/Detail/ServiceDescriptionView.xaml @@ -101,17 +101,17 @@ - - - - - - - - - + + + + + + + + + diff --git a/BeWo/View/Detail/SupportConceptView.xaml b/BeWo/View/Detail/SupportConceptView.xaml index cc3dbbb2e..bd55914e5 100644 --- a/BeWo/View/Detail/SupportConceptView.xaml +++ b/BeWo/View/Detail/SupportConceptView.xaml @@ -666,7 +666,7 @@ - + @@ -719,8 +719,24 @@ --> - - + + + + + + + + + + @@ -793,6 +809,12 @@ + + diff --git a/BeWo/View/Detail/SupportConceptView.xaml.cs b/BeWo/View/Detail/SupportConceptView.xaml.cs index f253cb93f..f1a762371 100644 --- a/BeWo/View/Detail/SupportConceptView.xaml.cs +++ b/BeWo/View/Detail/SupportConceptView.xaml.cs @@ -1177,6 +1177,68 @@ namespace BeWo.View.Detail CheckAllGoalTreeItems(false); } + private void button_aufklappenAllGoals_Click(object sender, RoutedEventArgs e) + { + SwitchAllGoalTreeItems(true); + } + + private void button_zuklappenAllGoals_Click(object sender, RoutedEventArgs e) + { + SwitchAllGoalTreeItems(false); + } + + private void button_checkAllLeistungen_Click(object sender, RoutedEventArgs e) + { + CheckAllLeistungTreeItems(true); + } + + private void button_uncheckAllLeistungen_Click(object sender, RoutedEventArgs e) + { + CheckAllLeistungTreeItems(false); + } + + private void button_aufklappenAllLeistungen_Click(object sender, RoutedEventArgs e) + { + SwitchAllLeistungTreeItems(true); + } + + private void button_zuklappenAllLeistungen_Click(object sender, RoutedEventArgs e) + { + SwitchAllLeistungTreeItems(false); + } + + private void CheckAllLeistungTreeItems(bool check) + { + var allItems = treeview_serviceAccountings.ItemsSource as IList; + + foreach (var item in allItems) + { + item.IsChecked = check; + } + } + + private void SwitchAllLeistungTreeItems(bool check) + { + Style stylee = new Style + { + TargetType = typeof(TreeViewItem) + }; + + stylee.Setters.Add(new Setter(TreeViewItem.IsExpandedProperty,check)); + treeview_serviceAccountings.ItemContainerStyle = stylee; + } + + private void SwitchAllGoalTreeItems(bool check) + { + Style stylee = new Style + { + TargetType = typeof(TreeViewItem) + }; + + stylee.Setters.Add(new Setter(TreeViewItem.IsExpandedProperty, check)); + treeview_Goals.ItemContainerStyle = stylee; + } + private void CheckAllGoalTreeItems(bool check) { var allItems = treeview_Goals.ItemsSource as IList; @@ -1187,6 +1249,7 @@ namespace BeWo.View.Detail } } + private void button_openAddBetreuungsschluessel_Click(object sender, RoutedEventArgs e) diff --git a/BeWo/ViewModel/ServiceDescriptionVM.cs b/BeWo/ViewModel/ServiceDescriptionVM.cs index 82020d865..9f05e565b 100644 --- a/BeWo/ViewModel/ServiceDescriptionVM.cs +++ b/BeWo/ViewModel/ServiceDescriptionVM.cs @@ -120,6 +120,7 @@ namespace BeWo.ViewModel } } + public int Position { get { return _Position; } diff --git a/Shared/DataContracts/ClientPartials/ServiceCategoryDC.cs b/Shared/DataContracts/ClientPartials/ServiceCategoryDC.cs index 99664c2a1..df4d7e819 100644 --- a/Shared/DataContracts/ClientPartials/ServiceCategoryDC.cs +++ b/Shared/DataContracts/ClientPartials/ServiceCategoryDC.cs @@ -1,6 +1,8 @@ -namespace BS.Shared.DataContracts +using System; + +namespace BS.Shared.DataContracts { - public partial class ServiceCategoryDC + public partial class ServiceCategoryDC : IComparable { public override bool Equals(object obj) { @@ -25,10 +27,21 @@ { return this.ServiceCategoryOid.HasValue ? this.GetType().Name.GetHashCode() ^ this.ServiceCategoryOid.GetHashCode() : base.GetHashCode(); } + public override string ToString() { return this.Name; } + + public int CompareTo(object obj) + { + var category2 = obj as ServiceCategoryDC; + if (category2 == null || String.IsNullOrEmpty(category2.Name)) + return -1; + if (String.IsNullOrEmpty(Name)) + return 1; + return Name.CompareTo(category2.Name); + } } } \ No newline at end of file