From a3e9d7424921512d6245975258720ef5201113a4 Mon Sep 17 00:00:00 2001 From: Lyndon Date: Wed, 21 May 2025 19:34:42 +0200 Subject: [PATCH 1/6] Bugs behoben, die mit dem Wechsel zum browsereigenen Datumsinputs oder des Wiederherstellen des alten Textes der Dokufelder zu tun hatten --- BeWoPlanerMobil/Controllers/MainController.cs | 27 ++- BeWoPlanerMobil/Models/MainModel.cs | 62 ++++++- .../utils/service-record-time-calc.js | 4 +- .../ownSoft-Scripts/view-scripts/main.js | 23 ++- .../Service/ASPHibernateSessionManager.cs | 15 +- BeWoPlanerMobil/Util/JsonCustomer.cs | 14 +- .../Views/Customer/Customer.cshtml | 112 ++++++------ .../CustomerAbsenceTimeFormPartial.cshtml | 168 ++++++++---------- .../Customer/CustomerBetreuungPartial.cshtml | 7 +- .../Views/Main/GroupBookingFormPartial.cshtml | 2 +- BeWoPlanerMobil/Views/Main/Main.cshtml | 1 - .../Views/Main/MultiBookingFormPartial.cshtml | 2 +- .../Main/ServiceRecordListPartial.cshtml | 2 +- .../Views/Main/SingleBookingPartial.cshtml | 6 +- .../Views/Main/TextModulePartial.cshtml | 68 ++++--- BeWoPlanerMobil/Views/Shared/_Layout.cshtml | 6 + 16 files changed, 292 insertions(+), 227 deletions(-) diff --git a/BeWoPlanerMobil/Controllers/MainController.cs b/BeWoPlanerMobil/Controllers/MainController.cs index 684047232..f786576d5 100644 --- a/BeWoPlanerMobil/Controllers/MainController.cs +++ b/BeWoPlanerMobil/Controllers/MainController.cs @@ -22,6 +22,7 @@ using BS.Shared.DataContracts; using BS.Shared.DataContracts.Compact; using BS.Shared.Extensions; using BS.Shared.Services; +using DevExpress.Mvvm.ModuleInjection.Native; using DevExpress.XtraScheduler; using DevExpress.XtraScheduler.Compatibility; using Newtonsoft.Json; @@ -105,10 +106,10 @@ namespace BeWoPlanerMobil.Controllers switch(MobileSessionFacade.PasswordStrength) { case 0: - tempDataValue = "Sie benutzen ein sehr schwaches Passwort.

Bitte ändern Sie Ihr Passwort, indem Sie im Menü auf 'Password ändern' klicken."; + tempDataValue = "Sie benutzen ein sehr schwaches Passwort.

Bitte ändern Sie Ihr Passwort, indem Sie im Menü auf 'Password ändern' klicken."; break; case 1: - tempDataValue = "Sie benutzen ein schwaches Passwort.

Bitte ändern Sie Ihr Passwort, indem Sie im Menü auf 'Password ändern' klicken."; + tempDataValue = "Sie benutzen ein schwaches Passwort.

Bitte ändern Sie Ihr Passwort, indem Sie im Menü auf 'Password ändern' klicken."; break; } @@ -246,7 +247,7 @@ namespace BeWoPlanerMobil.Controllers if(Model.SelectedCostBearer2SupportConceptRelListObject is null || !isInList) { - if(!(Model.SelectedCostBearer2SupportConceptRelListObject is null) && !isInList) + if(Model.SelectedCostBearer2SupportConceptRelListObject != null && !isInList) { Log.Info($"Model.SelectedSupportConceptListObject.Oid = {Model.SelectedCostBearer2SupportConceptRelListObject.CostBearer2SupportConceptOid} is not in list !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); @@ -481,6 +482,7 @@ namespace BeWoPlanerMobil.Controllers if(supportConcept is null) { + Log.Info($"Hilfeplan von Bewilligung mit Oid {Model.CostBearer2SupportConceptOid} nicht gefunden beim Laden der Ziele (LoadGoals)."); return; } @@ -958,6 +960,7 @@ namespace BeWoPlanerMobil.Controllers { if(Model is null) { + Log.Info($"Model ist null bei CreateOrUpdateServiceRecord; User: {MobileSessionFacade.LoggedInUser.Oid} {MobileSessionFacade.LoggedInUser.LoginName} ({MobileSessionFacade.LoggedInUser.Employee})"); TempData[TempDataConstants.DoLogoutKey] = true; return Logout(); } @@ -993,6 +996,7 @@ namespace BeWoPlanerMobil.Controllers if(string.IsNullOrEmpty(collection[FormCollectionConstants.DateKey])) { + Log.Info($"CreateOrUpdateServiceRecord: Das Startdatum ist null. Breche das {(Model.IsInEditingMode ? "Speichern" : "Anlegen")} ab."); return View("Main", Model); } @@ -1080,6 +1084,7 @@ namespace BeWoPlanerMobil.Controllers if(Model.NewServiceRecord is null) { + Log.Info("CreateOrUpdateServiceRecord: NewServiceRecord ist null. Breche ab."); return RedirectToActionPermanent("Main"); } @@ -1743,6 +1748,7 @@ namespace BeWoPlanerMobil.Controllers { if(Model is null) { + Log.Info($"Model ist null in Methode LoadServiceCategoriesToModel({cb2ScOid})"); return; } @@ -1757,6 +1763,8 @@ namespace BeWoPlanerMobil.Controllers if(cb2ScOid is null && (Model.IsInGroupBookingMode || Model.IsInMultiBookingMode)) { + Log.Info("Oid der Bewilligung ist null und der MoK befindet sich im Gruppen- oder Mehrfachbuchungsmodus"); + var selectedSupportConcepts = Model.IsInGroupBookingMode ? Model.GroupBookingSelectedSupportConcepts : Model.IsInMultiBookingMode ? @@ -1930,7 +1938,7 @@ namespace BeWoPlanerMobil.Controllers var serviceRecordDC = Model.ServiceRecords.FirstOrDefault(f => f.ServiceRecordOid != null && f.ServiceRecordOid.Value.Equals(Model.ServiceRecordOidToDelete)); var version = serviceRecordDC?.ServiceRecordVersion; - if(version != null && MainModel.IsAllowedToDeleteServiceRecord(serviceRecordDC)) + if(version != null && Model.IsAllowedToDeleteServiceRecord(serviceRecordDC)) { OperationsService.DeleteServiceRecord(Model.ServiceRecordOidToDelete.Value, version.Value); @@ -1938,9 +1946,7 @@ namespace BeWoPlanerMobil.Controllers } } - ResetEditingMode(); - - return RedirectToActionPermanent("Main"); + return ResetEditingMode(); } [Authorize] @@ -3064,7 +3070,6 @@ namespace BeWoPlanerMobil.Controllers } LoadSupportConceptThings(Model.CostBearer2SupportConceptOid); - //LoadGoals(); } private void ResetMultiBookingMode() @@ -4731,6 +4736,12 @@ namespace BeWoPlanerMobil.Controllers [Authorize] public override string SaveCollapsibleStatus(bool isOpen, string identifier) { + if(Model is null) + { + TempData[TempDataConstants.DoLogoutKey] = true; + return LeerzeichenFuerGetMethoden; + } + Model.Collapsibles2IsShown[identifier] = isOpen; return LeerzeichenFuerGetMethoden; diff --git a/BeWoPlanerMobil/Models/MainModel.cs b/BeWoPlanerMobil/Models/MainModel.cs index afed56927..25c2bd539 100644 --- a/BeWoPlanerMobil/Models/MainModel.cs +++ b/BeWoPlanerMobil/Models/MainModel.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using System.Diagnostics; using System.Linq; using System.Web.Mvc; using BeWo.View.Navigation.Filter; @@ -16,6 +17,10 @@ namespace BeWoPlanerMobil.Models { public class MainModel : AbstractModel { + protected static readonly log4net.ILog Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + + + public long? SelectedCostBearerSupportConceptRelOid { get; set; } [Display(Name = "Nur meine Klienten anzeigen")] @@ -94,8 +99,19 @@ namespace BeWoPlanerMobil.Models [Display(Name = "Abgelaufene Hilfepläne anzeigen")] public bool ShowExpiredSupportConcepts { get; set; } - [Display(Name = "Hilfeplan")] - public long? CostBearer2SupportConceptOid { get; set; } + private long? _CostBearer2SupportConceptOid; + + [Display(Name = "Hilfeplan")] + public long? CostBearer2SupportConceptOid + { + get => _CostBearer2SupportConceptOid; + + set + { + Log.Info($"CostBearer2SupportConceptOid ausgewählt: {value}. Vorher: {_CostBearer2SupportConceptOid}; Benutzer: {MobileSessionFacade.LoggedInUser.LoginName} UserOid: {MobileSessionFacade.LoggedInUser.Oid}"); + _CostBearer2SupportConceptOid = value; + } + } public long? SelectedServiceCategoryOid => SelectedServiceCategory?.ServiceCategoryOid; @@ -103,7 +119,7 @@ namespace BeWoPlanerMobil.Models public long? SelectedServiceRecordOid { get; set; } - public static bool IsAllowedToDeleteServiceRecord(ServiceRecordDC serviceRecord) + public bool IsAllowedToDeleteServiceRecord(ServiceRecordDC serviceRecord) { var allowed = false; @@ -176,8 +192,22 @@ namespace BeWoPlanerMobil.Models } public ServiceRecordDC SelectedServiceRecord { get; set; } - - public SupportConceptDC SelectedSupportConcept { get; set; } + + private SupportConceptDC _SelectedSupportConcept; + + public SupportConceptDC SelectedSupportConcept + { + get => _SelectedSupportConcept; + + set + { + var stackTrace = new StackTrace(); + var callingMethodsName = stackTrace.GetFrame(1).GetMethod().Name; + Log.Info($"SC mit Oid {value?.SupportConceptOid} ausgewählt. Vorheriger SC: {_SelectedSupportConcept?.SupportConceptOid}. Aufrufende Methode: {callingMethodsName}"); + + _SelectedSupportConcept = value; + } + } public int Zeitraum { get; set; } @@ -256,8 +286,6 @@ namespace BeWoPlanerMobil.Models } } - - public CostBearer2SupportConceptRelListObject SelectedCostBearer2SupportConceptRelListObject { get; set; } public List SelectedConceptCostBearerRelations { get; set; } @@ -386,7 +414,23 @@ namespace BeWoPlanerMobil.Models public CompactEmployeeDC PreviouslySelectedEmployee { get; set; } public SupportConceptDC PreviouslySelectedSupportConcept { get; set; } - public long? PreviouslySelectedCostbearer2SupportConceptOid { get; set; } + private long? _PreviouslySelectedCostbearer2SupportConceptOid; + + public long? PreviouslySelectedCostbearer2SupportConceptOid + { + get => _PreviouslySelectedCostbearer2SupportConceptOid; + set + { + var stackTrace = new StackTrace(); + var callingMethodsName = stackTrace.GetFrame(1).GetMethod().Name; + + var alt = _PreviouslySelectedCostbearer2SupportConceptOid; + + Log.Info($"PreviouslySelectedCostbearer2SupportConceptOid-Set von {alt} zu {value} von Methode: {callingMethodsName}"); + + _PreviouslySelectedCostbearer2SupportConceptOid = value; + } + } public bool IsEndDateVisible { get; set; } public static string GetServiceRecordTimeHeader(ServiceRecordDC serviceRecord, bool isForServiceRecordsList) @@ -742,7 +786,7 @@ namespace BeWoPlanerMobil.Models public ServiceDescriptionDC GetSelectedOrFirstServiceDescription() { - if(!(SelectedServiceDescription is null) || Categories2Descriptions is null) + if(SelectedServiceDescription != null || Categories2Descriptions is null) { return SelectedServiceDescription; } diff --git a/BeWoPlanerMobil/Scripts/ownSoft-Scripts/utils/service-record-time-calc.js b/BeWoPlanerMobil/Scripts/ownSoft-Scripts/utils/service-record-time-calc.js index 28d21d752..3335129f1 100644 --- a/BeWoPlanerMobil/Scripts/ownSoft-Scripts/utils/service-record-time-calc.js +++ b/BeWoPlanerMobil/Scripts/ownSoft-Scripts/utils/service-record-time-calc.js @@ -317,12 +317,14 @@ function calcTimeWithDuration(timeAsString, timeElement, start, duration, isForm } function beiDaueraenderung(idPrefix) { + const hoursMinutesDropdown = $(`#${idPrefix}-hours-minutes-dropdown-btn`); + const startTimeInput = $(`#${idPrefix}-start-time-input`); const endTimeInput = $(`#${idPrefix}-end-time-input`); const durationInput = $(`#${idPrefix}-duration-input`); const startDateInput = $(`#${idPrefix}-start-date-input`); const endDateInput = $(`#${idPrefix}-end-date-input`); - const isInMin = $(`#${idPrefix}-hours-minutes-dropdown-btn`).text().replaceAll(/\s/g, "") === "Minuten"; + const isInMin = getIsZeiterfassungseinheitInMinutes();//hoursMinutesDropdown.length && hoursMinutesDropdown.text().replaceAll(/\s/g, "") === "Minuten" || 0 === hoursMinutesDropdown.length; const startTimeCondition = startTimeInput.val().length > 0; const endTimeCondition = endTimeInput.val().length > 0; diff --git a/BeWoPlanerMobil/Scripts/ownSoft-Scripts/view-scripts/main.js b/BeWoPlanerMobil/Scripts/ownSoft-Scripts/view-scripts/main.js index 25421d09e..04bf6b4e1 100644 --- a/BeWoPlanerMobil/Scripts/ownSoft-Scripts/view-scripts/main.js +++ b/BeWoPlanerMobil/Scripts/ownSoft-Scripts/view-scripts/main.js @@ -269,7 +269,7 @@ function getDokuTexte(prefix) { x += ", "; } } - } catch (error) { + } catch(error) { window.showErrorPopup(error); } finally { return noticeList; @@ -326,7 +326,6 @@ function checkNumberInput(inputId) { } // Wird bei der Validierung des Formulars benutzt -// ToDo: Umbauen zu JavaScript-Date-Objekt function getStartAndEndDate(prefix) { if(prefix === undefined || prefix === null) { prefix = ""; @@ -337,6 +336,19 @@ function getStartAndEndDate(prefix) { const startTimeInput = $(`#${prefix}-start-time-input`); const endTimeInput = $(`#${prefix}-end-time-input`); + return validateStartAndEndInputs(startDateInput, startTimeInput, endDateInput, endTimeInput, true, false); +} + +// ToDo: eine Validierungsmethode für alle Anwendungsfälle (Zeiterfassung, Abwesenheiten, Kalendertermine) +function validateStartAndEndInputs(startDateInput, startTimeInput, endDateInput, endTimeInput, isServiceRecord, hasOpenEnd) { + if(hasOpenEnd === undefined || hasOpenEnd === null) { + hasOpenEnd = false; + } + + if(isServiceRecord === undefined || isServiceRecord === null) { + isServiceRecord = false; + } + const startDate = new Date(startDateInput.val()); const startTime = startTimeInput.val(); @@ -347,13 +359,13 @@ function getStartAndEndDate(prefix) { const isEndDateValid = endDateInput.length ? false === isNaN(endDate.getTime()) : true; if(false === isStartDateValid && startTimeInput.length === 0 || false === isEndDateValid && endTimeInput.length === 0) { - return [new Date(`${startDate}T00:00:01`), new Date(`${endDate}T00:00:01`)]; + return [new Date(`${startDate}T00:00:0${(isServiceRecord ? "1" : "0")}`), new Date(`${endDate}T00:00:0${(isServiceRecord ? "1" : "0")}`)]; } const isStartTimeValid = startTime.length > 0; const isEndTimeValid = endTime.length > 0; - - if (false === isStartTimeValid || false === isStartDateValid || false === isEndTimeValid || false === isEndDateValid) { + + if(false === isStartTimeValid || false === isStartDateValid || false === isEndTimeValid || false === isEndDateValid) { return null; } @@ -361,7 +373,6 @@ function getStartAndEndDate(prefix) { } - function supportConceptSearchOnChange() { try { var text = $("#support-concept-search-input").val().toLowerCase(); diff --git a/BeWoPlanerMobil/Service/ASPHibernateSessionManager.cs b/BeWoPlanerMobil/Service/ASPHibernateSessionManager.cs index a98e72eb0..5068ce9fb 100644 --- a/BeWoPlanerMobil/Service/ASPHibernateSessionManager.cs +++ b/BeWoPlanerMobil/Service/ASPHibernateSessionManager.cs @@ -49,13 +49,22 @@ namespace BeWoPlanerMobil.Service var serverPath = HttpContext.Current.Server.MapPath(null); - serverPath = Path.Combine(serverPath, ConfigurationManager.AppSettings.Get("MultitenancyPath")); + var multitenancyPath = ConfigurationManager.AppSettings.Get("MultitenancyPath"); + var configFileName = $"{MobileSessionFacade.Tenant}.config"; - serverPath = Path.Combine(serverPath, MobileSessionFacade.Tenant + ".config"); + serverPath = Path.Combine(serverPath, multitenancyPath); + + serverPath = Path.Combine(serverPath, configFileName); if(!File.Exists(serverPath)) { - return null; + serverPath = HttpContext.Current.Server.MapPath(null); + serverPath = Path.Combine(serverPath, Path.Combine("..\\", Path.Combine(multitenancyPath, configFileName))); + + if(!File.Exists(serverPath)) + { + return null; + } } var config = new Configuration().Configure(serverPath).SetInterceptor(new MobileUpdInsInterceptor()).BuildSessionFactory(); diff --git a/BeWoPlanerMobil/Util/JsonCustomer.cs b/BeWoPlanerMobil/Util/JsonCustomer.cs index bee20bd36..53e9ed0b1 100644 --- a/BeWoPlanerMobil/Util/JsonCustomer.cs +++ b/BeWoPlanerMobil/Util/JsonCustomer.cs @@ -76,16 +76,16 @@ namespace BeWoPlanerMobil.Util public JsonCustomer(CustomerDC customer, List folderTree, Dictionary icd10Diagnosen) { - Krankenkasse = customer.HealthInsurance; + Krankenkasse = customer.HealthInsurance; Versichertennummer = customer.InsuranceNumber; Versichertenstatus = customer.VersichertenStatus; - HasDisabilities = customer.Disabilities.Any(); - SchwebiIsUnlimited = customer.AusweisUnbefristetGueltig == true ? "JA" : "NEIN"; + HasDisabilities = customer.Disabilities.Any(); + SchwebiIsUnlimited = customer.AusweisUnbefristetGueltig == true ? "JA" : "NEIN"; SchwebiGradDerBehinderung = customer.GradDerBehinderung; - SchwebiPflegegrad = customer.Pflegegrad?.ToString() ?? string.Empty; - SchwebiAktenzeichen = customer.AusweisAktenzeichen; - SchwebiMerkzeichen = string.Empty; + SchwebiPflegegrad = customer.Pflegegrad?.ToString() ?? string.Empty; + SchwebiAktenzeichen = customer.AusweisAktenzeichen; + SchwebiMerkzeichen = string.Empty; foreach(var mz in customer.MerkzeichenListe) { SchwebiMerkzeichen += $"{mz}; "; @@ -119,7 +119,7 @@ namespace BeWoPlanerMobil.Util Vorname = customer.FirstName; Nachname = customer.LastName; Alias = customer.CustomerAlias; - Geburtstag = customer.DateOfBirth?.ToShortDateString() ?? string.Empty; + Geburtstag = customer.DateOfBirth?.ToString("yyyy-MM-dd") ?? string.Empty; switch(customer.Sex) { diff --git a/BeWoPlanerMobil/Views/Customer/Customer.cshtml b/BeWoPlanerMobil/Views/Customer/Customer.cshtml index a69a055b9..69d9b24fd 100644 --- a/BeWoPlanerMobil/Views/Customer/Customer.cshtml +++ b/BeWoPlanerMobil/Views/Customer/Customer.cshtml @@ -10,7 +10,6 @@ diff --git a/BeWoPlanerMobil/Views/Shared/_Layout.cshtml b/BeWoPlanerMobil/Views/Shared/_Layout.cshtml index 1bbe5fd49..49f634e5a 100644 --- a/BeWoPlanerMobil/Views/Shared/_Layout.cshtml +++ b/BeWoPlanerMobil/Views/Shared/_Layout.cshtml @@ -92,6 +92,12 @@ new Script { ExtensionSuite = ExtensionSuite.Icons }, new Script { ExtensionType = ExtensionType.WebDocumentViewer } ) + + - + From ecb387c20ee6527f080072c2bcc75353c342ceae Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 22 May 2025 17:31:17 +0200 Subject: [PATCH 4/6] - Generisches Ersetzen von Platzhaltern eingebaut --- .../EmployeePlaceholderManager.cs | 12 +++--- .../Dokumentverwaltung/PlaceholderManager.cs | 42 ++++++++++++++++--- 2 files changed, 42 insertions(+), 12 deletions(-) diff --git a/Service/Dokumentverwaltung/EmployeePlaceholderManager.cs b/Service/Dokumentverwaltung/EmployeePlaceholderManager.cs index 9eabc15ef..3b1ac81a0 100644 --- a/Service/Dokumentverwaltung/EmployeePlaceholderManager.cs +++ b/Service/Dokumentverwaltung/EmployeePlaceholderManager.cs @@ -28,12 +28,12 @@ namespace BeWo.Service.Dokumentverwaltung Children = new List(), IconType = "UserGroupHome24bw" }; - employeedaten.Children.Add(new PlatzhalterDC { Bezeichnung = "Vorname", Platzhalter = "MaVorname", FieldName = "Employee.Person.FirstName", IconType = "AB" }); - employeedaten.Children.Add(new PlatzhalterDC { Bezeichnung = "Nachname", Platzhalter = "MaNachname", FieldName = "Employee.Person.LastName", IconType = "AB" }); - employeedaten.Children.Add(new PlatzhalterDC { Bezeichnung = "Telefon", Platzhalter = "MaTelefon", FieldName = "Employee.Person.Phone", IconType = "AB" }); - employeedaten.Children.Add(new PlatzhalterDC { Bezeichnung = "Fax", Platzhalter = "MaFax", FieldName = "Employee.Person.Fax", IconType = "AB" }); - employeedaten.Children.Add(new PlatzhalterDC { Bezeichnung = "E-Mail", Platzhalter = "MaEmail", FieldName = "Employee.Person.Mail", IconType = "AB" }); - employeedaten.Children.Add(new PlatzhalterDC { Bezeichnung = "Handy", Platzhalter = "MaHandy", FieldName = "Employee.Person.Mobile", IconType = "AB" }); + employeedaten.Children.Add(new PlatzhalterDC { Bezeichnung = "Vorname", Platzhalter = "MaVorname", FieldName = "Person.FirstName", IconType = "AB" }); + employeedaten.Children.Add(new PlatzhalterDC { Bezeichnung = "Nachname", Platzhalter = "MaNachname", FieldName = "Person.LastName", IconType = "AB" }); + employeedaten.Children.Add(new PlatzhalterDC { Bezeichnung = "Telefon", Platzhalter = "MaTelefon", FieldName = "Person.Phone", IconType = "AB" }); + employeedaten.Children.Add(new PlatzhalterDC { Bezeichnung = "Fax", Platzhalter = "MaFax", FieldName = "Person.Fax", IconType = "AB" }); + employeedaten.Children.Add(new PlatzhalterDC { Bezeichnung = "E-Mail", Platzhalter = "MaEmail", FieldName = "Person.Mail", IconType = "AB" }); + employeedaten.Children.Add(new PlatzhalterDC { Bezeichnung = "Handy", Platzhalter = "MaHandy", FieldName = "Person.Mobile", IconType = "AB" }); liste.Add(employeedaten); diff --git a/Service/Dokumentverwaltung/PlaceholderManager.cs b/Service/Dokumentverwaltung/PlaceholderManager.cs index cf5343c54..b0589f2ef 100644 --- a/Service/Dokumentverwaltung/PlaceholderManager.cs +++ b/Service/Dokumentverwaltung/PlaceholderManager.cs @@ -69,15 +69,45 @@ namespace BeWo.Service.Dokumentverwaltung public virtual String GetPlaceholderValue(PlatzhalterDC ph, Object obj) { - var props = obj.GetType().GetProperties(); - - - return ""; + return GetPlaceholderValue(ph.FieldName, obj); } - public virtual String GetPlaceholderValue(String FieldName, Object obj) + public virtual String GetPlaceholderValue(String fieldName, Object obj) { - var props = obj.GetType().GetProperties(); + var names = fieldName.Split('.'); + + if (names.Length > 0) + { + var prop = obj.GetType().GetProperty(names[0]); + + if (prop != null) + { + Object newObj = prop.GetValue(obj); + + + if (names.Length > 1 && newObj != null) + { + String newFieldname = ""; + + for (int i = 1; i < names.Length; i++) + { + if (newFieldname.Length > 0) + { + newFieldname += "."; + } + newFieldname += names[i]; + } + + return GetPlaceholderValue(newFieldname, newObj); + } + if (newObj != null) + { + return newObj.ToString(); + } + + } + } + return ""; From 68cbc2d48c125d9312298bf0ae80d415557bff56 Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 23 May 2025 09:57:27 +0200 Subject: [PATCH 5/6] - Bugfix Leistungsnachweis Bad Kreuznach FUD --- .../Service/FfStundenuebersichtAuswertung.cs | 2 +- .../Invoicing/CustomInvoiceCreation.cs | 2 +- .../Reporting/Reports/LeistungsnachweisAmbDienst.cs | 5 +++-- .../Service/CustomStundenuebersichtAuswertung.cs | 2 +- .../Service/CustomStundenuebersichtAuswertung.cs | 3 ++- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ReportImp/FreundeskreisSuchthilfe/Service/FfStundenuebersichtAuswertung.cs b/ReportImp/FreundeskreisSuchthilfe/Service/FfStundenuebersichtAuswertung.cs index a212012a4..2d8aab5f5 100644 --- a/ReportImp/FreundeskreisSuchthilfe/Service/FfStundenuebersichtAuswertung.cs +++ b/ReportImp/FreundeskreisSuchthilfe/Service/FfStundenuebersichtAuswertung.cs @@ -64,7 +64,7 @@ namespace FreundeskreisSuchthilfe.Service } } - public override bool AllowCustomerAnalysis(Customer customer, FLSAnalysisConfigDC config, IList serviceRecords) + public override bool AllowCustomerAnalysis(Customer customer, FLSAnalysisConfigDC config, IList serviceRecords) { if (config.EmployeeOid != null) { diff --git a/ReportImp/LebenshilfeBadKreuznachFUD/Invoicing/CustomInvoiceCreation.cs b/ReportImp/LebenshilfeBadKreuznachFUD/Invoicing/CustomInvoiceCreation.cs index b1ea13863..aca687676 100644 --- a/ReportImp/LebenshilfeBadKreuznachFUD/Invoicing/CustomInvoiceCreation.cs +++ b/ReportImp/LebenshilfeBadKreuznachFUD/Invoicing/CustomInvoiceCreation.cs @@ -163,7 +163,7 @@ namespace LebenshilfeBadKreuznachFUD.Invoicing } } - private object CreateHausbesuchspauschale(List serviceRecordsInPeriod, DateTimeSpan invoicePeriod, SupportConceptApprovalPeriod scap) + private IList CreateHausbesuchspauschale(List serviceRecordsInPeriod, DateTimeSpan invoicePeriod, SupportConceptApprovalPeriod scap) { IList items = new List(); decimal wegepauschale = 7.45m; diff --git a/ReportImp/LebenshilfeBadKreuznachFUD/Reporting/Reports/LeistungsnachweisAmbDienst.cs b/ReportImp/LebenshilfeBadKreuznachFUD/Reporting/Reports/LeistungsnachweisAmbDienst.cs index 73be71e5d..6b631a026 100644 --- a/ReportImp/LebenshilfeBadKreuznachFUD/Reporting/Reports/LeistungsnachweisAmbDienst.cs +++ b/ReportImp/LebenshilfeBadKreuznachFUD/Reporting/Reports/LeistungsnachweisAmbDienst.cs @@ -27,7 +27,7 @@ namespace LebenshilfeBadKreuznachFUD.Reporting.Reports var sonderFerienDict = GetOrganisationFeiertage(org); - pRO.CreateDummyEntries(true); + pRO.CreateDummyEntries(false); @@ -37,7 +37,8 @@ namespace LebenshilfeBadKreuznachFUD.Reporting.Reports if (vs.IstFeiertag(item.StartDate)) { //item.Notice = vs.GetFeiertage() - item.Notice = vs.GetFeiertag(item.StartDate).Name; + + item.Notice = vs.GetFeiertag(item.StartDate.Date)?.Name; } else { diff --git a/ReportImp/PflegedienstWessel/Service/CustomStundenuebersichtAuswertung.cs b/ReportImp/PflegedienstWessel/Service/CustomStundenuebersichtAuswertung.cs index dae0a8e19..1233457a3 100644 --- a/ReportImp/PflegedienstWessel/Service/CustomStundenuebersichtAuswertung.cs +++ b/ReportImp/PflegedienstWessel/Service/CustomStundenuebersichtAuswertung.cs @@ -19,7 +19,7 @@ namespace PflegedienstWessel.Service { public class CustomStundenuebersichtAuswertung : StundenuebersichtAuswertung { - protected override ServiceRecordFLSOverviewDC CreateServiceRecordFLSOverviewDC(ServiceRecord sr, bool useGroupInfo, bool useRoundedDuration, bool showGroupMinutes) + protected override ServiceRecordFLSOverviewDC CreateServiceRecordFLSOverviewDC(IServiceRecord sr, bool useGroupInfo, bool useRoundedDuration, bool showGroupMinutes) { var dc = base.CreateServiceRecordFLSOverviewDC(sr, useGroupInfo, useRoundedDuration, showGroupMinutes); diff --git a/ReportImp/SPZLeverkusen/Service/CustomStundenuebersichtAuswertung.cs b/ReportImp/SPZLeverkusen/Service/CustomStundenuebersichtAuswertung.cs index c6bbe3699..b8b71d2dc 100644 --- a/ReportImp/SPZLeverkusen/Service/CustomStundenuebersichtAuswertung.cs +++ b/ReportImp/SPZLeverkusen/Service/CustomStundenuebersichtAuswertung.cs @@ -64,7 +64,8 @@ namespace SPZLeverkusen.Service } } - public override bool AllowCustomerAnalysis(Customer customer, FLSAnalysisConfigDC config, IList serviceRecords) + + public override bool AllowCustomerAnalysis(Customer customer, FLSAnalysisConfigDC config, IList serviceRecords) { if (config.EmployeeOid != null) { From 792651a89f17e8179ea39054bdc4eda5dbf4d057 Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Fri, 23 May 2025 11:12:15 +0200 Subject: [PATCH 6/6] Mike sum als json, nicht mehr direkt --- .../ServiceImplementations/AdminServiceImp.cs | 5 +++- Shared/Core/JsonUtils.cs | 29 +++++++++++++++++++ Shared/Shared.csproj | 1 + 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 Shared/Core/JsonUtils.cs diff --git a/Service/ServiceImplementations/AdminServiceImp.cs b/Service/ServiceImplementations/AdminServiceImp.cs index d9d7490e9..d5cc90488 100644 --- a/Service/ServiceImplementations/AdminServiceImp.cs +++ b/Service/ServiceImplementations/AdminServiceImp.cs @@ -3,6 +3,7 @@ using BeWo.Service.ServiceContracts; using BS.Shared.Core; using BS.Shared.DataContracts.AdminService; using DevExpress.Pdf.Native.BouncyCastle.Ocsp; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; @@ -44,7 +45,9 @@ namespace BeWo.Service.ServiceImplementations var sum = DAOFactory.ScriptDAO.GetGkvSumByDateRange(start, end); - return sum?.ToString("0.00"); + var json = JsonUtils.ToSimpleJson("sum", sum); + + return json; } } } diff --git a/Shared/Core/JsonUtils.cs b/Shared/Core/JsonUtils.cs new file mode 100644 index 000000000..e5ffab409 --- /dev/null +++ b/Shared/Core/JsonUtils.cs @@ -0,0 +1,29 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BS.Shared.Core +{ + public static class JsonUtils + { + public static string ToSimpleJson(string key, object value) + { + var dict = new Dictionary() + { + {key, value } + }; + + return JsonConvert.SerializeObject(dict); + } + + public static string ToJson(Dictionary dict) + { + var json = JsonConvert.SerializeObject(dict); + + return json; + } + } +} diff --git a/Shared/Shared.csproj b/Shared/Shared.csproj index d0fefee7c..832475890 100644 --- a/Shared/Shared.csproj +++ b/Shared/Shared.csproj @@ -140,6 +140,7 @@ +