diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj
index b20f66b95..6f16c21f8 100644
--- a/BeWo/BeWo.csproj
+++ b/BeWo/BeWo.csproj
@@ -43,12 +43,12 @@
de-DE
BeWoPlaner
beyondSoft GmbH
- 2.0.1.146
+ 2.0.1.151
true
publish.htm
false
true
- 147
+ 152
2.0.1.%2a
false
true
@@ -1996,7 +1996,7 @@
-
+
{8a83c4dc-a0b1-4a51-ae1d-366d7a05b298}
ChatController
diff --git a/BeWo/LoginControl.xaml.cs b/BeWo/LoginControl.xaml.cs
index f1707e7b0..599bcc206 100644
--- a/BeWo/LoginControl.xaml.cs
+++ b/BeWo/LoginControl.xaml.cs
@@ -257,8 +257,11 @@ namespace BeWo
if (ProfileList.Count > 0)
{
+#if DEBUG
+ //selectedProfile = ReadSelectedProfile();
+#else
selectedProfile = ReadSelectedProfile();
-
+#endif
if (selectedProfile == null || !ProfileList.Contains(selectedProfile))
{
//selectedProfile = profileSelectionComboBox.SelectedItem as BeWoProfile;
@@ -342,7 +345,9 @@ namespace BeWo
private bool CheckStatusMessage(BeWoProfile profile, String url)
{
-
+#if DEBUG
+ return true;
+#endif
try
{
using (WebClient client = new WebClient())
diff --git a/BeWo/Ressources/Icons/adobe-pdf-icon.png b/BeWo/Ressources/Icons/adobe-pdf-icon.png
index e694647f5..c12e0a9a3 100644
Binary files a/BeWo/Ressources/Icons/adobe-pdf-icon.png and b/BeWo/Ressources/Icons/adobe-pdf-icon.png differ
diff --git a/BeWo/View/BeWoView.cs b/BeWo/View/BeWoView.cs
index 9070df3fb..38375b469 100644
--- a/BeWo/View/BeWoView.cs
+++ b/BeWo/View/BeWoView.cs
@@ -133,7 +133,7 @@ namespace BeWo.View
{
if (!BeWoApp.HasLoggedOnUserRight(this.GetSaveDemands()))
{
- MessageBox.Show("Sie besitzen nicht die nötigen Rechte um zu speichern. Bitte wenden Sie sich an den Adminstrator!", "Autorisierung fehlgeschlagen", MessageBoxButton.OK, MessageBoxImage.Warning);
+ MessageBox.Show("Sie besitzen nicht die nötigen Rechte um zu speichern. Bitte wenden Sie sich an den Administrator!", "Autorisierung fehlgeschlagen", MessageBoxButton.OK, MessageBoxImage.Warning);
return false;
}
diff --git a/BeWo/View/Detail/AccountingTransactionView.xaml.cs b/BeWo/View/Detail/AccountingTransactionView.xaml.cs
index 9601a65bc..f56c47002 100644
--- a/BeWo/View/Detail/AccountingTransactionView.xaml.cs
+++ b/BeWo/View/Detail/AccountingTransactionView.xaml.cs
@@ -230,7 +230,7 @@ namespace BeWo.View.Detail
if (lMessage != string.Empty)
{
- MessageBox.Show(lMessage + "\nWenden Sie sich an den Adminstrator", "Fehlende Berechtigung", MessageBoxButton.OK, MessageBoxImage.Warning);
+ MessageBox.Show(lMessage + "\nWenden Sie sich an den Administrator", "Fehlende Berechtigung", MessageBoxButton.OK, MessageBoxImage.Warning);
}
if (lToDos.Count > 0)
diff --git a/BeWo/View/Detail/CustomerView.xaml b/BeWo/View/Detail/CustomerView.xaml
index 4c143b020..fb77fc5de 100644
--- a/BeWo/View/Detail/CustomerView.xaml
+++ b/BeWo/View/Detail/CustomerView.xaml
@@ -96,9 +96,9 @@
+ ItemsSource="{Binding Path=UngueltigeVerordnungen}" CustomColumnSort="Grid_medikamentenverordnungshistorie_OnCustomColumnSort">
-
+
@@ -376,7 +376,7 @@
-
+
@@ -387,17 +387,17 @@
-
+
-
+
-
-
-
+
+
+
@@ -614,7 +614,7 @@
-->
-
+
diff --git a/BeWo/View/Detail/EnvironmentRoleView.xaml b/BeWo/View/Detail/EnvironmentRoleView.xaml
index 2bdcc0357..fd4fe0db5 100644
--- a/BeWo/View/Detail/EnvironmentRoleView.xaml
+++ b/BeWo/View/Detail/EnvironmentRoleView.xaml
@@ -1,7 +1,7 @@

-
+
@@ -16,6 +16,6 @@
-
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/OrganisationView.xaml b/BeWo/View/Detail/OrganisationView.xaml
index 2193bd56b..deaec1f0d 100644
--- a/BeWo/View/Detail/OrganisationView.xaml
+++ b/BeWo/View/Detail/OrganisationView.xaml
@@ -434,7 +434,7 @@
-->
-
+
diff --git a/BeWo/View/Detail/ServiceRecordView2.xaml.cs b/BeWo/View/Detail/ServiceRecordView2.xaml.cs
index 4a84578ca..2d39c979f 100644
--- a/BeWo/View/Detail/ServiceRecordView2.xaml.cs
+++ b/BeWo/View/Detail/ServiceRecordView2.xaml.cs
@@ -88,10 +88,7 @@ namespace BeWo.View.Detail
private int lastPosition;
- public static double DocumentationTextBoxFontSize
- {
- get { return BeWoApp.AppSettings.DocumentationFontSize; }
- }
+ public static double DocumentationTextBoxFontSize => BeWoApp.AppSettings.DocumentationFontSize;
public ServiceRecordView2(ServiceRecordListVM pViewModel, long? startSupportConceptOid)
{
@@ -3411,66 +3408,44 @@ 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);
tbv.root.Header = string.Empty;
- var window = new BeWoWindow(tbv) { Width = 514, Height = 400, rootGroupBox = { Header = "Textbausteine" } };
+ var window = new BeWoWindow(tbv) { Width = 914, Height = 600, rootGroupBox = { Header = "Textbausteine" } };
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();
@@ -3478,6 +3453,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"/>
+ Grid.Column="5"
+ Initialized="CboServiceCategory_OnInitialized"
+ EditValue="{Binding Path=ServiceCategory, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+ Margin="3" Height="23" IsTextEditable="False" Width="150" >
diff --git a/BeWo/View/Detail/TextModuleView.xaml b/BeWo/View/Detail/TextModuleView.xaml
index 714787b15..ec9a352cb 100644
--- a/BeWo/View/Detail/TextModuleView.xaml
+++ b/BeWo/View/Detail/TextModuleView.xaml
@@ -11,7 +11,7 @@
VerticalAlignment="Stretch" Focusable="True">
-
+
diff --git a/BeWo/View/Detail/TextModuleView.xaml.cs b/BeWo/View/Detail/TextModuleView.xaml.cs
index e7709110d..528cee8cc 100644
--- a/BeWo/View/Detail/TextModuleView.xaml.cs
+++ b/BeWo/View/Detail/TextModuleView.xaml.cs
@@ -23,7 +23,7 @@ namespace BeWo.View.Detail
public TextModuleListVM ViewModel
{
- get { return _ViewModel; }
+ get => _ViewModel;
set
{
diff --git a/BeWo/View/Detail/TextbausteinView.xaml b/BeWo/View/Detail/TextbausteinView.xaml
index 55b7e6c60..e35509970 100644
--- a/BeWo/View/Detail/TextbausteinView.xaml
+++ b/BeWo/View/Detail/TextbausteinView.xaml
@@ -4,120 +4,148 @@
xmlns:view="clr-namespace:BeWo.View"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
- xmlns:validation="clr-namespace:BeWo.Validation"
xmlns:detail="clr-namespace:BeWo.View.Detail"
- xmlns:controls="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
Height="Auto" Width="Auto" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" Focusable="True">
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Detail/TextbausteinView.xaml.cs b/BeWo/View/Detail/TextbausteinView.xaml.cs
index 301007a87..43cc15a65 100644
--- a/BeWo/View/Detail/TextbausteinView.xaml.cs
+++ b/BeWo/View/Detail/TextbausteinView.xaml.cs
@@ -1,31 +1,34 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Globalization;
using System.Linq;
+using System.Runtime.CompilerServices;
using System.Windows;
+using System.Windows.Controls;
using System.Windows.Data;
+using System.Windows.Input;
-using BeWo.Core;
-using BeWo.Core.Service;
+using BeWo.Annotations;
using BeWo.ServiceProxy;
-using BeWo.Validation;
using BeWo.ViewModel;
using BeWo.ViewModel.ListViewModel;
using BS.Shared;
using BS.Shared.Extensions;
+using DevExpress.Xpf.Editors;
using DevExpress.Xpf.Grid;
namespace BeWo.View.Detail
{
- public partial class TextbausteinView
+ public partial class TextbausteinView : INotifyPropertyChanged
{
private TextModuleListVM _ViewModel;
public TextModuleListVM ViewModel
{
- get { return _ViewModel; }
+ get => _ViewModel;
set
{
@@ -34,49 +37,22 @@ namespace BeWo.View.Detail
}
}
- public override bool IsDirty
- {
- get { return ViewModel != null && ViewModel.IsDirty; }
- }
+ public override bool IsDirty => ViewModel != null && ViewModel.IsDirty;
- internal override DependencyObject ValidationOnSaveRootElement
- {
- get { return AddTextbausteinButton; }
- }
-
- private bool isInAdministrationView;
+ private readonly bool _IsInAdministrationView;
public TextbausteinView(TextModuleListVM pViewModel, bool pIsInAdministrationView = false)
{
InitializeComponent();
- isInAdministrationView = pIsInAdministrationView;
-
- EigenerTextbausteinSpalte.Visible = !isInAdministrationView;
+ _IsInAdministrationView = pIsInAdministrationView;
ViewModel = pViewModel;
}
protected override void Save()
{
- var lToDos = new List>();
-
- if (ViewModel.AddedCount > 0)
- {
- lToDos.Add(s => s.InsertNewTextModules(ViewModel.CommitAdded()));
- }
-
- if (ViewModel.RemovedCount > 0)
- {
- lToDos.Add(s => s.DeleteTextModules(ViewModel.GetRemoved().ToDictionary(dc => dc.TextModuleOid.Value, dc => dc.TextModuleVersion.Value)));
- }
-
- if (ViewModel.ChangedCount > 0)
- {
- lToDos.Add(s => s.UpdateTextModules(ViewModel.CommitChanged()));
- }
-
- ServiceFacade.DoMultipleOperationsServicesAsync(lToDos, ReloadViewModel);
+ Save(null);
}
public void Save(Action pCallBack)
@@ -98,39 +74,63 @@ namespace BeWo.View.Detail
lToDos.Add(s => s.UpdateTextModules(ViewModel.CommitChanged()));
}
- ServiceFacade.DoMultipleOperationsServicesAsync(lToDos, pCallBack);
+ ServiceFacade.DoMultipleOperationsServicesAsync(lToDos, () =>
+ {
+ pCallBack?.Invoke();
+ ReloadViewModel();
+ });
}
private void ReloadViewModel()
{
- Cache.GetInstance().ClearServiceCategoryDescriptions();
VMFactory.CreateTextModuleListVMAsync(r => this.Dispatch(delegate
{
+ TreeListControl.BeginDataUpdate();
+
ViewModel = r;
- }), isInAdministrationView);
+
+ TreeListControl.EndDataUpdate();
+
+ TreeListControl.SelectedItems.Clear();
+
+ }), _IsInAdministrationView);
}
private void DeleteButton_Click(object sender, RoutedEventArgs e)
{
- ViewModel.VMList.Remove(datagrid_textbausteine.GetCurrentValue());
- BeWoWpfUtils.RefreshDXGrid(datagrid_textbausteine);
- }
+ var focusedNode = TreeListView.FocusedNode;
+ var selectedTextModule = (TextModuleVM) focusedNode.Content;
- private void ButtonAddTextbaustein_Click(object sender, RoutedEventArgs e)
- {
- if (ValidationTrigger.Validate(this))
+ _ChildrenToDelete.Add(selectedTextModule);
+
+ if(selectedTextModule.IsParent)
{
- ViewModel.AddNewVMToList();
+ if(ViewModel.VMList.Any(textModule => selectedTextModule.Equals(textModule.Parent)))
+ {
+ if(MessageBox.Show("Die Textbausteinkategorie enthält weitere Textbausteine und/oder Textbausteinkategorien. Wenn Sie fortfahren, werden alle Unterelemente von \"" + selectedTextModule.Name + "\" gelöscht.", "Textbausteine löschen", MessageBoxButton.OKCancel, MessageBoxImage.Question) == MessageBoxResult.Cancel)
+ {
+ _ChildrenToDelete.Clear();
+ return;
+ }
+ }
+
+ RetrieveChildTextModulesFromParent(selectedTextModule);
}
+
+ ViewModel.VMList.RemoveRange(_ChildrenToDelete);
+ _ChildrenToDelete.Clear();
}
- private void GridViewBase_OnShowingEditor(object sender, ShowingEditorEventArgs e)
+ private readonly List _ChildrenToDelete = new List();
+
+ private void RetrieveChildTextModulesFromParent(TextModuleVM parent)
{
- if (e.Column.Header.Equals("Kategorie"))
- {
- var textbausteinVM = (TextModuleVM)e.Row;
+ var children = ViewModel.VMList.Where(w => w.Parent != null && w.Parent.Equals(parent));
- e.Cancel = !CheckEditorRights(textbausteinVM, null);
+ foreach(var child in children)
+ {
+ _ChildrenToDelete.Add(child);
+ RetrieveChildTextModulesFromParent(child);
}
}
@@ -151,8 +151,107 @@ namespace BeWo.View.Detail
return isOwn && hasRight2EditOwn || hasRight2EditAll;
}
+
return false;
}
+
+ private void ContextMenuTextModules_Click(object sender, RoutedEventArgs e)
+ {
+ if(e.OriginalSource is MenuItem twi)
+ {
+ var selectedItem = TreeListControl.SelectedItem as TextModuleVM;
+
+ ViewModel.NewVM.IsParent = twi.Header.Equals("Neue Textbausteinkategorie");
+ ViewModel.NewVM.IsExpanded = twi.Header.Equals("Neue Textbausteinkategorie");
+ ViewModel.NewVM.IsOnlyForEmployee = true;
+ ViewModel.NewVM.Name = twi.Header.ToString();
+
+ if(selectedItem != null)
+ {
+ ViewModel.NewVM.Parent = selectedItem;
+ }
+
+ ViewModel.AddNewVMToList(false);
+ Save();
+ }
+ }
+
+ private void ContextMenuTextModules_Opened(object sender, RoutedEventArgs e)
+ {
+ if (e.OriginalSource is ContextMenu menu)
+ {
+ var textModule = TreeListControl.SelectedItem as TextModuleVM;
+
+ foreach (var menuitem in menu.Items.OfType