From 960aaacde301eb9b35974c5b4ece0af79bceaa41 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 22 Feb 2017 17:59:08 +0100 Subject: [PATCH] Release Version --- BeWo/Core/BeWoUtils.cs | 84 +- BeWo/View/Detail/CustomerView.xaml | 40 +- BeWo/View/Detail/EnvironmentRoleView.xaml.cs | 44 +- BeWo/View/Detail/PersonView.xaml | 6 +- BeWo/View/Detail/ServiceRecordView2.xaml.cs | 10 +- BeWo/View/Master/AdministrationView.xaml | 2 +- BeWo/View/Master/AdministrationView.xaml.cs | 6 +- Model/Changes_15_02_2017.txt | 5 +- .../MitarbeiterstundenkontoBerechnung.cs | 2129 +++++++++-------- Service/Plugins/ServiceRecordValidator.cs | 23 +- .../ServiceContracts/IOperationsService.cs | 8 +- .../OperationsServiceImp.cs | 8 + Shared/Core/EnumTranslations.cs | 12 +- .../ServiceRecordValidationResultDC.cs | 5 +- 14 files changed, 1245 insertions(+), 1137 deletions(-) diff --git a/BeWo/Core/BeWoUtils.cs b/BeWo/Core/BeWoUtils.cs index c5d964e77..d4e9ad2be 100644 --- a/BeWo/Core/BeWoUtils.cs +++ b/BeWo/Core/BeWoUtils.cs @@ -1677,9 +1677,21 @@ namespace BeWo.Core } break; case ServiceRecordValidationResult.Custom: - MessageBox.Show(result.Message, "Speichern nicht möglich", MessageBoxButton.OK, MessageBoxImage.Error); - lValid = false; - exitLoop = true; + if (result.Allow) + { + if (MessageBox.Show(result.Message, "Speichern", MessageBoxButton.YesNo, MessageBoxImage.Warning).Equals(MessageBoxResult.No)) + { + lValid = false; + exitLoop = true; + } + } + else + { + MessageBox.Show(result.Message, "Speichern nicht möglich", MessageBoxButton.OK, MessageBoxImage.Error); + lValid = false; + exitLoop = true; + } + break; } @@ -1690,14 +1702,64 @@ namespace BeWo.Core return lValid; } - /// - /// Erzeugt einen Report mit Hilfe des ReportServices und zeigt ihn in einem BeWoWindow - /// - /// Titel des Fensters - /// Documentpreview für den Report - /// Dictionary mit Variablen für das ReportObject - /// Der Typ des Reports (z.B. KalenderMonatsformatReport) - public static void ShowReport(string title, DocumentPreview documentPreview, Dictionary variablen, ReportEnum reportType) + public static bool ValidateServiceRecordDeletion(ServiceRecordVM vm) + { + var lValid = true; + + + var dc = vm.CommitToDataContract(); + var emp = BeWoApp.LoggedOnUser.Employee; + + + var r = new List(); + + + //ServiceFacade.DoOperationsServiceSync(o => r = o.ValidateServiceRecord(dc, statistics, maxdays, employeeOids, cb2ScOids)); + + + if (r.Count > 0) + { + var exitLoop = false; + + foreach (var result in r) + { + switch (result.ResultType) + { + + case ServiceRecordValidationResult.Custom: + if (result.Allow) + { + if (MessageBox.Show(result.Message, "Löschen", MessageBoxButton.YesNo, MessageBoxImage.Warning).Equals(MessageBoxResult.No)) + { + lValid = false; + exitLoop = true; + } + } + else + { + MessageBox.Show(result.Message, "Löschen nicht möglich", MessageBoxButton.OK, MessageBoxImage.Error); + lValid = false; + exitLoop = true; + } + + break; + } + + if (exitLoop) break; + } + } + + return lValid; + } + + /// + /// Erzeugt einen Report mit Hilfe des ReportServices und zeigt ihn in einem BeWoWindow + /// + /// Titel des Fensters + /// Documentpreview für den Report + /// Dictionary mit Variablen für das ReportObject + /// Der Typ des Reports (z.B. KalenderMonatsformatReport) + public static void ShowReport(string title, DocumentPreview documentPreview, Dictionary variablen, ReportEnum reportType) { switch (reportType) { diff --git a/BeWo/View/Detail/CustomerView.xaml b/BeWo/View/Detail/CustomerView.xaml index 6e58b5075..7aa43a78e 100644 --- a/BeWo/View/Detail/CustomerView.xaml +++ b/BeWo/View/Detail/CustomerView.xaml @@ -438,25 +438,23 @@ - + - - - - @@ -487,7 +483,7 @@ @@ -1353,7 +1347,7 @@ - @@ -1443,18 +1437,18 @@ - +