From 703b6b3a386b6970721ea14ab96897af4165bfb2 Mon Sep 17 00:00:00 2001 From: rene Date: Fri, 9 Aug 2019 16:40:41 +0200 Subject: [PATCH] =?UTF-8?q?Model=20Ordner=20aufger=C3=A4umt=20-=20Alle=20m?= =?UTF-8?q?it=20nicht=20korrekter=20Bezeichnung=20in=20den=20Ordner=20"alt?= =?UTF-8?q?"=20geworfen=20Kategorie=20zum=20Notizeintrag=20hinzugef=C3=BCg?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BeWo.sln | 38 + BeWo/BeWo.csproj | 23 +- BeWo/View/Detail/CustomerView.xaml.cs | 5 +- BeWo/View/Detail/EmployeeView.xaml.cs | 11 +- BeWo/View/Detail/EnvironmentRoleView.xaml.cs | 1 - BeWo/View/Detail/NotizenKategorieView.xaml | 88 + BeWo/View/Detail/NotizenKategorieView.xaml.cs | 199 + BeWo/View/HomeDragPanelView.xaml | 839 - BeWo/View/HomeDragPanelView.xaml.cs | 2083 - BeWo/View/Master/AdministrationView.xaml | 124 +- BeWo/View/Master/AdministrationView.xaml.cs | 713 +- BeWo/View/NotizenView.xaml | 55 +- BeWo/View/NotizenView.xaml.cs | 74 +- BeWo/ViewModel/CustomerVM.cs | 18 + BeWo/ViewModel/EmployeeVM.cs | 19 +- BeWo/ViewModel/NotizenEintragVM.cs | 46 +- BeWo/ViewModel/VMFactory.cs | 27 +- Data/Entities/NotizenEintrag.cs | 2 + Data/Mappings/NotizenEintrag.hbm.xml | 2 +- Host/ReportView.aspx.cs | 11 +- Model/{ => Alt}/BeWo.apm | 34464 ++++++++-------- Model/{ => Alt}/BeWo.pdb | 34262 +++++++-------- Model/{ => Alt}/BeWo.pdm | 34262 +++++++-------- Model/{ => Alt}/BeWo_Neu.cdb | 20624 ++++----- Model/{ => Alt}/BeWo_Neu.cdm | 20624 ++++----- Model/{ => Alt}/BoemelingUndTeckhausVF.sql | 8 +- Model/{ => Alt}/Changes 16-04-13.sql | 4 +- Model/{ => Alt}/Changes_03_08_2016.txt | 0 Model/{ => Alt}/Changes_03_11_2016.txt | 0 Model/{ => Alt}/Changes_04_08_2016.txt | 0 Model/{ => Alt}/Changes_04_11_2016.txt | 0 Model/{ => Alt}/Changes_06_10_2016.txt | 0 Model/{ => Alt}/Changes_07_11_2016.txt | 0 Model/{ => Alt}/Changes_12_09_2016.txt | 0 Model/{ => Alt}/Changes_13_02_2017.txt | 0 Model/{ => Alt}/Changes_15_07_2016.txt | 0 Model/{ => Alt}/Changes_16_06_01.txt | 0 Model/{ => Alt}/Changes_16_06_02.txt | 12 +- Model/{ => Alt}/Changes_16_06_13.txt | 0 Model/{ => Alt}/Changes_16_06_14.txt | 6 +- Model/{ => Alt}/Changes_16_06_17.txt | 8 +- Model/{ => Alt}/Changes_16_11_2016.txt | 0 Model/{ => Alt}/Changes_17_10_2016.txt | 0 Model/{ => Alt}/Changes_18.03.2016.txt | 0 Model/{ => Alt}/Changes_18_02_2016.txt | 0 Model/{ => Alt}/Changes_19_02_2016.txt | 0 Model/{ => Alt}/Changes_23_02_2016.txt | 0 Model/{ => Alt}/Changes_24_04_2017.txt | 0 Model/{ => Alt}/Changes_25_02_2016.txt | 0 Model/{ => Alt}/Changes_25_07_2016.txt | 0 Model/{ => Alt}/Changes_26_09_2016.txt | 0 Model/{ => Alt}/Changes_27_04_2017.txt | 0 Model/{ => Alt}/Changes_28.04.2017.txt | 0 .../_Changes-16-01-08.txt} | 0 .../_Changes23_02_2016.txt} | 0 .../_Changes2_06_10_2016.txt} | 0 .../_Changes_29_09_2016.txt} | 0 .../_Changes_alle_bis_2017_09_14.txt} | 0 .../_Changes_alle_bis_2017_11_19.txt} | 0 .../_Changes_alles_bis_24.03.txt} | 0 .../_ExterneDB_Teil1.txt} | 0 Model/{GenderBeWo.sql => Alt/_GenderBeWo.sql} | 18 +- .../_GenderBewoVarfields.sql} | 2 +- .../_LebensGestaltungHanau.sql} | 68 +- .../_VarFields 15-04-10.sql} | 112 +- .../_VarFields 15-04-20.sql} | 72 +- .../_VarFields 15-04-22.sql} | 20 +- .../_VarFields 15-06-29.sql} | 6 +- Model/{VarFields.txt => Alt/_VarFields.txt} | 114 +- Model/{Workspace.sws => Alt/_Workspace.sws} | 138 +- .../{bewo alters.txt => Alt/_bewo alters.txt} | 60 +- .../_changes_cwirth.sql} | 690 +- .../_create_Empty_MySQL.sql} | 6686 +-- .../_create_new_employee.sql} | 44 +- .../_historyscript.sql} | 466 +- Model/{inserts.sql => Alt/_inserts.sql} | 760 +- Model/{neueRechte.sql => Alt/_neueRechte.sql} | 10 +- .../_switchServiceRecords.sql} | 30 +- Model/{ziele.sql => Alt/_ziele.sql} | 406 +- Model/{ => Alt}/changes 14-11-19.sql | 72 +- Model/{ => Alt}/changes 15-02-09.txt | 150 +- Model/{ => Alt}/changes 15-02-27.txt | 4 +- Model/{ => Alt}/changes 15-03-12.sql | 2 +- Model/{ => Alt}/changes 15-03-20.sql | 42 +- Model/{ => Alt}/changes 15-04-15.sql | 12 +- Model/{ => Alt}/changes 15-07-17.sql | 54 +- Model/{ => Alt}/changes 15-10-26.sql | 2 +- Model/{ => Alt}/changes 15-10-27.sql | 50 +- Model/{ => Alt}/changes 15-11-02.sql | 134 +- Model/{ => Alt}/changes 15-11-06.sql | 0 Model/{ => Alt}/changes 15-11-10.sql | 0 Model/{ => Alt}/changes 15-11-17.sql | 120 +- Model/{ => Alt}/changes 15-11-30.txt | 0 Model/{ => Alt}/changes 15-12-15.txt | 0 Model/{ => Alt}/changes 16-02-11.sql | 36 +- Model/{ => Alt}/changes 16-02-18.sql | 0 .../changes 16-02-19 Bargeldkassen.sql | 118 +- .../changes 16-02-19 mehrere Dokufelder.sql | 0 Model/{ => Alt}/changes 16-02-25.sql | 0 Model/{ => Alt}/changes 16-03-29.sql | 48 +- Model/{ => Alt}/changes 16-05-02.sql | 0 Model/{ => Alt}/changes 16-10-17.sql | 0 Model/{ => Alt}/changes 16-11-28.sql | 0 Model/{ => Alt}/changes alle 17_05_19.txt | 0 Model/{ => Alt}/changes.sql | 576 +- Model/Changes_2019_07_31.txt | 2 - ...zeintrag hat nun eine Eintragkategorie.txt | 16 + Report/AbstractReportCreator.cs | 4 +- Report/DefaultReportCreator.cs | 11 +- .../DefaultReports/NotizenReport.Designer.cs | 182 + Report/DefaultReports/NotizenReport.cs | 23 + Report/DefaultReports/NotizenReport.resx | 123 + Report/Report.csproj | 11 + Report/ReportObjects/NotizenRO.cs | 35 + ...LeistungsnachweisKrankenkasse.Designer.cs} | 3024 +- ...rt.cs => LeistungsnachweisKrankenkasse.cs} | 1 - .../LeistungsnachweisKrankenkasse.resx | 123 + .../PraxisPusteblume/PraxisPusteblume.csproj | 18 +- .../ServicesOverviewReport.resx | 9281 ----- .../NotizenEintragDC_NotizenEintrag.cs | 19 +- .../ValueListEntryDC_ValueListEntry.cs | 116 +- Shared/BeWoEntityEnums.cs | 7 +- Shared/Core/EnumTranslations.cs | 797 +- Shared/DataContracts/NotizenEintragDC.cs | 3 + 124 files changed, 81484 insertions(+), 92086 deletions(-) create mode 100644 BeWo/View/Detail/NotizenKategorieView.xaml create mode 100644 BeWo/View/Detail/NotizenKategorieView.xaml.cs delete mode 100644 BeWo/View/HomeDragPanelView.xaml delete mode 100644 BeWo/View/HomeDragPanelView.xaml.cs rename Model/{ => Alt}/BeWo.apm (96%) rename Model/{ => Alt}/BeWo.pdb (96%) rename Model/{ => Alt}/BeWo.pdm (96%) rename Model/{ => Alt}/BeWo_Neu.cdb (96%) rename Model/{ => Alt}/BeWo_Neu.cdm (96%) rename Model/{ => Alt}/BoemelingUndTeckhausVF.sql (99%) rename Model/{ => Alt}/Changes 16-04-13.sql (97%) rename Model/{ => Alt}/Changes_03_08_2016.txt (100%) rename Model/{ => Alt}/Changes_03_11_2016.txt (100%) rename Model/{ => Alt}/Changes_04_08_2016.txt (100%) rename Model/{ => Alt}/Changes_04_11_2016.txt (100%) rename Model/{ => Alt}/Changes_06_10_2016.txt (100%) rename Model/{ => Alt}/Changes_07_11_2016.txt (100%) rename Model/{ => Alt}/Changes_12_09_2016.txt (100%) rename Model/{ => Alt}/Changes_13_02_2017.txt (100%) rename Model/{ => Alt}/Changes_15_07_2016.txt (100%) rename Model/{ => Alt}/Changes_16_06_01.txt (100%) rename Model/{ => Alt}/Changes_16_06_02.txt (99%) rename Model/{ => Alt}/Changes_16_06_13.txt (100%) rename Model/{ => Alt}/Changes_16_06_14.txt (99%) rename Model/{ => Alt}/Changes_16_06_17.txt (99%) rename Model/{ => Alt}/Changes_16_11_2016.txt (100%) rename Model/{ => Alt}/Changes_17_10_2016.txt (100%) rename Model/{ => Alt}/Changes_18.03.2016.txt (100%) rename Model/{ => Alt}/Changes_18_02_2016.txt (100%) rename Model/{ => Alt}/Changes_19_02_2016.txt (100%) rename Model/{ => Alt}/Changes_23_02_2016.txt (100%) rename Model/{ => Alt}/Changes_24_04_2017.txt (100%) rename Model/{ => Alt}/Changes_25_02_2016.txt (100%) rename Model/{ => Alt}/Changes_25_07_2016.txt (100%) rename Model/{ => Alt}/Changes_26_09_2016.txt (100%) rename Model/{ => Alt}/Changes_27_04_2017.txt (100%) rename Model/{ => Alt}/Changes_28.04.2017.txt (100%) rename Model/{Changes-16-01-08.txt => Alt/_Changes-16-01-08.txt} (100%) rename Model/{Changes23_02_2016.txt => Alt/_Changes23_02_2016.txt} (100%) rename Model/{Changes2_06_10_2016.txt => Alt/_Changes2_06_10_2016.txt} (100%) rename Model/{Changes_29_09_2016.txt => Alt/_Changes_29_09_2016.txt} (100%) rename Model/{Changes_alle_bis_2017_09_14.txt => Alt/_Changes_alle_bis_2017_09_14.txt} (100%) rename Model/{Changes_alle_bis_2017_11_19.txt => Alt/_Changes_alle_bis_2017_11_19.txt} (100%) rename Model/{Changes_alles_bis_24.03.txt => Alt/_Changes_alles_bis_24.03.txt} (100%) rename Model/{ExterneDB_Teil1.txt => Alt/_ExterneDB_Teil1.txt} (100%) rename Model/{GenderBeWo.sql => Alt/_GenderBeWo.sql} (99%) rename Model/{GenderBewoVarfields.sql => Alt/_GenderBewoVarfields.sql} (99%) rename Model/{LebensGestaltungHanau.sql => Alt/_LebensGestaltungHanau.sql} (99%) rename Model/{VarFields 15-04-10.sql => Alt/_VarFields 15-04-10.sql} (99%) rename Model/{VarFields 15-04-20.sql => Alt/_VarFields 15-04-20.sql} (99%) rename Model/{VarFields 15-04-22.sql => Alt/_VarFields 15-04-22.sql} (99%) rename Model/{VarFields 15-06-29.sql => Alt/_VarFields 15-06-29.sql} (99%) rename Model/{VarFields.txt => Alt/_VarFields.txt} (98%) rename Model/{Workspace.sws => Alt/_Workspace.sws} (99%) rename Model/{bewo alters.txt => Alt/_bewo alters.txt} (96%) rename Model/{changes_cwirth.sql => Alt/_changes_cwirth.sql} (97%) rename Model/{create_Empty_MySQL.sql => Alt/_create_Empty_MySQL.sql} (97%) rename Model/{create_new_employee.sql => Alt/_create_new_employee.sql} (98%) rename Model/{historyscript.sql => Alt/_historyscript.sql} (95%) rename Model/{inserts.sql => Alt/_inserts.sql} (99%) rename Model/{neueRechte.sql => Alt/_neueRechte.sql} (97%) rename Model/{switchServiceRecords.sql => Alt/_switchServiceRecords.sql} (96%) rename Model/{ziele.sql => Alt/_ziele.sql} (99%) rename Model/{ => Alt}/changes 14-11-19.sql (97%) rename Model/{ => Alt}/changes 15-02-09.txt (98%) rename Model/{ => Alt}/changes 15-02-27.txt (98%) rename Model/{ => Alt}/changes 15-03-12.sql (99%) rename Model/{ => Alt}/changes 15-03-20.sql (98%) rename Model/{ => Alt}/changes 15-04-15.sql (97%) rename Model/{ => Alt}/changes 15-07-17.sql (97%) rename Model/{ => Alt}/changes 15-10-26.sql (99%) rename Model/{ => Alt}/changes 15-10-27.sql (98%) rename Model/{ => Alt}/changes 15-11-02.sql (97%) rename Model/{ => Alt}/changes 15-11-06.sql (100%) rename Model/{ => Alt}/changes 15-11-10.sql (100%) rename Model/{ => Alt}/changes 15-11-17.sql (98%) rename Model/{ => Alt}/changes 15-11-30.txt (100%) rename Model/{ => Alt}/changes 15-12-15.txt (100%) rename Model/{ => Alt}/changes 16-02-11.sql (98%) rename Model/{ => Alt}/changes 16-02-18.sql (100%) rename Model/{ => Alt}/changes 16-02-19 Bargeldkassen.sql (97%) rename Model/{ => Alt}/changes 16-02-19 mehrere Dokufelder.sql (100%) rename Model/{ => Alt}/changes 16-02-25.sql (100%) rename Model/{ => Alt}/changes 16-03-29.sql (98%) rename Model/{ => Alt}/changes 16-05-02.sql (100%) rename Model/{ => Alt}/changes 16-10-17.sql (100%) rename Model/{ => Alt}/changes 16-11-28.sql (100%) rename Model/{ => Alt}/changes alle 17_05_19.txt (100%) rename Model/{ => Alt}/changes.sql (97%) delete mode 100644 Model/Changes_2019_07_31.txt create mode 100644 Model/Changes_2019_08_08 Notizeintrag hat nun eine Eintragkategorie.txt create mode 100644 Report/DefaultReports/NotizenReport.Designer.cs create mode 100644 Report/DefaultReports/NotizenReport.cs create mode 100644 Report/DefaultReports/NotizenReport.resx create mode 100644 Report/ReportObjects/NotizenRO.cs rename ReportImp/PraxisPusteblume/{ServicesOverviewReport.Designer.cs => LeistungsnachweisKrankenkasse.Designer.cs} (51%) rename ReportImp/PraxisPusteblume/{ServicesOverviewReport.cs => LeistungsnachweisKrankenkasse.cs} (99%) create mode 100644 ReportImp/PraxisPusteblume/LeistungsnachweisKrankenkasse.resx delete mode 100644 ReportImp/PraxisPusteblume/ServicesOverviewReport.resx 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">