Files
BeWoPlaner/BeWo/Core/Config/AppSettings.cs

524 lines
15 KiB
C#

using System;
using System.Collections.Generic;
using BeWo.View.Navigation.Filter;
using BS.Shared;
using DevExpress.Xpf.Scheduling;
using DevExpress.XtraScheduler;
namespace BeWo.Core.Config
{
public class AppSettings
{
private bool mIsServiceRecordNoticeMandatory = true;
private bool mIsPasswordSecurityActiv = false;
private bool mIsEndDateVisible = true;
private bool misOnlyYearMonthVisible = true;
private bool misZeiterfassDateNormal = true;
private String einheitZeiterfassung = "0";
private CustomerFilterEnum _CustomerFilterInZeiterfassung = CustomerFilterEnum.All;
private CustomerFilterEnum _CustomerFilterSupportConcepts = CustomerFilterEnum.All;
private CustomerFilterEnum _CustomerFilterCustomers = CustomerFilterEnum.All;
private bool _showExpiredSupportConcepts = true;
private bool _showServiceRecordGridControl = true;
private bool _filterGroupServiceCategories = true;
private WindowStateType mWindowStateType = WindowStateType.Default;
private ServiceRecordTimeInterval mLastSelectedServiceRecordTimeInterval = ServiceRecordTimeInterval.All;
private int mLastSelectedServiceRecordTimeIntervalDays = 7;
private int mServiceRecordAllowChangeHours = 24;
private DateTime mLastSelectedServiceRecordMonth = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
private int mLastKassenSortOrder = 1;
private ZeiterfassungsDauer mLetzteZeiterfassungsDauer = ZeiterfassungsDauer.Minuten;
public enum WindowStateType
{
Default,
Maximised
}
public AppSettings()
{
DienstplanungStandardZeilenAnzahl = 1;
}
public int MoKSessionTimeout { get; set; } = 20;
public bool IsServiceRecordNoticeMandatory
{
get { return mIsServiceRecordNoticeMandatory; }
set { mIsServiceRecordNoticeMandatory = value; }
}
public bool IsPasswordSecurityActiv
{
get { return mIsPasswordSecurityActiv; }
set { mIsPasswordSecurityActiv = value; }
}
public bool IsEndDateVisible
{
get { return mIsEndDateVisible; }
set { mIsEndDateVisible = value; }
}
public bool IsOnlyYearMonthVisible
{
get { return misOnlyYearMonthVisible; }
set { misOnlyYearMonthVisible = value; }
}
public bool IsZeiterfassDateNormal
{
get { return misZeiterfassDateNormal; }
set { misZeiterfassDateNormal = value; }
}
public String EinheitZeiterfassung
{
get { return einheitZeiterfassung; }
set { einheitZeiterfassung = value; }
}
public ZeiterfassungsDauer LetzteZeiterfassungsDauer
{
get { return mLetzteZeiterfassungsDauer; }
set
{
if (mLetzteZeiterfassungsDauer != value)
{
mLetzteZeiterfassungsDauer = value;
IsDirty = true;
}
}
}
public int MaxDaysEditServiceRecordsAllowed { get; set; }
public int HilfeplanAuslaufAuswahl { get; set; }
public int LastSelectedStundenkontoIntervall { get; set; }
public int AnzTageZeiterfassErfolgt { get; set; }
public int ZeiterfassungsSchwellwert { get; set; }
public bool HideServiceRecordInsertedByAndInsertedOn { get; set; }
public bool ShowAdvisedAttendedFlag { get; set; }
public CustomerFilterEnum CustomerFilterInZeiterfassung
{
get { return _CustomerFilterInZeiterfassung; }
set
{
if (_CustomerFilterInZeiterfassung != value)
{
_CustomerFilterInZeiterfassung = value;
IsDirty = true;
}
}
}
public CustomerFilterEnum CustomerFilterSupportConcepts
{
get { return _CustomerFilterSupportConcepts; }
set
{
if (_CustomerFilterSupportConcepts != value)
{
_CustomerFilterSupportConcepts = value;
IsDirty = true;
}
}
}
public CustomerFilterEnum CustomerFilterCustomers
{
get { return _CustomerFilterCustomers; }
set
{
if (_CustomerFilterCustomers != value)
{
_CustomerFilterCustomers = value;
IsDirty = true;
}
}
}
public bool ShowDatevFields { get; set; }
public bool ShowExpiredSupportConcepts
{
get { return _showExpiredSupportConcepts; }
set
{
if (_showExpiredSupportConcepts != value)
{
_showExpiredSupportConcepts = value;
IsDirty = true;
}
}
}
public bool ShowServiceRecordGridControl
{
get { return _showServiceRecordGridControl; }
set
{
if (_showServiceRecordGridControl != value)
{
_showServiceRecordGridControl = value;
IsDirty = true;
}
}
}
public bool ShowLargeCustomerNotice { get; set; }
public bool ZeigeNurMeineTermine
{
get { return mZeigeNurMeineTermine; }
set
{
if (mZeigeNurMeineTermine != value)
{
mZeigeNurMeineTermine = value;
IsDirty = true;
}
}
}
private double _DocumentationFontSize = 11d;
public double DocumentationFontSize
{
get { return _DocumentationFontSize; }
set
{
if (!_DocumentationFontSize.Equals(value))
{
_DocumentationFontSize = value;
IsDirty = true;
}
}
}
private string _startupPanelMaximized;
public string StartupPanelMaximized
{
get { return _startupPanelMaximized; }
set
{
string newValue = value;
if (newValue == string.Empty)
newValue = null;
if (_startupPanelMaximized != newValue)
{
_startupPanelMaximized = value;
IsDirty = true;
}
}
}
private List<string> _startupPanelOrder;
public List<string> StartupPanelOrder
{
get { return _startupPanelOrder; }
set
{
if (IsOrderDifferent(_startupPanelOrder, value))
{
_startupPanelOrder = value;
IsDirty = true;
}
}
}
private bool mZeigeNurMeineTermine;
private bool IsOrderDifferent(List<string> oldOrder, List<string> newOrder)
{
if (oldOrder == null && newOrder != null)
return true;
else if (oldOrder != null && newOrder == null)
return true;
else if (oldOrder != null && newOrder != null)
{
if (oldOrder.Count != newOrder.Count)
return true;
else
{
for (int i = 0; i < oldOrder.Count; i++)
{
if (newOrder[i] != oldOrder[i])
return true;
}
}
}
return false;
}
public WindowStateType WindowState
{
get { return mWindowStateType; }
set
{
if (mWindowStateType != value)
{
mWindowStateType = value;
IsDirty = true;
}
}
}
public ServiceRecordTimeInterval LastSelectedServiceRecordTimeInterval
{
get { return mLastSelectedServiceRecordTimeInterval; }
set
{
if (mLastSelectedServiceRecordTimeInterval != value)
{
mLastSelectedServiceRecordTimeInterval = value;
IsDirty = true;
}
}
}
public int LastSelectedServiceRecordTimeIntervalDays
{
get { return mLastSelectedServiceRecordTimeIntervalDays; }
set
{
if (mLastSelectedServiceRecordTimeIntervalDays != value)
{
mLastSelectedServiceRecordTimeIntervalDays = value;
IsDirty = true;
}
}
}
public DateTime LastSelectedServiceRecordMonth
{
get { return mLastSelectedServiceRecordMonth; }
set
{
if (mLastSelectedServiceRecordMonth != value)
{
mLastSelectedServiceRecordMonth = value;
IsDirty = true;
}
}
}
public int LastKassenSortOrder
{
get { return mLastKassenSortOrder; }
set
{
if (mLastKassenSortOrder != value)
{
mLastKassenSortOrder = value;
IsDirty = true;
}
}
}
public int ServiceRecordAllowChangeHours
{
get { return mServiceRecordAllowChangeHours; }
set
{
if (mServiceRecordAllowChangeHours != value)
{
mServiceRecordAllowChangeHours = value;
IsDirty = true;
}
}
}
public bool IsDirty { get; set; }
public string TimeRecordingMenuName { get; set; }
public bool ShowDistanceFields { get; set; }
public bool ShowBetrag { get; set; }
public bool ShowHilfeplanBezeichnung { get; set; }
public bool ShowArbeitszeiten { get; set; }
public bool ShowSignatures { get; set; }
public bool ShowRtfTextfield { get; set; }
public bool ShowTeamNews { get; set; }
public bool ShowMarker { get; set; }
public bool ShowAdditionalService { get; set; }
public bool ShowCustomerDistanceFields { get; set; }
public bool ShowRoundedDurationInEmployeeAnalysis { get; set; }
public bool ShowAnnualReport { get; set; }
public bool ShowRessources { get; set; }
public bool IsSchedulerAllowed { get; set; }
public bool IsWohnheimAllowed { get; set; }
public bool ShowOwnChat { get; set; }
public bool ShowOwnChatSettings { get; set; }
public bool IsMedicationAllowed { get; set; }
public bool PrinterSettingsUsePaperKind { get; set; }
public bool PrinterSettingsUseLandscape { get; set; }
public bool PrinterSettingsUseMargins { get; set; }
public bool ShowMultipleResourceColors { get; set; }
public bool ShowPivotGrid { get; set; }
public string ExpandedAdministrationItems { get; set; }
public bool ShowUrlaubsplanung { get; set; }
public bool DontShowSpitzabrechnung { get; set; }
public bool ShowDienstplanung { get; set; }
public bool ShowWorktime { get; set; }
public bool EnableArbeitszeiterfassung { get; set; }
public bool EnableAutomaticPauses { get; set; }
public bool EnableRestTimeWarning { get; set; }
public int MaxWorkTimeHoursBeforeWarning { get; set; }
public int DienstplanungStandardZeilenAnzahl { get; set; }
public bool ShowInfoButtonInCalender{ get; set; }
public bool AllowStorno { get; set; }
public bool UseDistanceApi { get; set; }
public bool ShowEmployeeSignature { get; set; }
public bool SetStartTimeToEndTimeAfterSave { get; set; }
public bool ShowHilfeplanStatistikReport { get; set; }
public bool ShowAI { get; set; }
public bool ShowAIInternal { get; set; }
public bool AllowGkvAbrechnung { get; set; }
public bool ShowImportAbschlagszahlungen { get; set; }
public bool ShowPersehImport { get; set; }
private SchedulerViewType _SchedulerViewType;
public SchedulerViewType SchedulerViewType
{
get => _SchedulerViewType;
set
{
if(_SchedulerViewType != value)
{
_SchedulerViewType = value;
IsDirty = true;
}
}
}
private ViewType _SchedulingViewType;
public ViewType SchedulingViewType
{
get => _SchedulingViewType;
set
{
if(_SchedulingViewType != value)
{
_SchedulingViewType = value;
IsDirty = true;
}
}
}
private int _SchedulerTimelineViewDayCount;
public int SchedulerTimelineViewDayCount
{
get => _SchedulerTimelineViewDayCount == 0 ? 10 : _SchedulerTimelineViewDayCount;
set
{
if(_SchedulerTimelineViewDayCount != value)
{
_SchedulerTimelineViewDayCount = value > 0 ? value : 10;
IsDirty = true;
}
}
}
private int _SchedulerDayViewDayCount;
public int SchedulerDayViewDayCount
{
get => _SchedulerDayViewDayCount == 0 ? 5 : _SchedulerDayViewDayCount;
set
{
if(_SchedulerDayViewDayCount != value)
{
_SchedulerDayViewDayCount = value > 0 ? value : 5;
IsDirty = true;
}
}
}
public bool ShowKlientenBetreuungszeiten { get; set; }
public bool FilterGroupServiceCategories
{
get { return _filterGroupServiceCategories; }
set { _filterGroupServiceCategories = value; }
}
}
}