diff --git a/BeWo.sln b/BeWo.sln
index dc06585ed..7e7d55a13 100644
--- a/BeWo.sln
+++ b/BeWo.sln
@@ -387,6 +387,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Diakonie Landshut", "Diakon
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChatController", "..\Chat\ChatController\ChatController.csproj", "{8A83C4DC-A0B1-4A51-AE1D-366D7A05B298}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PraxisPusteblume", "ReportImp\PraxisPusteblume\PraxisPusteblume.csproj", "{A6E699B3-8399-4B8D-90F1-119B021F3D44}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SawoReports", "ReportImp\SawoReports\SawoReports.csproj", "{E590CC37-E2A4-488F-BBA2-C70042BD488D}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|.NET = Debug|.NET
@@ -2866,6 +2870,38 @@ Global
{8A83C4DC-A0B1-4A51-AE1D-366D7A05B298}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{8A83C4DC-A0B1-4A51-AE1D-366D7A05B298}.Release|x86.ActiveCfg = Release|Any CPU
{8A83C4DC-A0B1-4A51-AE1D-366D7A05B298}.Release|x86.Build.0 = Release|Any CPU
+ {A6E699B3-8399-4B8D-90F1-119B021F3D44}.Debug|.NET.ActiveCfg = Debug|Any CPU
+ {A6E699B3-8399-4B8D-90F1-119B021F3D44}.Debug|.NET.Build.0 = Debug|Any CPU
+ {A6E699B3-8399-4B8D-90F1-119B021F3D44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A6E699B3-8399-4B8D-90F1-119B021F3D44}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A6E699B3-8399-4B8D-90F1-119B021F3D44}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {A6E699B3-8399-4B8D-90F1-119B021F3D44}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {A6E699B3-8399-4B8D-90F1-119B021F3D44}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {A6E699B3-8399-4B8D-90F1-119B021F3D44}.Debug|x86.Build.0 = Debug|Any CPU
+ {A6E699B3-8399-4B8D-90F1-119B021F3D44}.Release|.NET.ActiveCfg = Release|Any CPU
+ {A6E699B3-8399-4B8D-90F1-119B021F3D44}.Release|.NET.Build.0 = Release|Any CPU
+ {A6E699B3-8399-4B8D-90F1-119B021F3D44}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A6E699B3-8399-4B8D-90F1-119B021F3D44}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A6E699B3-8399-4B8D-90F1-119B021F3D44}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {A6E699B3-8399-4B8D-90F1-119B021F3D44}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {A6E699B3-8399-4B8D-90F1-119B021F3D44}.Release|x86.ActiveCfg = Release|Any CPU
+ {A6E699B3-8399-4B8D-90F1-119B021F3D44}.Release|x86.Build.0 = Release|Any CPU
+ {E590CC37-E2A4-488F-BBA2-C70042BD488D}.Debug|.NET.ActiveCfg = Debug|Any CPU
+ {E590CC37-E2A4-488F-BBA2-C70042BD488D}.Debug|.NET.Build.0 = Debug|Any CPU
+ {E590CC37-E2A4-488F-BBA2-C70042BD488D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E590CC37-E2A4-488F-BBA2-C70042BD488D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E590CC37-E2A4-488F-BBA2-C70042BD488D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {E590CC37-E2A4-488F-BBA2-C70042BD488D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {E590CC37-E2A4-488F-BBA2-C70042BD488D}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {E590CC37-E2A4-488F-BBA2-C70042BD488D}.Debug|x86.Build.0 = Debug|Any CPU
+ {E590CC37-E2A4-488F-BBA2-C70042BD488D}.Release|.NET.ActiveCfg = Release|Any CPU
+ {E590CC37-E2A4-488F-BBA2-C70042BD488D}.Release|.NET.Build.0 = Release|Any CPU
+ {E590CC37-E2A4-488F-BBA2-C70042BD488D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E590CC37-E2A4-488F-BBA2-C70042BD488D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E590CC37-E2A4-488F-BBA2-C70042BD488D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {E590CC37-E2A4-488F-BBA2-C70042BD488D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {E590CC37-E2A4-488F-BBA2-C70042BD488D}.Release|x86.ActiveCfg = Release|Any CPU
+ {E590CC37-E2A4-488F-BBA2-C70042BD488D}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -3055,6 +3091,8 @@ Global
{74040CE0-1D24-4F47-91B9-7F166EADBC61} = {D8A691C5-146D-4613-86CC-438F02FE9106}
{7C56D787-C6B1-43D5-9F3E-005FC9E633A3} = {D8A691C5-146D-4613-86CC-438F02FE9106}
{8A83C4DC-A0B1-4A51-AE1D-366D7A05B298} = {E7543C39-A44C-40C9-82C9-E7FAA2D9A852}
+ {A6E699B3-8399-4B8D-90F1-119B021F3D44} = {D8A691C5-146D-4613-86CC-438F02FE9106}
+ {E590CC37-E2A4-488F-BBA2-C70042BD488D} = {D8A691C5-146D-4613-86CC-438F02FE9106}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FBE985BB-9F0F-4DBB-8F94-ABC37A803FF9}
diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj
index 2ca56988c..f7ec51d07 100644
--- a/BeWo/BeWo.csproj
+++ b/BeWo/BeWo.csproj
@@ -275,6 +275,10 @@
Designer
MSBuild:Compile
+
+ MSBuild:Compile
+ Designer
+
MSBuild:Compile
Designer
@@ -307,6 +311,10 @@
MSBuild:Compile
Designer
+
+ MSBuild:Compile
+ Designer
+
MSBuild:Compile
Designer
@@ -823,6 +831,9 @@
+
+ NotizenKategorieView.xaml
+
BudgetView.xaml
@@ -853,6 +864,9 @@
TimeSheetMailView.xaml
+
+ HomeView.xaml
+
StundenplanView.xaml
@@ -1326,12 +1340,6 @@
MSBuild:Compile
Designer
-
- MSBuild:Compile
- Designer
- MSBuild:Compile
- Designer
-
MSBuild:Compile
Designer
@@ -1853,9 +1861,6 @@
-
- HomeDragPanelView.xaml
-
FinanceView.xaml
diff --git a/BeWo/View/Detail/CustomerView.xaml.cs b/BeWo/View/Detail/CustomerView.xaml.cs
index 8a9a9ee4f..caf47f974 100644
--- a/BeWo/View/Detail/CustomerView.xaml.cs
+++ b/BeWo/View/Detail/CustomerView.xaml.cs
@@ -76,6 +76,8 @@ namespace BeWo.View.Detail
private GridControl grid_Familys;
private bool DoOwnChatSync = false;
+ private ObservableSortCollection _AlleEintragKategorien;
+
public static bool DarfBargeldtransaktionenBearbeiten
{
get { return BeWoApp.LoggedOnUser.HasRight(UserRightType.BargeldverwaltungBearbeiten); }
@@ -94,6 +96,7 @@ namespace BeWo.View.Detail
BehinderungsartenSelection.CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (s, e) => this.Dispatch(() => { PopupBehinderungsarten.IsOpen = false; })));
MerkzeichenSelection.CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (s, e) => this.Dispatch(() => { PopupMerkzeichen.IsOpen = false; })));
+ _AlleEintragKategorien = pCustomerVM.EintragKategorien;
AdditionalServiceAssessmentSheetCategories = new List();
@@ -1110,7 +1113,7 @@ namespace BeWo.View.Detail
}
if (tabitem_notizen.Content == null)
{
- tabitem_notizen.Content = new NotizenView(TableID.Customer, ViewModel.DataContract.CustomerOid.Value);
+ tabitem_notizen.Content = new NotizenView(TableID.Customer, ViewModel.DataContract.CustomerOid.Value, _AlleEintragKategorien);
}
}
diff --git a/BeWo/View/Detail/EmployeeView.xaml.cs b/BeWo/View/Detail/EmployeeView.xaml.cs
index a97a95175..9c3502163 100644
--- a/BeWo/View/Detail/EmployeeView.xaml.cs
+++ b/BeWo/View/Detail/EmployeeView.xaml.cs
@@ -42,9 +42,9 @@ namespace BeWo.View.Detail
private bool initTabIndex;
-
+ private ObservableSortCollection _EintragKategorien;
- public EmployeeView(EmployeeVM pEmployeeDC)
+ public EmployeeView(EmployeeVM pEmployeeDC)
{
InitializeComponent();
combobox_brush.ItemTemplateSelector = new ComboBoxTemplateSelector(combobox_brush);
@@ -163,7 +163,10 @@ namespace BeWo.View.Detail
}
Img.EditValueChanged += Image_EditValueChanged;
- }
+
+ _EintragKategorien = pEmployeeDC.EintragKategorien;
+
+ }
@@ -550,7 +553,7 @@ namespace BeWo.View.Detail
}
if (tabitem_notizen.Content == null)
{
- tabitem_notizen.Content = new NotizenView(TableID.Employee, ViewModel.DataContract.EmployeeOid.Value);
+ tabitem_notizen.Content = new NotizenView(TableID.Employee, ViewModel.DataContract.EmployeeOid.Value, _EintragKategorien);
}
}
diff --git a/BeWo/View/Detail/EnvironmentRoleView.xaml.cs b/BeWo/View/Detail/EnvironmentRoleView.xaml.cs
index 98fddc953..963ffefa6 100644
--- a/BeWo/View/Detail/EnvironmentRoleView.xaml.cs
+++ b/BeWo/View/Detail/EnvironmentRoleView.xaml.cs
@@ -140,6 +140,5 @@ namespace BeWo.View.Detail
{
get { return this.borderTemp; }
}
-
}
}
\ No newline at end of file
diff --git a/BeWo/View/Detail/NotizenKategorieView.xaml b/BeWo/View/Detail/NotizenKategorieView.xaml
new file mode 100644
index 000000000..b425f3f30
--- /dev/null
+++ b/BeWo/View/Detail/NotizenKategorieView.xaml
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Detail/NotizenKategorieView.xaml.cs b/BeWo/View/Detail/NotizenKategorieView.xaml.cs
new file mode 100644
index 000000000..c7eb43484
--- /dev/null
+++ b/BeWo/View/Detail/NotizenKategorieView.xaml.cs
@@ -0,0 +1,199 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Windows;
+using System.Windows.Controls;
+using BS.Shared.Core;
+using BS.Shared.Extensions;
+
+using BeWo.Core;
+using BeWo.Core.Service;
+using BeWo.ServiceProxy;
+using BeWo.Validation;
+using BeWo.ViewModel;
+using BeWo.ViewModel.ListViewModel;
+using BS.Shared;
+using DevExpress.Xpf.Editors.Settings;
+using DevExpress.Xpf.Grid;
+
+namespace BeWo.View.Detail
+{
+ public partial class NotizenKategorieView : BeWoView
+ {
+ private readonly ValueListView _NotizEmpView;
+ private readonly ValueListView _NotizCosView;
+
+ public NotizenKategorieView(ValueListEntryListVM notizEmpList, ValueListEntryListVM notizCosList)
+ {
+ InitializeComponent();
+
+ _NotizCosView = new ValueListView(notizCosList);
+ _NotizEmpView = new ValueListView(notizEmpList);
+
+
+ _NotizCosView.SetValue(Grid.RowProperty, 0);
+ _NotizEmpView.SetValue(Grid.RowProperty, 1);
+
+ _NotizCosView.Margin = new Thickness(4);
+ _NotizEmpView.Margin = new Thickness(4);
+
+ Root.Children.Add(_NotizCosView);
+ Root.Children.Add(_NotizEmpView);
+ }
+
+ public override bool IsDirty => (_NotizCosView != null && _NotizCosView.IsDirty) ||
+ (_NotizEmpView != null && _NotizEmpView.IsDirty);
+
+ public override string Title => null;
+
+ protected override void Save()
+ {
+ var valid = true;
+ if (_NotizCosView != null)
+ {
+ if (_NotizCosView.IsDirty)
+ valid = _NotizCosView.SaveData();
+ }
+
+ if (_NotizEmpView != null)
+ {
+ if (valid && _NotizEmpView.IsDirty)
+ _NotizEmpView.SaveData();
+ }
+ }
+
+ internal override DependencyObject ValidationOnSaveRootElement => this.borderTemp;
+ }
+}
+// {
+ // private ValueListEntryListVM _NotizEmpList;
+ // private ValueListEntryListVM _NotizCosList;
+
+ // public NotizenKategorieView(ValueListEntryListVM notizEmpList, ValueListEntryListVM notizCosList)
+ //{
+ // InitializeComponent();
+
+ // NotizEmpList = notizEmpList;
+ // NotizCosList = notizCosList;
+
+ // }
+
+ // public override bool IsDirty =>
+ // NotizEmpList != null && NotizEmpList.IsDirty &&
+ // NotizCosList != null && NotizCosList.IsDirty;
+
+ // public override string Title => "Notizen Kategorien";
+
+ // //// TODO
+ // //internal override DependencyObject ValidationOnSaveRootElement
+ // //{
+ // // get { return button_addBudget; }
+ // //}
+
+ // private ValueListEntryListVM NotizEmpList
+ // {
+ // get => _NotizEmpList;
+
+ // set
+ // {
+ // _NotizEmpList = value;
+ // DatagridEmp.ItemsSource = value.VMList;
+ // }
+ // }
+
+ // private ValueListEntryListVM NotizCosList
+ // {
+ // get => _NotizCosList;
+
+ // set
+ // {
+ // _NotizCosList = value;
+ // DatagridCos.ItemsSource = value.VMList;
+ // }
+ // }
+
+ // private void Button_AddEmp_Click(object sender, RoutedEventArgs e)
+ // {
+ // if (ValidationTrigger.Validate(this))
+ // {
+ // NotizEmpList.AddNewVMToList();
+ // }
+ // }
+
+ // private void Button_DelEmp_Click(object sender, RoutedEventArgs e)
+ // {
+ // NotizEmpList.VMList.Remove(DatagridEmp.GetCurrentValue());
+ // BeWoWpfUtils.RefreshDXGrid(DatagridEmp);
+ // }
+
+ // private void Button_AddCos_Click(object sender, RoutedEventArgs e)
+ // {
+ // if (ValidationTrigger.Validate(this))
+ // {
+ // NotizCosList.AddNewVMToList();
+ // }
+ // }
+
+ // private void Button_DelCos_Click(object sender, RoutedEventArgs e)
+ // {
+ // NotizCosList.VMList.Remove(DatagridCos.GetCurrentValue());
+ // BeWoWpfUtils.RefreshDXGrid(DatagridCos);
+ // }
+
+ // //protected override void Save()
+ // //{
+ // // var lToDos = new List>();
+
+ // // if (NotizEmpList.AddedCount > 0)
+ // // {
+ // // lToDos.Add(s => s.InsertNewBudget(NotizEmpList.CommitAdded()));
+ // // }
+
+ // // if (NotizEmpList.RemovedCount > 0)
+ // // {
+ // // lToDos.Add(s => s.DeactivateBudget(NotizEmpList.GetRemoved().ToDictionary(dc => dc.BudgetOid.Value, dc => dc.BudgetVersion.Value)));
+ // // }
+
+ // // if (NotizEmpList.ChangedCount > 0)
+ // // {
+ // // lToDos.Add(s => s.UpdateBudget(ViewModel.CommitChanged()));
+ // // }
+
+ // // ServiceFacade.DoMultipleOperationsServicesAsync(lToDos, ReloadViewModel);
+ // //}
+
+
+ // private void ReloadViewModel()
+ // {
+ // VMFactory.CreateValueListVMAsync(ValueListEntryType.NotizenKategorieEmployee,
+ // notizEmpList => VMFactory.CreateValueListVMAsync(ValueListEntryType.NotizenKategorieCustomer,
+ // notizCosList => this.Dispatch(delegate
+ // {
+ // NotizEmpList = notizEmpList;
+ // NotizCosList = notizCosList;
+ // })));
+ // }
+
+ // //private void PART_Editor_Click(object sender, RoutedEventArgs e)
+ // //{
+ // // RowData data = DatagridRegions.View.FocusedRowData;
+
+ // // if (data != null && data.RowHandle != null)
+ // // {
+ // // var vm = DatagridRegions.GetRow(data.RowHandle.Value) as BudgetVM;
+
+ // // if (vm != null)
+ // // {
+ // // ViewModel.EditVM = vm;
+ // // //popup_costrateperiods.IsOpen = true;
+ // // }
+ // // }
+ // //}
+
+ // //private void button_edit_Click(object sender, RoutedEventArgs e)
+ // //{
+ // // //this.ViewModel.EditVM.Values = this.ViewModel.PossibleValues.Where(i => i.IsEditSelected).ToList();
+
+ // // //popup_costrateperiods.IsOpen = false;
+ // //}
+ // }
diff --git a/BeWo/View/HomeDragPanelView.xaml b/BeWo/View/HomeDragPanelView.xaml
deleted file mode 100644
index 68f4ea266..000000000
--- a/BeWo/View/HomeDragPanelView.xaml
+++ /dev/null
@@ -1,839 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Offene Aufgaben
- Erledigte Aufgaben
- Alle Aufgaben
- Termine
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/BeWo/View/HomeDragPanelView.xaml.cs b/BeWo/View/HomeDragPanelView.xaml.cs
deleted file mode 100644
index a6062c884..000000000
--- a/BeWo/View/HomeDragPanelView.xaml.cs
+++ /dev/null
@@ -1,2083 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Globalization;
-using System.Linq;
-using System.Runtime.CompilerServices;
-using System.Text;
-using System.Threading;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Controls.Primitives;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Threading;
-using BeWo.Core;
-using BeWo.ServiceProxy;
-using BeWo.View.Controls;
-using BeWo.View.Detail;
-using BeWo.ViewModel;
-
-using Blacklight.Wpf.Controls;
-
-using BS.Shared;
-using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.Compact;
-using BS.Shared.Extensions;
-using BS.Shared.RSS;
-using System.Text.RegularExpressions;
-using BeWo.Annotations;
-using BeWo.ownChat;
-using BeWo.Scheduler.Utils;
-using BeWo.Scheduler.View;
-using BeWo.View.Master;
-using ChatController.HauptKlassen;
-using DevExpress.XtraScheduler;
-using DevExpress.XtraScheduler.Xml;
-using Brushes = System.Windows.Media.Brushes;
-using Button = System.Windows.Controls.Button;
-using Color = System.Windows.Media.Color;
-using Control = System.Windows.Controls.Control;
-using Image = System.Windows.Controls.Image;
-using ListBox = System.Windows.Controls.ListBox;
-using MessageBox = System.Windows.MessageBox;
-using ScrollBar = System.Windows.Controls.Primitives.ScrollBar;
-
-namespace BeWo.View
-{
- ///
- /// Interaction logic for HomeView.xaml
- ///
- public partial class HomeDragPanelView : BeWoView, INotifyPropertyChanged
- {
- private List _AllTasks;
- private List _AllSchedulerTasks;
-
- private bool _IsAllowedToSeeMitarbeitertermine;
- private bool _IsAllowedToSeeCustomerAppointments;
- private bool _IsAllowedToSeeResourceAppointments;
-
- //chat berechtigung
- protected bool berechtigt;
- private Dictionary newsItemExpandedState = new Dictionary();
-
- public HomeDragPanelView()
- {
- InitializeComponent();
-
- DataContext = this;
-
- txtHeader.Text = String.Format("{0} {1}", BeWoApp.LoggedOnUser.Employee.FirstName,BeWoApp.LoggedOnUser.Employee.LastName);
-
- txtVersion.Text = BeWoApp.Version;
-
- txtLoginTime.Text = string.Empty;
- txtLastLoginTime.Text = string.Empty;
-
- PasswortSchloss.Text = string.Join("", (from Match m in Regex.Matches("D83DDD12", @"\S{4}") select (char)int.Parse(m.Value, NumberStyles.HexNumber)).ToArray());
-
- //PreparePanels();
- InitPanels(null);
-
-
- HyperlinkZuPasswortsicherheit.NavigateUri = new Uri("http://news.bewoplaner.de/?NewsType=3&NewsCount=1&NewsOID=373457455");
-
-
-#if DEBUG
- //txtChangePassword.Visibility = Visibility.Visible;
-
-#else
- if (BeWoApp.Tenant == "demo" || !BeWoApp.LoggedOnUser.HasRight(UserRightType.AllowChangeOwnPassword))
- {
- txtChangePassword.Visibility = Visibility.Collapsed;
- }
-#endif
- // FillInbox();
- // FillOutbox();
- Loaded += HomeDragPanelViewLoaded;
-
- /*this.Dispatcher.BeginInvoke(
- DispatcherPriority.Normal,
- (Action)delegate
- {
- ConnectWithServer();
- if(clientSocket.Connected)
- MessageBox.Show("Verbindung geglückt.", "Info", MessageBoxButton.OK,MessageBoxImage.Information);
- });*/
-
- if (BeWoApp.AppSettings.IsChatAllowed)
- {
- var berechtigung = ServiceFacade.DoEmployeeServiceSync(s => s.GetAllChatActiveEmployeesCompact());
- if (berechtigung != null)
- {
- foreach (var list in berechtigung)
- {
- if (list.PersonOid == BeWoApp.LoggedOnUser.Employee.PersonOid)
- {
- berechtigt = true;
- }
- }
- }
- }
-
-#if DEBUG
- berechtigt = true;
-#endif
-
- BewoChat.Visibility = berechtigt ? Visibility.Visible : Visibility.Hidden;
-
- PruefePasswortStaerke();
- }
-
- private bool _IsShowingAppointments;
-
- private bool _HasRightsToSeeAppointments;
-
- private List _EmployeesForAppointmentView;
- public List EmployeesForAppointmentView
- {
- get => _EmployeesForAppointmentView ?? (_EmployeesForAppointmentView = new List());
-
- set
- {
- _EmployeesForAppointmentView = value;
- OnPropertyChanged(nameof(EmployeesForAppointmentView));
- }
- }
-
- private void PruefePasswortStaerke()
- {
- if ( BeWoApp.PasswortStrength == PasswortSecurityStrength.SehrSchwach)
- {
- PasswortSchloss.Foreground = new SolidColorBrush(Colors.Red);
-
- this.Dispatcher.BeginInvoke(
- DispatcherPriority.Normal,
- (Action)delegate
- {
- if (BeWoApp.AppSettings.IsPasswordSecurityActiv)
- {
- MessageBox.Show("Sie benutzen ein sehr schwaches Passwort.\nBitte ändern Sie Ihr Passwort, indem Sie im Startbildschirm oben auf \"Passwort ändern\" klicken.", "Achtung!",
- MessageBoxButton.OK,MessageBoxImage.Information);
- }
- });
-
- }else if (BeWoApp.PasswortStrength == PasswortSecurityStrength.Schwach)
- {
- PasswortSchloss.Foreground = new SolidColorBrush(Colors.OrangeRed);
-
- this.Dispatcher.BeginInvoke(
- DispatcherPriority.Normal,
- (Action)delegate
- {
- if (BeWoApp.AppSettings.IsPasswordSecurityActiv)
- {
- MessageBox.Show("Sie benutzen ein schwaches Passwort.\nBitte ändern Sie Ihr Passwort, indem Sie im Startbildschirm oben auf \"Passwort ändern\" klicken.", "Achtung!",
- MessageBoxButton.OK, MessageBoxImage.Information);
- }
- });
- }
- else if (BeWoApp.PasswortStrength == PasswortSecurityStrength.Mittelmass)
- {
- PasswortSchloss.Foreground = new SolidColorBrush(Colors.Yellow);
- }
- else if (BeWoApp.PasswortStrength == PasswortSecurityStrength.Stark)
- {
- PasswortSchloss.Foreground = new SolidColorBrush(Colors.Green);
- }
- else if (BeWoApp.PasswortStrength == PasswortSecurityStrength.SehrStark)
- {
- PasswortSchloss.Foreground = new SolidColorBrush(Colors.Green);
- }
-
- }
-
- private void PreparePanels()
- {
- ServiceFacade.DoOperationsServiceAsyncNoWait(
- s => s.GetUiElements(UiElementType.StartPanel, BeWoApp.LoggedOnUser.Employee.EmployeeOid, null, null),
- InitPanelsCallback, null);
- }
-
- private void InitPanelsCallback(IList elements, object state)
- {
- this.Dispatcher.BeginInvoke(
- DispatcherPriority.Normal,
- (Action) delegate
- {
- InitPanels(elements);
- });
- }
-
- private void InitPanels(IList elements)
- {
- listboxExpiringSupportConcepts.Items.Clear();
- listboxConferenceDates.Items.Clear();
- listboxBirthdays.Items.Clear();
- listboxNews.Items.Clear();
- listboxTasks.Items.Clear();
- //ListboxInternalNews.Items.Clear();
- InternalNewsGrid.Children.Clear();
-
-
- //if (elements == null || elements.Count == 0)
- //{
- // //
- //}
- //else
- //{
- // foreach (var uiElementDc in elements)
- // {
- // var xamlElement = System.Windows.Markup.XamlReader.Parse(uiElementDc.Xaml);
- // if (xamlElement is DragDockPanel)
- // {
- // panelHost.Children.Add(xamlElement as UIElement);
- // }
- // }
-
- //}
-
- ReorderPanels();
- }
-
- private void HomeDragPanelViewLoaded(object o, RoutedEventArgs e)
- {
- InitContent();
- //Warum klappt das bei Köln Ring nicht?=
- if (BeWoApp.LoggedOnUser == null || BeWoApp.LoggedOnUser.ResetPasswordInfos == null)
- {
- return;
- }
-
- if (!BeWoApp.LoggedOnUser.ResetPasswordInfos.Any(a => a.HasToChangePW))
- {
- return;
- }
-
- var fenster = new PasswortAenderungsView {AbbrechenButton = {IsEnabled = false}};
- fenster.CommandBindings.Clear();
-
- fenster.ShowDialog();
- }
-
- public void SaveState()
- {
- var order = new List();
- DragDockPanel panelWithMaxHeight = null;
- double maxHeight = 0;
- double normalHeight = 0;
-
- var result = new List();
-
- foreach (object item in panelHost.Children)
- {
- var p = item as DragDockPanel;
-
- if (order.Count == 0)
- {
- order.Add(p);
- }
- else
- {
- int newIndex = -1;
- int index = 0;
-
- Vector rect = VisualTreeHelper.GetOffset(p);
- foreach (DragDockPanel item2 in order)
- {
- string name1 = p.Name;
- string name2 = item2.Name;
-
- Vector rect2 = VisualTreeHelper.GetOffset(item2);
- if (rect.Y < rect2.Y)
- {
- newIndex = index;
- continue;
- }
-
- if (Equals(rect.Y, rect2.Y) && rect.X < rect2.X)
- {
- newIndex = index;
- continue;
- }
-
- index++;
- }
-
- if (newIndex < 0)
- {
- order.Add(p);
- }
- else
- {
- order.Insert(newIndex, p);
- }
- }
-
- if (p.Height > maxHeight)
- {
- maxHeight = p.ActualHeight;
- panelWithMaxHeight = p;
- }
- else
- {
- normalHeight = p.ActualHeight;
- }
- }
-
- if ((maxHeight - normalHeight) > 1 && panelWithMaxHeight != null)
- {
- BeWoApp.AppSettings.StartupPanelMaximized = panelWithMaxHeight.Name;
- }
- else
- {
- BeWoApp.AppSettings.StartupPanelMaximized = null;
- }
-
- List panelOrder = order.Select(item => item.Name).ToList();
-
- BeWoApp.AppSettings.StartupPanelOrder = panelOrder;
- }
-
- private void ButtonOpenServiceRecordView_Click(object sender, RoutedEventArgs e)
- {
- var btn = sender as Button;
- if (btn != null)
- {
- var dc = btn.Tag as CompactSupportConceptDC;
-
- if (dc != null)
- BeWoApp.MainControl.NavigateToServiceRecordView(dc.SupportConceptOid);
- }
- }
-
- private void InitBewoNews()
- {
- try
- {
- if (BeWoApp.Tenant != "demo")
- {
- LoadFeed();
-
- //LoadFeed("http://www.heise.de/foto/rss/news-atom.xml");
- }
- }
- catch (Exception)
- {
- }
- }
-
- private void InitBirthdays()
- {
- DateTime endOfWeek = DateTime.Now.GetNext(DayOfWeek.Sunday).Date;
- endOfWeek = endOfWeek.AddDays(1).GetNext(DayOfWeek.Sunday).Date;
- ServiceFacade.DoAnalysisServiceAsync(s1 => s1.GetPersonsHavingBirthday(endOfWeek), ReloadBirthdays);
- }
-
- private void InitContent()
- {
- SetMaximizedPanel();
-
- InitLoginInfo();
- InitExpiredSupportConcepts();
- InitNextConferenceDates();
- InitBewoNews();
- InitBirthdays();
-
- rb_open.IsChecked = true;
- UpdateInternalNews();
- InitTasks();
- }
-
- private void InitExpiredSupportConcepts()
- {
- // DateTime endOfWeek = DateTime.Now.GetNext(DayOfWeek.Sunday).Date;
- // DateTime endOfWeek2 = endOfWeek.AddDays(8);
- DateTime dt = DateTime.Now.AddMonths(BeWoApp.AppSettings.HilfeplanAuslaufAuswahl);
- ServiceFacade.DoAnalysisServiceAsync(
- s1 => s1.GetExpiringSupportConcepts(BeWoApp.LoggedOnUser.Employee.EmployeeOid, dt),
- ReloadExpiringSupportConcepts);
- }
-
- private void UpdateInternalNews()
- {
- if (InternalNewsGrid != null)
- {
- newsItemExpandedState.Clear();
- foreach (var child in InternalNewsGrid.Children)
- {
- var rootsp = child as StackPanel;
-
- if (rootsp != null && rootsp.Children.Count > 0)
- {
- foreach (var child2 in rootsp.Children)
- {
- var ex = child2 as Expander;
-
- if (ex != null)
- {
- var grid = ex.Header as Grid;
- String text = "";
-
- if (grid != null)
- {
- foreach (var gridChild in grid.Children)
- {
- if (gridChild is TextBlock)
- {
- var tb = gridChild as TextBlock;
- text = tb.Text;
- }
- }
- }
- if (!newsItemExpandedState.ContainsKey(text))
- {
- newsItemExpandedState.Add(text, ex.IsExpanded);
- }
-
- }
- }
-
- }
- }
- }
-
- var showTeamNews = BeWoApp.AppSettings.ShowTeamNews;
-
- //ServiceFacade.DoEmployeeServiceAsync(s => s.GetPublishedNewsItems(), cb => this.Dispatch(delegate { listboxInternalNews.ItemsSource = cb.OrderByDescending(i => i.PublishDate).ToList(); }));
- ServiceFacade.DoEmployeeServiceAsync(
- s => s.GetPublishedNewsItemsForEmployee(BeWoApp.LoggedOnUser.Employee.EmployeeOid, showTeamNews),
- RefreshInternalNews);
- }
-
- private void RefreshInternalNews(List news)
- {
- this.Dispatch(delegate
- {
-
- var team2News = new Dictionary();
- var allNews = new TeamNewsItemVM();
- allNews.Team = new CompactTeamDC();
- allNews.Team.Name = "Allgemein";
- allNews.AllowEdit = false;
- allNews.IsTitleVisible = true;
-
- foreach (var newsItemDc in news)
- {
- if (newsItemDc.Team != null)
- {
- newsItemDc.AllowEdit = true;
- newsItemDc.TitleString = String.Format("{0:dd.MM.yyyy}: {1}", newsItemDc.PublishDate,
- newsItemDc.Title);
- if (!team2News.ContainsKey(newsItemDc.Team.TeamOid))
- {
- team2News[newsItemDc.Team.TeamOid] = new TeamNewsItemVM();
- team2News[newsItemDc.Team.TeamOid].Team = newsItemDc.Team;
- team2News[newsItemDc.Team.TeamOid].AllowEdit = true;
- team2News[newsItemDc.Team.TeamOid].IsTitleVisible = true;
- }
- if (newsItemDc.NewsItemOid.HasValue)
- {
- team2News[newsItemDc.Team.TeamOid].NewsItems.Add(newsItemDc);
- }
- }
- else
- {
- newsItemDc.TitleString = newsItemDc.Title;
- allNews.NewsItems.Add(newsItemDc);
- }
- }
-
- var list = team2News.Values.OrderBy(i => i.Team.Name).ToList();
-
- if (list.Count == 0)
- allNews.IsTitleVisible = false;
- list.Add(allNews);
-
- InternalNewsGrid.Children.Clear();
- InternalNewsGrid.Children.Add(CreateInternalNewsControlList(list));
- //ListboxInternalNews.ItemsSource = list;
-
- });
- }
-
- private UIElement CreateInternalNewsControlList(List list)
- {
- bool expand = true;
-
- if (newsItemExpandedState.Count == 0)
- {
- if (list != null && list.Count > 1)
- {
- int count = 0;
- foreach (var teamNewsItemVm in list)
- {
- if (teamNewsItemVm.NewsItems != null)
- {
- count += teamNewsItemVm.NewsItems.Count;
- }
- }
-
- if (count > 10)
- {
- expand = false;
- }
- }
- }
-
-
-
- StackPanel sp = new StackPanel();
- foreach (var teamNewsItemVm in list)
- {
- sp.Children.Add(CreateInternalNewsTeamControl(teamNewsItemVm, expand));
- }
- return sp;
- }
-
- private UIElement CreateInternalNewsTeamControl(TeamNewsItemVM teamNewsItemVm, bool initExpand)
- {
- var sp = new StackPanel();
- foreach (var newsItem in teamNewsItemVm.NewsItems)
- {
- sp.Children.Add(CreateInternalNewsControl(newsItem));
- }
-
-
- if (teamNewsItemVm.IsTitleVisible)
- {
- Expander ex = new Expander();
-
- ex.Style = (Style)FindResource("FlatLineExpander");
-
- bool expanded = initExpand;
-
- if (newsItemExpandedState.ContainsKey(teamNewsItemVm.Team.Name))
- {
- expanded = newsItemExpandedState[teamNewsItemVm.Team.Name];
- }
-
- ex.IsExpanded = expanded;
- ex.Margin = new Thickness(0, 5, 5, 5);
-
- Grid grid = new Grid();
- grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Auto) });
- grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
- TextBlock tb = new TextBlock();
- tb.FontSize = 14;
- tb.FontWeight = FontWeights.Bold;
- tb.Text = teamNewsItemVm.Team.Name;
- grid.Children.Add(tb);
-
- if (teamNewsItemVm.AllowEdit)
- {
- Button newBtn = new Button();
- newBtn.Style = (Style)FindResource("FlatButton");
- newBtn.SetValue(Grid.ColumnProperty, 1);
- newBtn.HorizontalAlignment = System.Windows.HorizontalAlignment.Right;
- newBtn.Width = 16;
- newBtn.Height = 16;
- newBtn.Click += BtnCreateNewsItem_OnClick;
- newBtn.Tag = teamNewsItemVm;
- newBtn.Margin = new Thickness(0, 0, -10, 0);
-
- Image img = new Image();
- img.Source = new BitmapImage(new Uri(@"..\..\Ressources\Icons\new.png", UriKind.Relative));
- img.Stretch = Stretch.Uniform;
- newBtn.Content = img;
- grid.Children.Add(newBtn);
- }
-
- ex.Header = grid;
- ex.Content = sp;
- return ex;
- }
- return sp;
-
-
- //
- //
- //
- //
- //
- //
- //
- //
- //
-
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
-
- //
- //
- //
-
-
- //
- //
- //
-
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- }
-
- private UIElement CreateInternalNewsControl(NewsItemDC newsItem)
- {
- Grid grid = new Grid();
- grid.ColumnDefinitions.Add(new ColumnDefinition {Width = new GridLength(1, GridUnitType.Star)});
- grid.ColumnDefinitions.Add(new ColumnDefinition {Width = new GridLength(1, GridUnitType.Auto)});
- grid.ColumnDefinitions.Add(new ColumnDefinition {Width = new GridLength(1, GridUnitType.Auto)});
-
- grid.RowDefinitions.Add(new RowDefinition {Height = new GridLength(25, GridUnitType.Pixel)});
- grid.RowDefinitions.Add(new RowDefinition {Height = new GridLength(1, GridUnitType.Star)});
- grid.Margin = new Thickness(0, 5, 0, 0);
-
- TextBlock tb = new TextBlock();
- tb.Margin = new Thickness(0, 5, 0, 0);
- tb.Foreground = new SolidColorBrush(Color.FromRgb(43, 80, 139));
- tb.Text = newsItem.TitleString;
- tb.FontSize = 12;
- tb.FontWeight = FontWeights.Bold;
- grid.Children.Add(tb);
-
- tb = new TextBlock();
- tb.Text = newsItem.Text;
- tb.FontSize = 10;
- tb.TextWrapping = TextWrapping.Wrap;
- tb.SetValue(Grid.RowProperty, 1);
- tb.SetValue(Grid.ColumnSpanProperty, 3);
- grid.Children.Add(tb);
-
- if (newsItem.AllowEdit)
- {
- //
- //
- //
- //
- //
- //
-
- Border b = new Border();
- b.Background = Brushes.Transparent;
- b.SetValue(Grid.ColumnProperty, 1);
- grid.Children.Add(b);
- //
- //
-
- Button editBtn = new Button();
- editBtn.BorderThickness = new Thickness(1, 1, 1, 1);
- editBtn.Padding = new Thickness(1, 1, 1, 1);
- editBtn.Style = (Style) FindResource("FlatButton");
- editBtn.SetValue(Grid.ColumnProperty, 1);
- editBtn.VerticalAlignment = VerticalAlignment.Top;
- editBtn.Width = 16;
- editBtn.Height = 16;
- editBtn.Click += BtnEditNewsItem_OnClick;
- editBtn.Tag = newsItem;
- editBtn.Visibility = Visibility.Hidden;
-
- Image img = new Image();
- img.Source = new BitmapImage(new Uri(@"..\..\Ressources\Icons\edit.png", UriKind.Relative));
- img.Stretch = Stretch.Uniform;
- img.Margin = new Thickness(1, 1, 1, 1);
- editBtn.Content = img;
- grid.Children.Add(editBtn);
-
-
- b = new Border();
- b.Background = Brushes.Transparent;
- b.SetValue(Grid.ColumnProperty, 2);
- grid.Children.Add(b);
-
- Button deleteBtn = new Button();
- deleteBtn.Padding = new Thickness(1, 1, 1, 1);
- deleteBtn.Style = (Style) FindResource("FlatButton");
- deleteBtn.SetValue(Grid.ColumnProperty, 2);
- deleteBtn.VerticalAlignment = VerticalAlignment.Top;
- deleteBtn.Width = 16;
- deleteBtn.Height = 16;
- deleteBtn.Click += BtnDeleteNewsItem_OnClick;
- deleteBtn.Tag = newsItem;
- deleteBtn.Visibility = Visibility.Hidden;
-
- img = new Image();
- img.Source = new BitmapImage(new Uri(@"..\..\Ressources\Icons\delete.png", UriKind.Relative));
- img.Stretch = Stretch.Uniform;
- img.Margin = new Thickness(1, 1, 1, 1);
- deleteBtn.Content = img;
- grid.Children.Add(deleteBtn);
-
- grid.MouseEnter += (s, e) =>
- {
- editBtn.Visibility = Visibility.Visible;
- deleteBtn.Visibility = Visibility.Visible;
- };
-
- grid.MouseLeave += (s, e) =>
- {
- editBtn.Visibility = Visibility.Hidden;
- deleteBtn.Visibility = Visibility.Hidden;
- };
- }
- //
- //
- //
-
-
- //
- //
- //
-
-
- return grid;
- }
-
- private void InitLoginInfo()
- {
- DateTime endOfWeek = DateTime.Now.GetNext(DayOfWeek.Sunday).Date;
-
- ServiceFacade.DoAnalysisServiceAsync(s1 => s1.GetLastLogins(BeWoApp.LoggedOnUser.LoginName), ReloadLogins);
- }
-
- private void InitNextConferenceDates()
- {
- DateTime endOfWeek = DateTime.Now.GetNext(DayOfWeek.Sunday).Date;
- DateTime endOfWeek2 = endOfWeek.AddDays(8);
-
- ServiceFacade.DoAnalysisServiceAsync(
- s1 => s1.GetSupportConceptsWithConferenceDate(BeWoApp.LoggedOnUser.Employee.EmployeeOid, endOfWeek2),
- ReloadConferenceDates);
- }
-
- public NewSchedulerView Scheduler;
-
- private void InitTasks()
- {
- var test = 0;
-
- while (BeWoApp.LoggedOnEmployee == null && test < 50)
- {
- Thread.Sleep(100);
- test++;
- }
-
- if (BeWoApp.LoggedOnEmployee != null)
- {
- var rights = new List { UserRightType.KalenderAnsehen };
-
- _HasRightsToSeeAppointments = BeWoUtils.HasRight(UserRightType.KalenderAnsehen) || BeWoUtils.HasRight(UserRightType.ViewAll);
-
- var r2 = rights;
- r2.Add(UserRightType.KalenderMitarbeitertermineAnsehen);
-
- var r3 = rights;
- r3.Add(UserRightType.KalenderKliententermineAlleAnsehen);
-
- var r5 = rights;
- r5.Add(UserRightType.KalenderRessourcentermineAnsehen);
-
- _IsAllowedToSeeMitarbeitertermine = r2.All(BeWoUtils.HasRight) || BeWoUtils.HasRight(UserRightType.ViewAll);
- _IsAllowedToSeeCustomerAppointments = r3.All(BeWoUtils.HasRight) || BeWoUtils.HasRight(UserRightType.ViewAll);
- _IsAllowedToSeeResourceAppointments = r5.All(BeWoUtils.HasRight) || BeWoUtils.HasRight(UserRightType.ViewAll);
-
- if (_HasRightsToSeeAppointments && _IsAllowedToSeeMitarbeitertermine)
- {
-#if DEBUG
- TestTermineAnlegenButton.Visibility = Visibility.Visible;
- TestTermineLoeschenButton.Visibility = Visibility.Visible;
-#endif
-
- employeeFilterBox.Visibility = Visibility.Visible;
-
- ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllActiveEmployeesCompact(), cb =>
- {
- this.Dispatch(delegate
- {
- EmployeesForAppointmentView = cb.OrderBy(o => o.LastName + ", " + o.FirstName).ToList();
- employeeFilterBox.SelectedItem = BeWoApp.CompactLoggedOnEmployee;
- });
- });
- }
- else
- {
- EmployeesForAppointmentView = new List { BeWoApp.CompactLoggedOnEmployee };
- employeeFilterBox.SelectedItem = BeWoApp.CompactLoggedOnEmployee;
- }
-
- ShowAppointments(false);
- LoadTasksAndAppointments(true, true);
- }
- }
-
- private void BuildRecurringAppointments(List pRecurringAppointments, DateTime pStartDate, DateTime pEndDate)
- {
- var patternToExceptions = new List();
- var recurrenceInterval = new TimeInterval(pStartDate, pEndDate - pStartDate);
-
- var scheduler = new SchedulerControl();
-
- foreach(var appointment in pRecurringAppointments.OrderBy(o => o.Type))
- {
- if(appointment.Type == (int) AppointmentType.Pattern)
- {
- var id = Utils.ExtractIdFromRecurrenceInfo(appointment.RecurrenceInfo);
-
- patternToExceptions.Add(new RecurringAppointment(id, pRecurringAppointments.Where(w => w.RecurrenceInfo.Contains(id) && w.Type != (int) AppointmentType.Pattern).ToDictionary(x => Utils.ExtractIndexFromRecurrenceInfo(x.RecurrenceInfo), y => y), appointment));
- }
- }
-
- foreach (var appointment in patternToExceptions)
- {
- var patternAppointment = appointment.Pattern;
-
- var recurrenceInfo = RecurrenceInfoXmlPersistenceHelper.ObjectFromXml(patternAppointment.RecurrenceInfo);
- var instance = OccurrenceCalculator.CreateInstance(recurrenceInfo);
-
- scheduler.Storage = new SchedulerStorage();
-
- var pattern = scheduler.Storage.CreateAppointment(AppointmentType.Pattern, appointment.Pattern.StartDate.Value, appointment.Pattern.EndDate.Value);
-
- var occurrences = instance.CalcOccurrences(recurrenceInterval, pattern);
-
- foreach(var devExpressAppointment in occurrences)
- {
- var index = devExpressAppointment.RecurrenceIndex;
-
- if(index == 0 && appointment.Occurrences.ContainsKey(0))
- {
- _AllSchedulerTasks.Remove(appointment.Pattern);
- }
-
- var indizes = appointment.Occurrences.Keys.ToList();
-
- if (indizes.Contains(index) || devExpressAppointment.Type == AppointmentType.Occurrence && devExpressAppointment.RecurrenceIndex == 0)
- {
- continue;
- }
-
- var occurrence = new SchedulerAppointmentDC
- {
- CustomerList = patternAppointment.CustomerList,
- AllDay = patternAppointment.AllDay,
- EndDate = devExpressAppointment.End,
- RecurrenceInfo = devExpressAppointment.RecurrenceInfo.ToXml(),
- StartDate = devExpressAppointment.Start,
- Type = (int) AppointmentType.Occurrence,
- CompletedDate = patternAppointment.CompletedDate,
- Description = patternAppointment.Description,
- DueDate = patternAppointment.DueDate,
- EmployeeList = patternAppointment.EmployeeList,
- CompletedNotice = patternAppointment.CompletedNotice,
- FormerBookingSequenceOid = patternAppointment.FormerBookingSequenceOid,
- FormerTaskOid = patternAppointment.FormerTaskOid,
- IsPrivate = patternAppointment.IsPrivate,
- IsTeilnahmeBestaetigung = patternAppointment.IsTeilnahmeBestaetigung,
- SupportConceptList = patternAppointment.SupportConceptList,
- TaskDescription = patternAppointment.TaskDescription,
- IsTask = patternAppointment.IsTask,
- ResourceList = patternAppointment.ResourceList,
- Originator = patternAppointment.Originator,
- Subject = patternAppointment.Subject,
- Location = patternAppointment.Location,
- Status = patternAppointment.Status,
- LabelId = patternAppointment.LabelId,
- RecurrenceIndex = devExpressAppointment.RecurrenceIndex,
- RecurrenceId = appointment.RecurrenceId
- };
-
- _AllSchedulerTasks.Add(occurrence);
- }
- }
- }
-
- private static bool IsPartOf(object p, Type type)
- {
- if (p != null)
- {
- var fe = p as FrameworkElement;
- if (fe != null)
- {
- if (fe.GetType() == type)
- return true;
-
- return IsPartOf(fe.TemplatedParent, type);
- }
- }
-
- return false;
- }
-
- private void LoadFeed()
- {
-
- String url = BeWoApp.Mandator.RssFeedUrl;
-
- if (String.IsNullOrEmpty(url))
- {
- ServiceFacade.DoDownloadServiceAsync(
- dwn =>
- {
- try
- {
- return dwn.ReadRssFeed(null);
- }
- catch (Exception)
- {
- }
-
- return null;
- },
- ReloadRssFeed);
- }
- else
- {
- RssFeed feed = new RssFeed();
-
- RssManager mgr = new RssManager(url);
- feed.Items = mgr.GetFeed();
- feed.Title = mgr.FeedTitle;
- feed.Description = mgr.FeedDescription;
-
- ReloadRssFeed(feed, false);
- }
- }
-
- private void RadioButton_Checked(object sender, RoutedEventArgs e)
- {
- if (_AllSchedulerTasks != null)
- {
- var controlName = ((Control) e.OriginalSource).Name;
-
- switch (controlName)
- {
- case "rb_all":
- _IsShowingAppointments = false;
- listboxTasks.ItemsSource = _AllSchedulerTasks.Where(w => w.IsTask).OrderBy(i => i.CompletedDate ?? i.DueDate).ToList();
- ShowAppointments(false);
- break;
- case "rb_open":
- _IsShowingAppointments = false;
- listboxTasks.ItemsSource = _AllSchedulerTasks.Where(i => !i.CompletedDate.HasValue && i.IsTask).OrderBy(i => i.DueDate).ToList();
- ShowAppointments(false);
- break;
- case "rb_closed":
- _IsShowingAppointments = false;
- listboxTasks.ItemsSource = _AllSchedulerTasks.Where(i => i.CompletedDate.HasValue && i.IsTask).OrderByDescending(i => i.CompletedDate).ToList();
- ShowAppointments(false);
- break;
- case "rb_appointments":
- _IsShowingAppointments = true;
- listboxTasks.ItemsSource = _AllSchedulerTasks.Where(i => !i.IsTask).OrderByDescending(i => i.EndDate).ToList();
- ShowAppointments(true);
- break;
- }
- }
- }
-
- private const int _DateBuffer = 14;
- private DateTime _BufferDate = DateTime.Today.AddDays(-1 * _DateBuffer);
- private DateTime _CurrentDate = DateTime.Today;
-
- public DateTime CurrentDate
- {
- get => _CurrentDate;
- set
- {
- if(!Equals(_CurrentDate, value))
- {
- _CurrentDate = value;
- UpdateAppointmentDateTextBlock(value);
- OnPropertyChanged(nameof(CurrentDate));
- }
- }
- }
-
- private void ShowAppointments(bool pShouldShowAppointments)
- {
- TimeIntervalNavigationStackPanel.Visibility = pShouldShowAppointments ? Visibility.Visible : Visibility.Collapsed;
- TimeIntervalBackButton.Visibility = pShouldShowAppointments ? Visibility.Visible : Visibility.Collapsed;
- AppointmentDateTextBlock.Visibility = pShouldShowAppointments ? Visibility.Visible : Visibility.Collapsed;
- TimeIntervalForwardsButton.Visibility = pShouldShowAppointments ? Visibility.Visible : Visibility.Collapsed;
-
- if(pShouldShowAppointments)
- {
- CurrentDate = DateTime.Today;
- UpdateAppointmentDateTextBlock(null);
- }
- }
-
- public void TimeIntervalBackButtonOnClick(object sender, EventArgs args)
- {
- CurrentDate = CurrentDate.AddDays(-1);
- UpdateAppointmentDateTextBlock(_CurrentDate);
- }
-
- public void TimeIntervalForwardsButtonOnClick(object sender, EventArgs args)
- {
- CurrentDate = CurrentDate.AddDays(1);
- UpdateAppointmentDateTextBlock(_CurrentDate);
- }
-
- private void UpdateAppointmentDateTextBlock(DateTime? pDate)
- {
- var date = pDate ?? DateTime.Today;
-
- var weekOfYear = date.GetIso8601WeekOfYear().ToString();
- var dayOfWeek = date.ToString("dddd");
-
- AppointmentDateTextBlock.Text = $"KW {weekOfYear}, {dayOfWeek} ";
-
- LoadTasksAndAppointments(false);
- }
-
- private void LoadTasksAndAppointments(bool pIsShowingTasks, bool pForceUpdate = false)
- {
- if(_CurrentDate < _BufferDate || _CurrentDate > _BufferDate.AddDays(3 * _DateBuffer) || pForceUpdate)
- {
- _BufferDate = _CurrentDate.AddDays(-1 * _DateBuffer);
-
- ServiceFacade.DoResourceServiceAsync(s => s.LoadTasksAndAppointmentsForEmployee(BeWoApp.LoggedOnEmployeeOid.Value, _CurrentDate, _DateBuffer, _SelectedEmployeeForAppointments?.EmployeeOid), cb =>
- {
- this.Dispatch(delegate
- {
- _AllSchedulerTasks = cb;
-
- BuildRecurringAppointments(_AllSchedulerTasks.Where(w => w.RecurrenceInfo != null).ToList(), _CurrentDate, _CurrentDate.AddDays(3 * _DateBuffer));
-
- if (pIsShowingTasks)
- {
- listboxTasks.ItemsSource = _AllSchedulerTasks.Where(i => i.IsTask && !i.CompletedDate.HasValue).OrderBy(i => i.DueDate).OrderBy(o => o.StartDate ?? DateTime.MinValue).ToList();
- }
- else
- {
- listboxTasks.ItemsSource = _AllSchedulerTasks.Where(i => !i.IsTask &&
- i.StartDate.HasValue && i.StartDate.Value.InBetween(_CurrentDate, _CurrentDate.AddDays(14), true) &&
- i.EndDate.HasValue && i.EndDate.Value.InBetween(_CurrentDate, _CurrentDate.AddDays(14), true) &&
- i.Type != (int) AppointmentType.DeletedOccurrence).OrderBy(o => o.StartDate ?? DateTime.MinValue).ToList();
- }
- });
- });
- }
- else
- {
- if (pIsShowingTasks)
- {
- listboxTasks.ItemsSource = _AllSchedulerTasks.Where(i => i.IsTask && !i.CompletedDate.HasValue).OrderBy(i => i.DueDate).OrderBy(o => o.StartDate ?? DateTime.MinValue).ToList();
- }
- else
- {
- listboxTasks.ItemsSource = _AllSchedulerTasks.Where(i => !i.IsTask &&
- i.StartDate.HasValue && i.StartDate.Value.InBetween(_CurrentDate, _CurrentDate.AddDays(14), true) &&
- i.EndDate.HasValue && i.EndDate.Value.InBetween(_CurrentDate, _CurrentDate.AddDays(14), true) &&
- i.Type != (int) AppointmentType.DeletedOccurrence).OrderBy(o => o.StartDate ?? DateTime.MinValue).ToList();
-
- foreach (var app in listboxTasks.ItemsSource)
- {
- var a = (SchedulerAppointmentDC)app;
-
- if (a.IsTask || a.RecurrenceInfo == null)
- {
- continue;
- }
- }
- }
- }
- }
-
- private void ReloadRssFeed(RssFeed feed)
- {
- ReloadRssFeed(feed, true);
- }
-
- private void ReloadRssFeed(RssFeed feed, bool addBeWoParameter)
- {
- if (feed != null)
- {
- if (feed.Items != null && addBeWoParameter)
- {
- foreach (RssItem rssItem in feed.Items)
- {
- if (!String.IsNullOrEmpty(rssItem.Link))
- {
- rssItem.Link += String.Format("&k={0}&s={1}", BeWoApp.Tenant, BeWoApp.ServerName);
- }
- }
- }
- this.Dispatch(delegate { listboxNews.ItemsSource = feed.Items; });
- }
- }
-
- private void ReloadBirthdays(List list)
- {
- this.Dispatch(
- delegate
- {
- list.Sort((l1, l2) => l1.DateOfBirth.Value.DayOfYear.CompareTo(l2.DateOfBirth.Value.DayOfYear));
- listboxBirthdays.ItemsSource = list;
- });
- }
-
- private void ReloadConferenceDates(List list)
- {
- this.Dispatch(
- delegate
- {
- list.Sort((l1, l2) => l1.ConferenceDate.Value.CompareTo(l2.ConferenceDate.Value));
- listboxConferenceDates.ItemsSource = list;
- });
- }
-
- private void ReloadExpiringSupportConcepts(List list)
- {
- this.Dispatch(
- delegate
- {
- list.Sort((l1, l2) => l1.EndDate.Value.CompareTo(l2.EndDate.Value));
-
- listboxExpiringSupportConcepts.ItemsSource = list;
- });
- }
-
- private void ReloadLogins(List list)
- {
- this.Dispatch(
- delegate
- {
- // listboxNews.ItemsSource = list;
- list.Sort((l1, l2) => l1.LoginDate.Value.CompareTo(l2.LoginDate.Value));
-
- if (list.Count > 0)
- {
- LoginDC last = list[list.Count - 1];
- txtLoginTime.Text = "Angemeldet seit " + last.LoginDate.Value.ToShortDateString() + " " +
- last.LoginDate.Value.ToShortTimeString();
- if (list.Count > 1)
- {
- LoginDC dc = list[list.Count - 2];
-
- txtLastLoginTime.Text = ", zuletzt angemeldet am " + dc.LoginDate.Value.ToShortDateString() +
- " " + dc.LoginDate.Value.ToShortTimeString();
- }
- }
- });
- }
-
- public void ReorderPanels()
- {
- List order = BeWoApp.AppSettings.StartupPanelOrder;
- if (order != null && order.Count > 0)
- {
- var panels = new Dictionary();
-
- foreach (object item in panelHost.Children)
- {
- var p = item as DragDockPanel;
- panels.Add(p.Name, p);
- }
-
- panelHost.Children.Clear();
- foreach (string item in order)
- {
- if (panels.ContainsKey(item))
- {
- DragDockPanel p = panels[item];
-
- panelHost.AddPanel(p); // Children.Add(p);
-
- panels.Remove(item);
- }
- }
-
- foreach (DragDockPanel item in panels.Values)
- {
- panelHost.AddPanel(item);
- }
- }
- }
-
- private void SetMaximizedPanel()
- {
- if (!String.IsNullOrEmpty(BeWoApp.AppSettings.StartupPanelMaximized))
- {
- foreach (object item in panelHost.Children)
- {
- var p = item as DragDockPanel;
- if (BeWoApp.AppSettings.StartupPanelMaximized.Equals(p.Name))
- {
- IEnumerable objekts = p.GetAllChildren();
-
- foreach (DependencyObject child in objekts)
- {
- if (child is ToggleButton)
- {
- var btn = child as ToggleButton;
- btn.IsChecked = true;
- }
- }
- }
- }
- }
- }
-
- private void listboxBirthdays_MouseDoubleClick(object sender, MouseButtonEventArgs e)
- {
- //if (!IsPartOf(e.OriginalSource, typeof (ScrollBar)))
- //{
- // var dc = ((ListBox) sender).SelectedItem as CompactPersonDC;
-
- // if (dc != null)
- // {
- // if (dc.PersonType == PersonType.Customer)
- // {
- // if (BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View) ||
- // BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll))
- // {
- // ServiceFacade.DoCustomerServiceAsync(
- // s => s.GetCustomerWithPersonOid(dc.PersonOid),
- // cb => VMFactory.CreateCustomerVMAsync(
- // cb,
- // cb2 => this.Dispatch(
- // delegate
- // {
- // MainControl.NavigateTo(
- // new CustomerView(cb2)
- // {
- // ParentView = this
- // });
- // })));
- // }
- // }
- // else if (dc.PersonType == PersonType.Employee)
- // {
- // if (BeWoApp.LoggedOnUser.HasRight(UserRightType.EmployeeView_View) ||
- // BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll))
- // {
- // ServiceFacade.DoEmployeeServiceAsync(
- // s => s.GetEmployeeWithPersonOid(dc.PersonOid),
- // cb => VMFactory.CreateEmployeeVMAsync(
- // cb,
- // cb2 => this.Dispatch(
- // delegate
- // {
- // MainControl.NavigateTo(
- // new EmployeeView(cb2)
- // {
- // ParentView = this
- // });
- // })));
- // }
- // }
- // else if (BeWoApp.LoggedOnUser.HasRight(UserRightType.PersonView_View) ||
- // BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll))
- // {
- // VMFactory.CreatePersonVMAsync(
- // dc.PersonOid,
- // cb => this.Dispatch(
- // delegate
- // {
- // MainControl.NavigateTo(
- // new PersonView(cb)
- // {
- // ParentView = this
- // });
- // }));
- // }
- // }
- //}
- }
-
- private void listboxSupportConcepts_MouseDoubleClick(object sender, MouseButtonEventArgs e)
- {
- if (!IsPartOf(e.OriginalSource, typeof (ScrollBar)))
- {
- var sc = ((ListBox) sender).SelectedItem as CompactSupportConceptDC;
-
- if (sc != null &&
- (BeWoApp.LoggedOnUser.HasRight(UserRightType.SupportConcept_ViewAllSupportConcepts) ||
- BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll) ||
- BeWoApp.LoggedOnUser.HasRight(UserRightType.SupportConceptView_View)))
- {
- VMFactory.CreateSupportConceptVMAsync(
- sc.SupportConceptOid,
- cb => this.Dispatch(
- delegate
- {
- MainControl.NavigateTo(new SupportConceptView(cb) {ParentView = this});
- //new SupportConceptView2(cb)
- // {
- // ParentView = this
- // });
- }));
- }
- }
- }
-
- private void listboxTasks_MouseDoubleClick(object sender, MouseButtonEventArgs e)
- {
- if (!IsPartOf(e.OriginalSource, typeof (ScrollBar)))
- {
- if (((ListBox) sender).SelectedItem is SchedulerAppointmentDC sc && sc.IsTask && sc.SupportConceptList.Count == 1 &&
- (BeWoApp.LoggedOnUser.HasRight(UserRightType.SupportConcept_ViewAllSupportConcepts) ||
- BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll) ||
- BeWoApp.LoggedOnUser.HasRight(UserRightType.SupportConceptView_View)))
- {
- VMFactory.CreateSupportConceptVMAsync(
- sc.SupportConceptList.First().SupportConceptOid,
- cb => this.Dispatch(
- delegate
- {
- MainControl.NavigateTo(
- new SupportConceptView(cb, sc)
- {
- ParentView = this
- });
- //new SupportConceptView2(cb)
- //{
- // ParentView = this
- //});
- }));
- }
- else if(((ListBox)sender).SelectedItem is SchedulerAppointmentDC sc2 && !sc2.IsTask &&
- (BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderAnsehen) ||
- BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll)) && sc2.StartDate.HasValue)
- {
- MainControl.NavigateTo(new SchedulerMasterView(sc2.StartDate.Value, sc2) { ParentView = this});
- }
- }
- }
-
- // private void FillOutbox()
- // {
- // if (BeWoApp.LoggedOnUser.Employee != null)
- // {
- // BeWo.ServiceProxy.ServiceFacade.DoMailServiceAsync(
- // s => s.GetOutgoingMails(BeWoApp.LoggedOnUser.Employee.EmployeeOid),
- // result => this.Dispatcher.BeginInvoke(new Call(delegate()
- // {
- // outboxList.ItemsSource = result;
- // }))
- // );
-
- // }
- // }
-
- // private void FillInbox()
- // {
- // if (BeWoApp.LoggedOnUser.Employee != null)
- // {
-
- // BeWo.ServiceProxy.ServiceFacade.DoMailServiceAsync(
- // s => s.GetIncomingMails(BeWoApp.LoggedOnUser.Employee.EmployeeOid),
- // result => this.Dispatcher.BeginInvoke(new Call(delegate()
- // {
- // text.Text = GenerateMailText(result);
- // inboxList.ItemsSource = result;
- // }))
- // );
- // }
- // }
-
- // delegate void Call();
-
- // private static string GenerateMailText(List result)
- // {
- // //var builder = new StringBuilder();
-
- // //var unreadMails = result.Where(r => r.Status == null || r.Status == Status.unread).Count();
- // //builder.AppendLine("Sie haben " + unreadMails + "/" + result.Count + " Mails");
-
- // //foreach (var item in result)
- // //{
- // // builder.AppendLine(item.Subject);
- // //}
-
- // //return builder.ToString();
-
- // var unreadMails = result.Where(r => r.Status == null || r.Status == Status.unread).Count();
- // return "Sie haben " + unreadMails + "/" + result.Count + " Mails";
-
- // }
-
- // private void ButtonNew_Click(object sender, RoutedEventArgs e)
- // {
- // OpenSendMailView();
- // // throw new NotImplementedException();
- // }
-
- // private void OpenSendMailView()
- // {
- // BeWoApp.MainControl.NavigateTo(new SendMailView() { ParentView = this });
- // //throw new NotImplementedException();
- // }
-
- // private void ButtonReplyNew_Click(object sender, RoutedEventArgs e)
- // {
- // if (boxTabControl.SelectedIndex == 0)
- // {
- // if (inboxList.SelectedIndex < 0)
- // {
- // MessageBox.Show("Sie haben keine Nachricht ausgewählt");
- // return;
- // }
-
- // var mailDC = inboxList.SelectedItem as MailDC;
-
- // BeWoApp.MainControl.NavigateTo(new SendMailView(SendMailView.Mode.Reply, mailDC));
- // }
- // else
- // {
- // MessageBox.Show("Sie können nicht auf Ihre eigene Mail antworten");
- // }
- // }
-
- // private void ButtonForward_Click(object sender, RoutedEventArgs e)
- // {
- // if (boxTabControl.SelectedIndex == 0)
- // {
- // if (inboxList.SelectedIndex < 0)
- // {
- // MessageBox.Show("Sie haben keine Nachricht ausgewählt");
- // return;
- // }
-
- // var mailDC = inboxList.SelectedItem as MailDC;
-
- // BeWoApp.MainControl.NavigateTo(new SendMailView(SendMailView.Mode.Forward, mailDC));
- // }
- // else
- // {
- // MessageBox.Show("Sie können Ihre eigene Mail nicht wieterleiten");
- // }
- // }
-
- // private void ButtonDelete_Click(object sender, RoutedEventArgs e)
- // {
- // if (boxTabControl.SelectedIndex == 0)
- // {
- // if (inboxList.SelectedIndex < 0)
- // {
- // MessageBox.Show("Sie haben keine Nachricht ausgewählt");
- // return;
- // }
-
- // var mailDC = inboxList.SelectedItem as MailDC;
-
- // BeWo.ServiceProxy.ServiceFacade.DoMailServiceAsync(s => s.DeleteMail(BeWoApp.LoggedOnUser.Employee.EmployeeOid, mailDC));
-
- // //inboxList.ItemsSource.RemoveAt(inboxList.SelectedIndex);
- // FillInbox();
- // }
- // else
- // {
- // MessageBox.Show("Outbox funktioniert noch nicht");
-
- // //BeWo.ServiceProxy.ServiceFacade.DoMailServiceAsync(s => s.DeleteMail(BeWoApp.LoggedOnUser.Employee.EmployeeOid, outboxList.SelectedItem as MailDC);
- // }
-
- // //throw new NotImplementedException();
- // }
-
- // private void InboxItem_DoubleClick(object sender, RoutedEventArgs e)
- // {
- // var listboItem = sender as ListBoxItem;
- // var content = listboItem.Content as MailDC;
-
- // MainControl.NavigateTo(new ViewMailView(content) { ParentView = this });
-
- // //throw new NotImplementedException();
- // }
-
- // private void OutboxItem_DoubleClick(object sender, RoutedEventArgs e)
- // {
- // var listboItem = sender as ListBoxItem;
- // var content = listboItem.Content as MailDC;
-
- // MainControl.NavigateTo(new ViewMailView(content) { ParentView = this });
- // }
- private void Hyperlink_OnRequestNavigate(object sender, RequestNavigateEventArgs e)
- {
- Process.Start(new ProcessStartInfo((sender as Hyperlink).NavigateUri.ToString()));
- }
-
- private delegate void loadFeed(string url);
-
- private void PasswortAendernLinkOnRequestNavigate(object sender, RequestNavigateEventArgs e)
- {
- var pav = new PasswortAenderungsView();
- pav.ShowDialog();
- }
-
- private void LinkNewDatenschutz_OnRequestNavigate(object sender, RequestNavigateEventArgs e)
- {
- Process.Start(new ProcessStartInfo((sender as Hyperlink)?.NavigateUri.ToString()));
- }
-
-
- private void BtnCreateNewsItem_OnClick(object sender, RoutedEventArgs e)
- {
- TeamNewsItemVM teamVm = ((Button) sender).Tag as TeamNewsItemVM;
- if (teamVm != null)
- {
- NewsItemDC dc = new NewsItemDC();
- dc.PublishDate = DateTime.Now;
- dc.Team = teamVm.Team;
-
- NewsItemVM vm = new NewsItemVM(dc);
- var ctrl = new NewsItemEditControl(vm);
-
- BeWoWindow window = BeWoWpfUtils.CreateBeWoPopupWindow(400, 500);
- window.GroupBoxContent = ctrl;
- window.Height = 400;
- window.Owner = BeWoApp.CurrentBeWo.MainWindow;
- //ThemeManager.SetTheme(window, Theme.Office2010Black);
-
- ctrl.CancelButtonClicked += window.Close;
- ctrl.OkButtonClicked += () =>
- {
- SaveNewsItem(vm);
- window.Close();
- };
-
-
- window.rootGroupBox.Header = "Neuer Eintrag";
- window.Title = "Neuer Eintrag";
- window.Show();
-
- }
- }
-
- private void SaveNewsItem(NewsItemVM vm)
- {
- ServiceFacade.DoEmployeeServiceSync(s => s.InsertNewNewsItem(vm.CommitToDataContract()));
- UpdateInternalNews();
- }
-
-
- private void BtnEditNewsItem_OnClick(object sender, RoutedEventArgs e)
- {
- NewsItemDC dc = ((Button) sender).Tag as NewsItemDC;
- if (dc != null)
- {
- NewsItemVM vm = new NewsItemVM(dc);
- var ctrl = new NewsItemEditControl(vm);
-
- BeWoWindow window = BeWoWpfUtils.CreateBeWoPopupWindow(400, 500);
- window.GroupBoxContent = ctrl;
- window.Height = 400;
- window.Owner = BeWoApp.CurrentBeWo.MainWindow;
- //ThemeManager.SetTheme(window, Theme.Office2010Black);
- ctrl.CancelButtonClicked += window.Close;
- ctrl.OkButtonClicked += () =>
- {
- UpdateNewsItem(vm);
- window.Close();
- };
-
- window.rootGroupBox.Header = "Eintrag bearbeiten";
- window.Title = "Eintrag bearbeiten";
- window.Show();
-
- }
- }
-
- private void UpdateNewsItem(NewsItemVM vm)
- {
- ServiceFacade.DoEmployeeServiceSync(s => s.UpdateNewsItem(vm.CommitToDataContract()));
- UpdateInternalNews();
- }
-
- private void BtnDeleteNewsItem_OnClick(object sender, RoutedEventArgs e)
- {
- NewsItemDC dc = ((Button) sender).Tag as NewsItemDC;
- if (dc != null)
- {
- if (MessageBox.Show("Wollen Sie den Eintrag '" + dc.Title + "' wirklich löschen?", "Löschen bestätigen",
- MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
- {
- ServiceFacade.DoEmployeeServiceSync(
- s => s.DeleteNewsItem(dc.NewsItemOid.Value, dc.NewsItemVersion.Value));
-
- UpdateInternalNews();
- }
- }
- }
-
- //####### Connection with Server ###########
-
- public ChatView ServiceChatView;
-
- private async void HyperlinkChat_OnRequestNavigate(object sender, RequestNavigateEventArgs e)
- {
-
-//#if DEBUG
-// var kundennummer = "5473568546";
-// //var apikey = "0b50c09aff87f20d9ced75340e04e5ccaa11dd3e7bcf25e9c4f94dc20d3cbb97";
-
-// Login _login = new Login(kundennummer, "kihqx-PiGka", "cb", "bewo", "0b50c09aff87f20d9ced75340e04e5ccaa11dd3e7bcf25e9c4f94dc20d3cbb97");
-
-// var x = _login.AnmeldevorgangDurchFuehren();
-
-// ServiceChatView = new ChatView(x);
-// ServiceChatView.Show();
-//#else
-
- if (ServiceChatView == null)
- {
-#if DEBUG
- if (true)
- {
- string _Code = "8ycX9-ZWbyJ";
- string _kundennummer = "5473568546";
- string _benutzername = "cb";
- string _passwort = "bewo";
- string _apikey;
-#else
-
- var empAppCodes = ServiceFacade.DoEmployeeServiceSync(r=>r.GetAllEmployeeAppCodes(BeWoApp.LoggedOnUser.Employee.EmployeeOid));
-
- if (empAppCodes != null && empAppCodes.Count > 0)
- {
- string _Code = "";
- foreach (var item in empAppCodes)
- {
- if(item.EmployeeCode != null && !item.EmployeeCode.Equals(""))
- _Code = item.EmployeeCode;
- }
-
- //var xxx = empAppCodes.Last();
-
- string _kundennummer = BeWoApp.Tenant;
-
- string _benutzername = BeWoApp.UserName;
- string _passwort = BeWoApp.UserPassword;
- string _apikey;
-#endif
- //string _ChatCode = "";
- //if (xxx.EmployeeCode != null && !xxx.EmployeeCode.Equals(""))
- //{
- // _ChatCode = xxx.EmployeeCode;
- //}
-
- _apikey = BeWoApp.Mandator.Apikey ?? "0000";
-
- if (!_Code.Equals(""))
- {
- //Login _login = new Login(_kundennummer, _Code, _benutzername, _passwort, _apikey);
-
- //var x = _login.AnmeldevorgangDurchFuehren();
-
- //if (x != null)
- //{
- // ServiceChatView = new ChatView(x);
- // ServiceChatView.Show();
- //}
- }
- else
- {
- MessageBox.Show("Sie benötigen einen gültigen Chat-Code.", "Info");
- }
- }
- else
- {
- MessageBox.Show("Sie benötigen einen gültigen Zugang zum Chat. Bitte wenden Sie sich an den Support.", "Info");
- }
- }
- //else if (ServiceChatView.Visibility == Visibility.Visible)
- //{
- // ServiceChatView.Visibility = Visibility.Hidden;
- //}
- //else if (ServiceChatView.Visibility == Visibility.Hidden)
- //{
- // ServiceChatView.Visibility = Visibility.Visible;
-
- // if (ServiceChatView.WindowState == WindowState.Minimized)
- // {
- // ServiceChatView.WindowState = WindowState.Normal;
- // ServiceChatView.Height = 700;
- // ServiceChatView.Width = 900;
- // }
-
- // ServiceChatView.Activate();
- //}
-//#endif
- }
-
- private void ShowAppointmentRequests(object sender, RequestNavigateEventArgs e)
- {
- Scheduler.ShowAppointmentRequests(sender, e);
- }
-
- public void UpdateRequestsHyperLink()
- {
- if(Scheduler != null)
- {
- Scheduler.UpdateRequestString();
-
- RequestsHyperLinkTextBlock.Text = Scheduler.Requests;
- RequestsHyperlink.IsEnabled = Scheduler.Enabled;
- RequestsTextBlock.IsEnabled = Scheduler.Enabled;
- }
- }
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- [NotifyPropertyChangedInvocator]
- protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
-
- private CompactEmployeeDC _SelectedEmployeeForAppointments;
- private void EmployeeFilterBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- if(e?.AddedItems?.Count > 0 && _IsShowingAppointments)
- {
- _SelectedEmployeeForAppointments = (CompactEmployeeDC) e.AddedItems[0];
- LoadTasksAndAppointments(false, true);
- }
- }
-
- private void CreateTestAppointmentsButtonOnClick(object sender, RoutedEventArgs e)
- {
- ServiceFacade.DoResourceServiceAsync(s =>
- {
- if(BeWoApp.LoggedOnEmployeeOid != null)
- {
- s.InsertTestAppointments(BeWoApp.LoggedOnEmployeeOid.Value);
-
- this.Dispatch(() =>
- {
- LoadTasksAndAppointments(false, true);
- });
- }
- });
- }
-
- private void DeleteTestAppointmentsButtonOnClick(object sender, RoutedEventArgs e)
- {
- ServiceFacade.DoResourceServiceAsync(s =>
- {
- if(BeWoApp.LoggedOnEmployeeOid != null)
- {
- s.DeleteTestAppointments();
-
- this.Dispatch(() =>
- {
- LoadTasksAndAppointments(false, true);
- });
- }
- });
- }
- }
-
- public class TaskDateDescriptionConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value is SchedulerAppointmentDC task)
- {
- if (task.CompletedDate.HasValue)
- {
- return $"erledigt am: {task.CompletedDate:d}";
- }
-
- if(task.DueDate.HasValue && task.DueDate.Equals(DateTime.MaxValue))
- {
- return string.Empty;
- }
-
- if (task.DueDate.HasValue)
- {
- return string.Format("bis {0:d} {0:t}", task.DueDate);
- }
-
- if(task.StartDate.HasValue)
- {
- return task.AllDay ? $"{task.StartDate:d}" : $"{task.StartDate:d} {task.StartDate:t}";
- }
- }
- return string.Empty;
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
- }
-
- public class TaskListItemBackgroundConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if(value is SchedulerAppointmentDC task && !task.IsTask)
- {
- if(parameter != null)
- {
- switch(parameter.ToString())
- {
- case "ResourceBackgroundBrush":
- return task.ResourceList?.Count > 0 ? task.ResourceList.First().GetBrush() : new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
- case "CustomerBackgroundBrush":
- return new SolidColorBrush(task.CustomerList?.Count > 0 ? Color.FromRgb(59, 119, 153) : Color.FromArgb(0, 0, 0, 0));
- case "EmployeeBackgroundBrush":
- return task.EmployeeList?.Count > 0 ? task.EmployeeList.First().Employee.FilterableBrush : task.Originator?.FilterableBrush ?? new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
- }
- }
-
- return new LinearGradientBrush(Color.FromRgb(192, 255, 208), Color.FromRgb(192, 255, 208), new Point(0, 0), new Point(1, 1));
- }
-
- return new LinearGradientBrush(Color.FromRgb(153, 59, 59), Color.FromRgb(92, 25, 25), new Point(0, 0), new Point(0, 1));
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
-
- public class BorderCornerRadiusConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- var fallbackCornerRadius = new CornerRadius(0, 5, 5, 0);
-
- if(value is SchedulerAppointmentDC appointment && !appointment.IsTask && parameter != null)
- {
- switch(parameter.ToString())
- {
- case "Customers":
- return appointment.CustomerList?.Count > 0 && appointment.ResourceList?.Count > 0 ? new CornerRadius(0, 5, 0, 0) : fallbackCornerRadius;
- case "Resources":
- return appointment.CustomerList?.Count > 0 && appointment.ResourceList?.Count > 0 ? new CornerRadius(0, 0, 5, 0) : fallbackCornerRadius;
- default:
- return fallbackCornerRadius;
- }
- }
-
- return fallbackCornerRadius;
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
- }
-
- public class TaskListItemForegroundConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if(value is SchedulerAppointmentDC task && !task.IsTask)
- {
- return new SolidColorBrush(Color.FromRgb(0, 0, 0));
- }
-
- return new SolidColorBrush(Color.FromRgb(201, 210, 210));
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
-
- public class TaskAppointmentVisibilityConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if(value is SchedulerAppointmentDC taskAppointment)
- {
- switch(parameter?.ToString())
- {
- case "ToolTipTimeVisibility":
- return taskAppointment.IsTask || taskAppointment.AllDay ? Visibility.Collapsed : Visibility.Visible;
- case "ToolTipTrennstrichVisibility":
- return !taskAppointment.IsTask && (taskAppointment.EmployeeList?.Count > 0 || taskAppointment.CustomerList?.Count > 0 || taskAppointment.ResourceList?.Count > 0) ? Visibility.Visible : Visibility.Collapsed;
- case "ToolTipResourcesVisibility":
- return !taskAppointment.IsTask && taskAppointment.ResourceList?.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
- case "ToolTipEmployeesVisibility":
- return !taskAppointment.IsTask && taskAppointment.EmployeeList?.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
- case "ToolTipCustomersVisibility":
- return !taskAppointment.IsTask && taskAppointment.CustomerList?.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
- case "ToolTipZusageVisibility":
- return !taskAppointment.IsTask ? Visibility.Visible : Visibility.Collapsed;
- case "ToolTipCustomerColorVisibility":
- return !taskAppointment.IsTask && taskAppointment.CustomerList?.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
- case "ToolTipResourcesColorVisibility":
- return !taskAppointment.IsTask && taskAppointment.ResourceList?.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
- case "CustomerBorderVisibility":
- return !taskAppointment.IsTask && taskAppointment.CustomerList?.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
- case "ResourceBorderVisibility":
- return !taskAppointment.IsTask && taskAppointment.ResourceList?.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
- case"EmployeeBorderVisibility":
- return !taskAppointment.IsTask && taskAppointment.EmployeeList?.Count > 0 ||taskAppointment.Originator != null ? Visibility.Visible : Visibility.Collapsed;
- }
- }
-
- return Visibility.Collapsed;
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
- }
-
- public class TaskAppointmentToolTipConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if(value is SchedulerAppointmentDC taskAppointment)
- {
- if(!taskAppointment.IsTask)
- {
- var custoemrs = taskAppointment.CustomerList;
- var resources = taskAppointment.ResourceList;
- var toolTip = string.Empty;
- var seperator = "; ";
- var selection = new List();
- var isResourceOrCustomer = false;
-
- switch (parameter?.ToString())
- {
- case "TimeText":
- return $"{taskAppointment.StartDate?.ToString("HH:mm")} - {taskAppointment.EndDate?.ToString("HH:mm")} Uhr";
- case "ToolTip":
- return taskAppointment.Subject;
- case "Resources":
- isResourceOrCustomer = true;
- seperator = ", ";
- if (resources != null)
- {
- selection = resources.Cast().ToList();
- }
- break;
- case "Employees":
- return taskAppointment.EmployeeList;
- case "Customers":
- isResourceOrCustomer = true;
- if (custoemrs != null)
- {
- selection = custoemrs.Cast().ToList();
- }
- break;
- }
-
- if(isResourceOrCustomer)
- {
- foreach (var item in selection)
- {
- var index = selection.IndexOf(item);
-
- if (index % 3 == 0 && index < selection.Count - 1 && index > 0)
- {
- toolTip += "\n";
- }
-
- toolTip += item.ToString();
-
- if (index < selection.Count - 1)
- {
- toolTip += seperator;
- }
- }
-
- return toolTip;
- }
- }
- else
- {
- switch(parameter?.ToString())
- {
- case "TimeText":
- return string.Empty;
- }
- }
-
- if(parameter != null && parameter.Equals("ToolTip"))
- {
- return taskAppointment.IsTask ? taskAppointment.TaskDescription : taskAppointment.Description;
- }
- }
-
- return null;
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
- }
-
- public class BorderHeightConverter : IMultiValueConverter
- {
- public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
- {
- const double fallbackValue = 0d;
-
- if(values.Length == 2)
- {
- var actualHeight = (double) values[0];
- var appointment = (SchedulerAppointmentDC) values[1];
-
- var newHeight = appointment?.CustomerList?.Count > 0 && appointment.ResourceList?.Count > 0 ? actualHeight / 2 : actualHeight;
-
- return newHeight;
- }
-
- return fallbackValue;
- }
-
- public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException();
- }
-
- public struct RecurringAppointment
- {
- public string RecurrenceId { get; set;}
- public Dictionary Occurrences { get; set; }
- public SchedulerAppointmentDC Pattern { get; set;}
-
- public RecurringAppointment(string pRecurrenceId, Dictionary pOccurrences, SchedulerAppointmentDC pPattern)
- {
- RecurrenceId = pRecurrenceId;
- Occurrences = pOccurrences;
- Pattern = pPattern;
- }
- }
-}
\ No newline at end of file
diff --git a/BeWo/View/Master/AdministrationView.xaml b/BeWo/View/Master/AdministrationView.xaml
index 0d907b87a..b2909ada0 100644
--- a/BeWo/View/Master/AdministrationView.xaml
+++ b/BeWo/View/Master/AdministrationView.xaml
@@ -1,6 +1,7 @@

