User Settings auf Server eingebaut für LH Bad Kreuznach Statistik

This commit is contained in:
2026-01-20 17:38:04 +01:00
parent ed516ba18b
commit cd6c340939
3 changed files with 51 additions and 2 deletions

View File

@@ -38,6 +38,15 @@ namespace LebenshilfeBadKreuznachFUD.Statistics
}
public override ServiceRecordStatisticsInfoDC GetServiceRecordStatisticInfo(long costBearer2SupportConceptOid, DateTime statisticsDate)
{
var appSettings = BeWo.Service.Configuration.AppSettings.GetUserAppSettings();
if (appSettings.LastSelectedServiceRecordTimeInterval == ServiceRecordTimeInterval.Monatsauswahl)
{
var selectedMonth = appSettings.LastSelectedServiceRecordMonth;
statisticsDate = selectedMonth.AddMonths(1).AddDays(-1);
}
var stats = CreateSupportConceptStatisticsImpl(costBearer2SupportConceptOid, statisticsDate);
int rowCount = 4;

View File

@@ -2,6 +2,8 @@
using System.Collections.Generic;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Data.Security;
using BeWo.Service.DCEntityMapper;
using BS.Shared;
using BS.Shared.Core;
@@ -76,6 +78,11 @@ namespace BeWo.Service.Configuration
public DateTime? StartStundenkonto { get; set; }
public ServiceRecordTimeInterval LastSelectedServiceRecordTimeInterval { get; set; } = ServiceRecordTimeInterval.All;
public int LastSelectedServiceRecordTimeIntervalDays { get; set; } = 7;
public DateTime LastSelectedServiceRecordMonth { get; set; } = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
public static AppSettings CreateSettings()
{
@@ -313,11 +320,43 @@ namespace BeWo.Service.Configuration
settings.ShowAdditionalService = showAdditionalService;
settings.ShowRoundedDurationInEmployeeAnalysis = showRoundedDurationInEmployeeAnalysis;
settings.SortServiceDescriptionAlphabetically = sortServiceDescriptionAlphabetically;
return settings;
}
public static Mandator GetMandatorEntity()
public static AppSettings GetUserAppSettings()
{
AppSettings settings = new AppSettings();
var user = UserRightHelper.GetLoggedInUser();
if (user != null)
{
var settingsList = MapperFactory.SettingsDC_Settings.MapToNewDCs(user.SettingList);
var val = UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, SettingsKeys.LastSelectedServiceRecordTimeInterval, settingsList);
if (int.TryParse(val, out var result))
{
settings.LastSelectedServiceRecordTimeInterval = (ServiceRecordTimeInterval)result;
}
val = UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, SettingsKeys.LastSelectedServiceRecordTimeIntervalDays, settingsList);
if (val != null)
{
settings.LastSelectedServiceRecordTimeIntervalDays = Convert.ToInt32(UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, SettingsKeys.LastSelectedServiceRecordTimeIntervalDays, settingsList));
}
val = UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, SettingsKeys.LastSelectedServiceRecordMonth, settingsList);
if (val != null)
{
settings.LastSelectedServiceRecordMonth = Convert.ToDateTime(UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, SettingsKeys.LastSelectedServiceRecordMonth, settingsList));
}
}
return settings;
}
public static Mandator GetMandatorEntity()
{
var manList = DAOFactory.GenericDAO.GetAll<Mandator>();
Mandator man;

View File

@@ -42,6 +42,7 @@ namespace BS.Shared.Core
public static string ShowServiceRecordGridControl => "ShowServiceRecordGridControl";
public static string StartupPanelMaximized => "StartupPanelMaximized";
public static string HideServiceRecordInsertedByAndInsertedOn => "HideServiceRecordInsertedByAndInsertedOn";
public static string ShowAlwaysHoursInEmployeeView => "ShowAlwaysHoursInEmployeeView";
public static string DocumentationFontSize => "DocumentationFontSize";
public static string ZeigeNurMeineTermine => "ZeigeNurMeineTermine";
public static string LastSelectedServiceRecordTimeIntervalDays => "LastSelectedServiceRecordTimeIntervalDays";