+ Width="32">
@@ -23,9 +24,9 @@
+ Foreground="{DynamicResource MainGroupBoxForegroundBrush}" FontSize="22"
+ BorderBrush="{x:Null}" VerticalAlignment="Stretch" Padding="0,0,0,0"
+ BorderThickness="0,0,0,0" />
@@ -36,61 +37,88 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Background="#FF000000">
+
+ Height="Auto" Margin="0,5,5,0" HorizontalAlignment="Right">
+ Height="25" />
+ Height="25" />
diff --git a/BeWo/View/Master/AdministrationView.xaml.cs b/BeWo/View/Master/AdministrationView.xaml.cs
index 25dc6a183..ca83d6115 100644
--- a/BeWo/View/Master/AdministrationView.xaml.cs
+++ b/BeWo/View/Master/AdministrationView.xaml.cs
@@ -1,7 +1,10 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
+using System.Windows.Media;
+using BeWo.Data.Entities;
using BeWo.SchulbegleitenderDienst.View;
using BS.Shared;
using BS.Shared.Extensions;
@@ -10,458 +13,330 @@ using BeWo.ServiceProxy;
using BeWo.View.Detail;
using BeWo.ViewModel;
using BeWo.ViewModel.ListViewModel;
+using DevExpress.Xpf.Accordion;
namespace BeWo.View.Master
{
- public partial class AdministrationView
- {
- private readonly Dictionary _OpenViews = new Dictionary();
+ public partial class AdministrationView
+ {
+ #region Fields
- private bool _SavePerformed;
+ private readonly Dictionary _OpenViews = new Dictionary();
- public AdministrationView()
- {
- InitializeComponent();
+ private BeWoView _SelectedView;
- // HACK: Force the devexpress grid to end editing when the mouse is over savebutton
- // by setting the focus to another element.
- MouseMove += (s, e) =>
- {
- Point p = e.GetPosition(btnSave);
+ #endregion
- if (p.X >= 0 && p.X < btnSave.ActualWidth && p.Y >= 0 && p.Y < btnSave.ActualHeight)
- {
- root.Focus();
- }
- };
+ #region Konstruktor
- if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.AssessmentSheet_View))
- {
- tabitem_assessmentSheetValues.Visibility = Visibility.Collapsed;
- tabitem_assessmentSheetCategories.Visibility = Visibility.Collapsed;
- }
+ public AdministrationView()
+ {
+ InitializeComponent();
+ //GenerateNewView(TabitemMandator);
+ Root.SelectedItem = TabitemMandator;
- if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.AdditionalService_View))
- {
- tabitem_additionalServices.Visibility = Visibility.Collapsed;
- tabitem_additionalServiceRegions.Visibility = Visibility.Collapsed;
- }
+ MouseMove += (s, e) =>
+ {
+ var p = e.GetPosition(btnSave);
- tabitem_auszahlungsarten.Visibility = BeWoApp.LoggedOnUser.HasRight(UserRightType.OvertimeView) ? Visibility.Visible : Visibility.Collapsed;
+ if (p.X >= 0 && p.X < btnSave.ActualWidth && p.Y >= 0 && p.Y < btnSave.ActualHeight)
+ {
+ Root.Focus();
+ }
+ };
- if (!BeWoApp.AppSettings.IsMedicationAllowed)
- {
- tabitem_medikamentenarten.Visibility = Visibility.Collapsed;
- }
+ #region Rechte
+ if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.AssessmentSheet_View))
+ {
+ TabitemAssessmentSheetValues.Visibility = Visibility.Collapsed;
+ TabitemAssessmentSheetCategories.Visibility = Visibility.Collapsed;
+ }
- if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.TextbausteineAlleAnsehen) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.TextbausteineAlleBearbeiten))
- {
- tabitem_textbausteine.Visibility = Visibility.Collapsed;
- }
+ if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.AdditionalService_View))
+ {
+ TabitemAdditionalServices.Visibility = Visibility.Collapsed;
+ TabitemAdditionalServiceRegions.Visibility = Visibility.Collapsed;
+ }
- if (BeWoApp.Mandator != null && BeWoApp.Mandator.AllowSbd)
- {
- tabitem_sbd.Visibility = Visibility.Visible;
- }
- else
- {
- tabitem_sbd.Visibility = Visibility.Collapsed;
- }
+ TabitemAuszahlungsarten.Visibility = BeWoApp.LoggedOnUser.HasRight(UserRightType.OvertimeView)
+ ? Visibility.Visible
+ : Visibility.Collapsed;
+
+ if (!BeWoApp.AppSettings.IsMedicationAllowed)
+ {
+ TabitemMedikamentenarten.Visibility = Visibility.Collapsed;
+ }
+
+ if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.TextbausteineAlleAnsehen) &&
+ !BeWoApp.LoggedOnUser.HasRight(UserRightType.TextbausteineAlleBearbeiten))
+ {
+ TabitemTextbausteine.Visibility = Visibility.Collapsed;
+ }
+
+ if (BeWoApp.Mandator != null && BeWoApp.Mandator.AllowSbd)
+ {
+ TabitemSbd.Visibility = Visibility.Visible;
+ }
+ else
+ {
+ TabitemSbd.Visibility = Visibility.Collapsed;
+ }
+ #endregion
}
- public override bool IsDirty
- {
- get
- {
- return _OpenViews.ContainsKey(root.SelectedItem as TabItem) && _OpenViews[root.SelectedItem as TabItem].IsDirty;
- }
- }
+ #endregion
- internal override DependencyObject ValidationOnSaveRootElement
- {
- get { return _OpenViews[root.SelectedItem as TabItem].ValidationOnSaveRootElement; }
- }
+ #region Events
- internal override bool DoSaveCheck()
- {
- var item = root.SelectedItem as TabItem;
- if (item != null && _OpenViews.ContainsKey(item))
- {
- var lDoSave = _OpenViews[root.SelectedItem as TabItem].DoSaveCheck();
+ private void Tabitem_Selected(object sender, RoutedEventArgs e)
+ {
+ if (!(sender is AccordionItem selectedAccordionItem))
+ return;
- if (lDoSave && IsDirty)
- {
- _SavePerformed = true;
- _OpenViews.Remove(root.SelectedItem as TabItem);
- }
+ if (_OpenViews.ContainsKey(selectedAccordionItem))
+ SetView(_OpenViews[selectedAccordionItem]);
+ else
+ GenerateNewView(selectedAccordionItem);
+ }
- return lDoSave;
- }
+ #endregion
- return true;
- }
+ #region Propeties
- protected override void Save()
- {
- _OpenViews[root.SelectedItem as TabItem].SaveData();
- _SavePerformed = true;
- }
+ public override bool IsDirty => SelectedView != null &&
+ SelectedView.IsDirty;
- private void AddView(TabItem pTabItem, BeWoView pView)
- {
- _OpenViews[pTabItem] = pView;
- pTabItem.Content = pView;
- pView.VerticalAlignment = VerticalAlignment.Top;
+ public BeWoView SelectedView
+ {
+ get => _SelectedView;
+ set
+ {
+ if (value == null) return;
+
+ _SelectedView = value;
+ ContentBorder.Child = value;
+ }
+ }
+
+ internal override DependencyObject ValidationOnSaveRootElement =>
+ SelectedView.ValidationOnSaveRootElement;
+
+ #endregion
+
+ #region Methoden
+
+ internal override bool DoSaveCheck()
+ {
+ if (!(Root.SelectedItem is AccordionItem item) || !_OpenViews.ContainsKey(item)) return true;
+
+ var lDoSave = SelectedView.DoSaveCheck();
+
+ if (!lDoSave || !IsDirty) return lDoSave;
+
+ _OpenViews.Remove((AccordionItem)Root.SelectedItem);
+
+ return true;
+ }
+
+ protected override void Save()
+ {
+ SelectedView.SaveData();
+ }
+
+ private void AddView(AccordionItem pTabItem, BeWoView pView)
+ {
+ pView.VerticalAlignment = VerticalAlignment.Top;
if (ActualHeight > 120 && !(pView is MandatorView))
{
- pView.MaxHeight = ActualHeight - 120;
- }
+ pView.MaxHeight = ActualHeight - 120;
+ }
- _SavePerformed = false;
- }
+ _OpenViews.Add(pTabItem, pView);
+ SetView(pView);
+ }
- private void root_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
- {
- var lTabItem = e.Source as TabItem;
- if (lTabItem == null || Equals(root.SelectedItem, lTabItem))
- {
- return;
- }
+ private void SetView(BeWoView newView)
+ {
+ if (newView == null || Equals(newView, SelectedView)) return;
- if (_OpenViews[root.SelectedItem as TabItem].IsDirty)
- {
- if (DoSaveCheck())
- {
- lTabItem.IsSelected = true;
- }
- else
- {
- e.Handled = true;
- }
- }
- }
+ newView.Margin = new Thickness(0);
- //private void tabitem_InvoiceNumber_Selected(object sender, RoutedEventArgs e)
- //{
- // if (!this._OpenViews.ContainsKey(this.tabitem_InvoiceNumber) || this._SavePerformed)
- // {
- // VMFactory.CreateInvoiceNumberVMAsync(r => this.Dispatch(delegate { this.AddView(this.tabitem_InvoiceNumber, new InvoiceNumberView(r)); }));
- // }
- //}
+ if (ContentBorder.Child == null)
+ SelectedView = newView;
+ else if (DoSaveCheck())
+ SelectedView = newView;
+ }
- private void tabitem_absenceCategories_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_absenceCategories) || _SavePerformed)
- {
- VMFactory.CreateAbsenceReasonListVMAsync(r => this.Dispatch(() => AddView(tabitem_absenceCategories, new AbsenceReasonView(r))));
- }
- }
+ private void GenerateNewView(AccordionItem accordionItem)
+ {
+ if (accordionItem == null)
+ return;
- private void tabitem_activityFocus_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_activityFocus) || _SavePerformed)
- {
- VMFactory.CreateValueListVMAsync(ValueListEntryType.StaffActivityFocusType, r => this.Dispatch(() => AddView(tabitem_activityFocus, new ValueListView(r))));
- }
- }
-
- private void tabitem_assessmentSheetCategories_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_assessmentSheetCategories) || _SavePerformed)
- {
- VMFactory.CreateAssessmentSheetCategoryListVM(m => this.Dispatch(() => AddView(tabitem_assessmentSheetCategories, new AssessmentSheetCategoryView(m))));
- }
- }
-
- private void tabitem_assessmentSheetValues_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_assessmentSheetValues) || _SavePerformed)
- {
- VMFactory.CreateAssessmentSheetValueListVM(m => this.Dispatch(() => AddView(tabitem_assessmentSheetValues, new AssessmentSheetValueView(m))));
- }
- }
-
- private void tabitem_customerCareTypes_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_customerCareTypes) || _SavePerformed)
- {
- VMFactory.CreateValueListVMAsync(ValueListEntryType.CustomerCareType, r => this.Dispatch(() => AddView(tabitem_customerCareTypes, new ValueListView(r))));
- }
- }
-
- private void tabitem_disablityTypes_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_disablityTypes) || _SavePerformed)
- {
- VMFactory.CreateValueListVMAsync(ValueListEntryType.DisabilityType, r => this.Dispatch(() => AddView(tabitem_disablityTypes, new ValueListView(r))));
- }
- }
-
- private void tabitem_employmentTypes_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_employmentTypes) || _SavePerformed)
- {
- VMFactory.CreateEmploymentTypeListVMAsync(r => this.Dispatch(() => AddView(tabitem_employmentTypes, new EmploymentTypeView(r))));
- }
- }
-
- private void tabitem_environmentRoles_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_environmentRoles) || _SavePerformed)
- {
- //VMFactory.CreateValueListVMAsync(ValueListEntryType.EnvironmentPersonType, r => this.Dispatch(delegate { this.AddView(this.tabitem_environmentRoles, new ValueListView(r)); }));
-
- VMFactory.CreateValueListVMAsync(ValueListEntryType.EnvironmentPersonType,
- personList => VMFactory.CreateValueListVMAsync(ValueListEntryType.RoleInOrganisationType,
- roleInOrgList => VMFactory.CreateValueListVMAsync(ValueListEntryType.EnvironmentOrganisationType,
- orgList => VMFactory.CreateValueListVMAsync(ValueListEntryType.RoleInFamily,
- roleInFamily => this.Dispatch(() => AddView(tabitem_environmentRoles,
- new EnvironmentRoleView(personList, orgList,roleInOrgList,roleInFamily)))))));
-
- }
- }
-
- private void tabitem_finazCategories_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_finazCategories) || _SavePerformed)
- {
- VMFactory.CreateValueListVMAsync(ValueListEntryType.AccountingTransactionType, r => this.Dispatch(() => AddView(tabitem_finazCategories, new ValueListView(r))));
- }
- }
-
- private void tabitem_functions_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_functions) || _SavePerformed)
- {
- //VMFactory.CreateValueListVMAsync(ValueListEntryType.FunctionType, r => this.Dispatch(() => AddView(tabitem_functions, new ValueListView(r))));
-
- VMFactory.CreateValueListVMAsync(ValueListEntryType.FunctionType,
- //personList => VMFactory.CreateValueListVMAsync(ValueListEntryType.RoleInOrganisationType,
- personFunctionList => VMFactory.CreateValueListVMAsync(ValueListEntryType.OrganisationFunctionType,
- orgFunctionList =>
- this.Dispatch(() => AddView(tabitem_functions, new EnvironmentRoleView(/*personList,*/ personFunctionList, orgFunctionList)))));
- }
- }
-
- private void tabitem_Nationality_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_Nationality) || _SavePerformed)
- {
- VMFactory.CreateValueListVMAsync(ValueListEntryType.Nationality,
- //personList => VMFactory.CreateValueListVMAsync(ValueListEntryType.RoleInOrganisationType,
+ switch (accordionItem.Name)
+ {
+ case nameof(TabitemMandator):
+ ServiceFacade.DoAccountingServiceAsync(s => s.LoadInvoiceNumber(),
+ iv => ServiceFacade.DoOperationsServiceAsync(
+ s => s.GetMandator(),
+ m =>
+ this.Dispatch(() => AddView(TabitemMandator,
+ new MandatorView(new MandatorVM(new InvoiceNumberVM(iv), m))))));
+ return;
+ case nameof(TabitemQualificationTypes):
+ VMFactory.CreateValueListVMAsync(ValueListEntryType.StaffQualificationsType,
+ r => this.Dispatch(() => AddView(TabitemQualificationTypes, new ValueListView(r))));
+ return;
+ case nameof(TabitemQualifikationsbedarf):
+ VMFactory.CreateValueListVMAsync(ValueListEntryType.QualifikationsBedarf,
+ r => this.Dispatch(() => AddView(TabitemQualifikationsbedarf, new ValueListView(r))));
+ return;
+ case nameof(TabitemAbsenceCategories):
+ VMFactory.CreateAbsenceReasonListVMAsync(r =>
+ this.Dispatch(() => AddView(TabitemAbsenceCategories, new AbsenceReasonView(r))));
+ return;
+ case nameof(TabitemDisablityTypes):
+ VMFactory.CreateValueListVMAsync(ValueListEntryType.DisabilityType,
+ r => this.Dispatch(() => AddView(TabitemDisablityTypes, new ValueListView(r))));
+ return;
+ case nameof(TabitemEmploymentTypes):
+ VMFactory.CreateEmploymentTypeListVMAsync(r =>
+ this.Dispatch(() => AddView(TabitemEmploymentTypes, new EmploymentTypeView(r))));
+ return;
+ case nameof(TabitemCustomerCareTypes):
+ VMFactory.CreateValueListVMAsync(ValueListEntryType.CustomerCareType,
+ r => this.Dispatch(() => AddView(TabitemCustomerCareTypes, new ValueListView(r))));
+ return;
+ case nameof(TabitemTerminationReasons):
+ VMFactory.CreateValueListVMAsync(ValueListEntryType.TerminationReasonType,
+ r => this.Dispatch(() => AddView(TabitemTerminationReasons, new ValueListView(r))));
+ return;
+ case nameof(TabitemPlacementObjectives):
+ VMFactory.CreateValueListVMAsync(ValueListEntryType.PlacementObjectiveType,
+ r => this.Dispatch(() => AddView(TabitemPlacementObjectives, new ValueListView(r))));
+ return;
+ case nameof(TabitemTitles):
+ VMFactory.CreateValueListVMAsync(ValueListEntryType.TitleType,
+ r => this.Dispatch(() => AddView(TabitemTitles, new ValueListView(r))));
+ return;
+ case nameof(TabitemFunctions):
+ VMFactory.CreateValueListVMAsync(ValueListEntryType.FunctionType,
+ personFunctionList => VMFactory.CreateValueListVMAsync(
+ ValueListEntryType.OrganisationFunctionType,
+ orgFunctionList =>
+ this.Dispatch(() => AddView(TabitemFunctions,
+ new EnvironmentRoleView(personFunctionList, orgFunctionList)))));
+ return;
+ case nameof(TabitemNationality):
+ VMFactory.CreateValueListVMAsync(ValueListEntryType.Nationality,
natList =>
- this.Dispatch(() => AddView(tabitem_Nationality, new NationalityView(natList))));
- }
- }
-
- private void tabitem_Aufenthaltsstatus_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_Aufenthaltsstatus) || _SavePerformed)
- {
- VMFactory.CreateValueListVMAsync(ValueListEntryType.Aufenthaltsstatus,
- //personList => VMFactory.CreateValueListVMAsync(ValueListEntryType.RoleInOrganisationType,
+ this.Dispatch(() => AddView(TabitemNationality, new NationalityView(natList))));
+ return;
+ case nameof(TabitemAufenthaltsstatus):
+ VMFactory.CreateValueListVMAsync(ValueListEntryType.Aufenthaltsstatus,
orgList =>
- this.Dispatch(() => AddView(tabitem_Aufenthaltsstatus, new AufenthaltsView(orgList))));
- }
- }
+ this.Dispatch(() => AddView(TabitemAufenthaltsstatus, new AufenthaltsView(orgList))));
+ return;
+ case nameof(TabitemFinazCategories):
+ VMFactory.CreateValueListVMAsync(ValueListEntryType.AccountingTransactionType,
+ r => this.Dispatch(() => AddView(TabitemFinazCategories, new ValueListView(r))));
+ return;
+ case nameof(TabitemServiceCategories):
+ VMFactory.CreateServiceCategoryListVMAsync(r =>
+ this.Dispatch(() => AddView(TabitemServiceCategories, new ServiceCategoryView(r))));
+ return;
+ case nameof(TabitemServiceDescriptions):
+ VMFactory.CreateServiceDescriptionListVMAsync(r =>
+ this.Dispatch(() => AddView(TabitemServiceDescriptions, new ServiceDescriptionView(r))));
+ return;
+ case nameof(TabitemTextbausteine):
+ VMFactory.CreateTextModuleListVMAsync(
+ r => this.Dispatch(() => AddView(TabitemTextbausteine, new TextbausteinView(r, true))), true,
+ true);
+ return;
+ case nameof(TabitemMedikamentenarten):
+ VMFactory.CreateMedArtListVMAsync(r =>
+ this.Dispatch(() => AddView(TabitemMedikamentenarten, new MedikamentenartenView(r))));
+ return;
+ case nameof(TabitemRoles):
+ VMFactory.CreateValueListVMAsync(ValueListEntryType.StaffRoleType,
+ r => this.Dispatch(() => AddView(TabitemRoles, new ValueListView(r))));
+ return;
+ case nameof(TabitemEnvironmentRoles):
+ VMFactory.CreateValueListVMAsync(ValueListEntryType.EnvironmentPersonType,
+ personList => VMFactory.CreateValueListVMAsync(ValueListEntryType.RoleInOrganisationType,
+ roleInOrgList => VMFactory.CreateValueListVMAsync(
+ ValueListEntryType.EnvironmentOrganisationType,
+ orgList => VMFactory.CreateValueListVMAsync(ValueListEntryType.RoleInFamily,
+ roleInFamily => this.Dispatch(() => AddView(TabitemEnvironmentRoles,
+ new EnvironmentRoleView(personList, orgList, roleInOrgList, roleInFamily)))))));
+ return;
+ case nameof(TabitemActivityFocus):
+ VMFactory.CreateValueListVMAsync(ValueListEntryType.StaffActivityFocusType,
+ r => this.Dispatch(() => AddView(TabitemActivityFocus, new ValueListView(r))));
+ return;
+ case nameof(TabitemResourceCategories):
+ VMFactory.CreateValueListVMAsync(ValueListEntryType.ResourceCategory,
+ r => this.Dispatch(() => AddView(TabitemResourceCategories, new ValueListView(r))));
+ return;
+ case nameof(TabitemResources):
+ VMFactory.CreateResourceListVMAsync(r =>
+ this.Dispatch(() => AddView(TabitemResources, new RessourceView(r))));
+ return;
+ case nameof(TabitemGoalcategories):
+ VMFactory.CreateGoalCategoryVMAsync(r =>
+ this.Dispatch(() => AddView(TabitemGoalcategories, new MassnahmenTreeViewView(r))));
+ return;
+ case nameof(TabitemNews):
+ ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllNewsItems(),
+ cb => this.Dispatch(() => AddView(TabitemNews, new NewsItemView(new NewsItemListVM(cb)))));
+ return;
+ case nameof(TabitemAssessmentSheetValues):
+ VMFactory.CreateAssessmentSheetValueListVM(m =>
+ this.Dispatch(() => AddView(TabitemAssessmentSheetValues, new AssessmentSheetValueView(m))));
+ return;
+ case nameof(TabitemAssessmentSheetCategories):
+ VMFactory.CreateAssessmentSheetCategoryListVM(m => this.Dispatch(() =>
+ AddView(TabitemAssessmentSheetCategories, new AssessmentSheetCategoryView(m))));
+ return;
+ case nameof(TabitemAdditionalServices):
+ VMFactory.CreateAdditionalServiceListVMAsync(r =>
+ this.Dispatch(() => AddView(TabitemAdditionalServices, new AdditionalServiceAddView(r))));
+ return;
+ case nameof(TabitemAdditionalServiceRegions):
+ VMFactory.CreateAdditionalServiceRegionListVMAsync(r =>
+ this.Dispatch(
+ () => AddView(TabitemAdditionalServiceRegions, new AdditionalServiceRegionView(r))));
+ return;
+ case nameof(TabitemAuszahlungsarten):
+ VMFactory.CreateAuszahlungsartenListVMAsync(r =>
+ this.Dispatch(() => AddView(TabitemAuszahlungsarten, new AuszahlungsartenAddView(r))));
+ return;
+ case nameof(TabitemDokumenttype):
+ VMFactory.CreateValueListVMAsync(ValueListEntryType.DocumentType,
+ r => this.Dispatch(() => AddView(TabitemDokumenttype, new DokumentationstypView(r))));
+ return;
+ case nameof(TabitemSbd):
+ VMFactory.CreateSbdAdminVMAsync(r => this.Dispatch(() => AddView(TabitemSbd, new SbdAdminView(r))));
+ return;
+ case nameof(TabitemContracttypes):
+ VMFactory.CreateValueListVMAsync(ValueListEntryType.ContractType,
+ r => this.Dispatch(() => AddView(TabitemContracttypes, new ValueListView(r))));
+ return;
+ case nameof(TabitemBudgets):
+ VMFactory.CreateBudgetListVMAsync(r =>
+ this.Dispatch(() => AddView(TabitemBudgets, new BudgetView(r))));
+ return;
+ case nameof(TabitemNotizenkategorie):
+ VMFactory.CreateValueListVMAsync(ValueListEntryType.NotizenKategorieEmployee,
+ notizEmpList => VMFactory.CreateValueListVMAsync(ValueListEntryType.NotizenKategorieCustomer,
+ notizCosList => this.Dispatch(() => AddView(TabitemNotizenkategorie, new NotizenKategorieView(notizEmpList, notizCosList)))));
+ return;
+ }
- private void tabitem_goalcategories_Selected(object sender, RoutedEventArgs e) // Ziele und Maßnahmen
- {
- if (!_OpenViews.ContainsKey(tabitem_goalcategories) || _SavePerformed)
- {
- VMFactory.CreateGoalCategoryVMAsync(r => this.Dispatch(() => AddView(tabitem_goalcategories, new MassnahmenTreeViewView(r))));
- }
- }
-
- private void tabitem_goals_Selected(object sender, RoutedEventArgs e)
- {
- //if (!_OpenViews.ContainsKey(tabitem_goals) || _SavePerformed)
- //{
- // VMFactory.CreateSupportConceptGoalListVMAsync(
- // ValueListEntryType.SupportConceptGoalType,
- // ValueListEntryType.SupportConceptGoalCategoryType,
- // r => this.Dispatch(() => AddView(tabitem_goals, new SupportConceptGoalView(r))));
- //}
- }
-
- private void tabitem_mandator_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_mandator) || _SavePerformed)
- {
- ServiceFacade.DoAccountingServiceAsync(s => s.LoadInvoiceNumber(),
- iv => ServiceFacade.DoOperationsServiceAsync(
- s => s.GetMandator(),
- m =>
- this.Dispatch(() => AddView(tabitem_mandator, new MandatorView(new MandatorVM(new InvoiceNumberVM(iv), m))))));
- }
- }
-
- private void tabitem_schedulerSettings_Selected(object sender, RoutedEventArgs e)
- {
- //### CB
- //if (!this._OpenViews.ContainsKey(this.tabitem_schedulerSettings) || this._SavePerformed)
- //{
- // VMFactory.CreateAppointmentCategoryListVMAsync(r => this.Dispatch(delegate { this.AddView(this.tabitem_schedulerSettings, new SchedulerSettingsView(r)); }));
- //}
+ throw new ArgumentOutOfRangeException(nameof(accordionItem));
}
- private void tabitem_news_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_news) || _SavePerformed)
- {
- ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllNewsItems(), cb => this.Dispatch(() => AddView(tabitem_news, new NewsItemView(new NewsItemListVM(cb)))));
- }
- }
-
- private void tabitem_placementObjectives_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_placementObjectives) || _SavePerformed)
- {
- VMFactory.CreateValueListVMAsync(ValueListEntryType.PlacementObjectiveType, r => this.Dispatch(() => AddView(tabitem_placementObjectives, new ValueListView(r))));
- }
- }
-
- private void tabitem_qualificationTypes_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_qualificationTypes) || _SavePerformed)
- {
- VMFactory.CreateValueListVMAsync(ValueListEntryType.StaffQualificationsType, r => this.Dispatch(() => AddView(tabitem_qualificationTypes, new ValueListView(r))));
- }
- }
-
- private void tabitem_resourceCategories_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_resourceCategories) || _SavePerformed)
- {
- VMFactory.CreateValueListVMAsync(ValueListEntryType.ResourceCategory, r => this.Dispatch(() => AddView(tabitem_resourceCategories, new ValueListView(r))));
- }
- }
-
- private void tabitem_resources_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_resources) || _SavePerformed)
- {
- VMFactory.CreateResourceListVMAsync(r => this.Dispatch(() => AddView(tabitem_resources, new RessourceView(r))));
- }
- }
-
- private void tabitem_roles_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_roles) || _SavePerformed)
- {
- VMFactory.CreateValueListVMAsync(ValueListEntryType.StaffRoleType, r => this.Dispatch(() => AddView(tabitem_roles, new ValueListView(r))));
- }
- }
-
- private void tabitem_serviceCategories_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_serviceCategories) || _SavePerformed)
- {
- VMFactory.CreateServiceCategoryListVMAsync(r => this.Dispatch(() => AddView(tabitem_serviceCategories, new ServiceCategoryView(r))));
- }
- }
-
- private void tabitem_serviceDescriptions_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_serviceDescriptions) || _SavePerformed)
- {
- VMFactory.CreateServiceDescriptionListVMAsync(r => this.Dispatch(() => AddView(tabitem_serviceDescriptions, new ServiceDescriptionView(r))));
- }
- }
-
- private void tabitem_terminationReasons_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_terminationReasons) || _SavePerformed)
- {
- VMFactory.CreateValueListVMAsync(ValueListEntryType.TerminationReasonType, r => this.Dispatch(() => AddView(tabitem_terminationReasons, new ValueListView(r))));
- }
- }
-
- private void tabitem_titles_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_titles) || _SavePerformed)
- {
- VMFactory.CreateValueListVMAsync(ValueListEntryType.TitleType, r => this.Dispatch(() => AddView(tabitem_titles, new ValueListView(r))));
- }
- }
-
- private void Tabitem_additionalServiceRegions_OnSelected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_additionalServiceRegions) || _SavePerformed)
- {
- VMFactory.CreateAdditionalServiceRegionListVMAsync(r => this.Dispatch(() => AddView(tabitem_additionalServiceRegions, new AdditionalServiceRegionView(r))));
- }
- }
-
- private void Tabitem_additionalAdditionalServices_OnSelected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_additionalServices) || _SavePerformed)
- {
- VMFactory.CreateAdditionalServiceListVMAsync(r => this.Dispatch(() => AddView(tabitem_additionalServices, new AdditionalServiceAddView(r))));
- }
- }
-
- private void Tabitem_auszahlungsarten_OnSelected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_auszahlungsarten) || _SavePerformed)
- {
- VMFactory.CreateAuszahlungsartenListVMAsync(r => this.Dispatch(() => AddView(tabitem_auszahlungsarten, new AuszahlungsartenAddView(r))));
- }
- }
-
- private void tabitem_medikamentenarten_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_medikamentenarten) || _SavePerformed)
- VMFactory.CreateMedArtListVMAsync(r => this.Dispatch(() => AddView(tabitem_medikamentenarten, new MedikamentenartenView(r))));
- }
-
- private void Tabitem_TextModules_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_textbausteine) || _SavePerformed)
- {
- VMFactory.CreateTextModuleListVMAsync(r => this.Dispatch(() => AddView(tabitem_textbausteine, new TextbausteinView(r, true))), true, true);
- }
- }
-
- private void tabitem_dokumenttype_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_dokumenttype) || _SavePerformed)
- {
- VMFactory.CreateValueListVMAsync(ValueListEntryType.DocumentType, r => this.Dispatch(() => AddView(tabitem_dokumenttype, new DokumentationstypView(r))));
- }
- }
-
- private void tabitem_sbd_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_sbd) || _SavePerformed)
- {
- VMFactory.CreateSbdAdminVMAsync(r => this.Dispatch(() => AddView(tabitem_sbd, new SbdAdminView(r))));
- }
- }
-
- private void tabitem_contracttypes_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_contracttypes) || _SavePerformed)
- {
- VMFactory.CreateValueListVMAsync(ValueListEntryType.ContractType, r => this.Dispatch(() => AddView(tabitem_contracttypes, new ValueListView(r))));
- }
- }
-
- private void tabitem_qualifikationsbedarf_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_qualifikationsbedarf) || _SavePerformed)
- {
- VMFactory.CreateValueListVMAsync(ValueListEntryType.QualifikationsBedarf, r => this.Dispatch(() => AddView(tabitem_qualifikationsbedarf, new ValueListView(r))));
- }
- }
-
- private void tabitem_Budgets_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_Budgets) || _SavePerformed)
- {
- VMFactory.CreateBudgetListVMAsync(r => this.Dispatch(() => AddView(tabitem_Budgets, new BudgetView(r))));
- }
- }
- }
+ #endregion
+ }
}
\ No newline at end of file
diff --git a/BeWo/View/NotizenView.xaml b/BeWo/View/NotizenView.xaml
index dee637fd8..c893b930f 100644
--- a/BeWo/View/NotizenView.xaml
+++ b/BeWo/View/NotizenView.xaml
@@ -10,6 +10,7 @@
xmlns:core="clr-namespace:BS.Shared.Core;assembly=BS.Shared"
xmlns:controls="clr-namespace:BeWo.View.Controls"
xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup"
+ xmlns:controls1="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
Height="Auto" Width="Auto" HorizontalAlignment="Stretch"
mc:Ignorable="d" VerticalAlignment="Stretch" Focusable="True">
@@ -40,7 +41,7 @@
-
+