Files
BeWoPlaner/BeWoPlanerMobil/Models/DevToolsModel.cs

146 lines
5.6 KiB
C#

using System;
using System.Collections.Generic;
using BS.Shared;
using BS.Shared.DataContracts;
using BS.Shared.Extensions;
namespace BeWoPlanerMobil.Models
{
public class DevToolsModel : AbstractModel
{
// Rechtegruppen
// Benutzer
// Rechte und deren Übersetzungen
// Mandatorsettings
// Klienten, Mitarbeiter, Hilfepläne + Bewilligungen mit Zielen und gegebenenfalls individuelle Ziele erzeugen
public List<UserGroupDC> UserGroups { get; set; } = new List<UserGroupDC>();
public List<UserRightType> UserRightTypes { get; set; } = new List<UserRightType>();
public List<UserDC> Users { get; set; } = new List<UserDC>();
public MandatorSettings MandatorSettings { get; set; }
}
public class MandatorSettings
{
public MandatorSettings(string settingsString)
{
var bananaSplit = settingsString.Split(';');
foreach(var setting2Value in bananaSplit)
{
var split2 = setting2Value.Split('=');
this[split2[0]] = split2[1];
}
}
public object this[string propertyName]
{
get => typeof(MandatorSettings).GetPropertyValue(propertyName);
set
{
var propertyInfo = typeof(MandatorSettings).GetProperty(propertyName);
if(propertyInfo is null)
{
return;
}
if(value is null)
{
typeof(MandatorSettings).SetPropertyValue(propertyName, value);
return;
}
var propertyType = propertyInfo.PropertyType;
var valueToReplace = value;
if(propertyType == typeof(bool))
{
typeof(MandatorSettings).SetPropertyValue(propertyName, value.ToString() == "1");
}
else
{
try
{
valueToReplace = Convert.ChangeType(value, propertyType);
}
catch(Exception exception)
{
valueToReplace = value;
}
finally
{
typeof(MandatorSettings).SetPropertyValue(propertyName, valueToReplace);
var setValue = typeof(MandatorSettings).GetPropertyValue(propertyName);
}
}
}
}
public Dictionary<string, string> PossibleServiceRecordUnits { get; set; } = new Dictionary<string, string>
{
{"0", "Minuten"},
{"1", "Stunden"},
{"2", "Stunden und Minuten"}
};
public bool HideServiceRecordInsertedByAndInsertedOn { get; set; }
public bool IsEndDateVisible { get; set; }
public bool IsServiceRecordNoticeMandatory { get; set; }
public bool IsZeiterfassDateNormal { get; set; }
public bool SetStartTimeToEndTimeAfterSave { get; set; }
public bool ShowAdditionalService { get; set; }
public bool ShowAnnualReport { get; set; }
public bool ShowArbeitszeiten { get; set; }
public bool ShowBetrag { get; set; }
public bool ShowChat { get; set; }
private bool _ShowCustomerDistanceFields;
public bool ShowCustomerDistanceFields
{
get => _ShowCustomerDistanceFields;
set => _ShowCustomerDistanceFields = value;
}
public bool ShowDatevFields { get; set; }
public bool ShowDienstplanung { get; set; }
public bool ShowDistanceFields { get; set; }
public bool ShowEmployeeSignature { get; set; }
public bool ShowHilfeplanBezeichnung { get; set; }
public bool ShowHilfeplanStatistikReport { get; set; }
public bool ShowInfoButtonInCalender { get; set; }
public bool ShowKlientenBetreuungszeiten { get; set; }
public bool ShowMarker { get; set; }
public bool ShowMedication { get; set; }
public bool ShowMultipleResourceColors { get; set; }
public bool ShowOnlyMySupportConcepts { get; set; }
public bool ShowOwnChatSettings { get; set; }
public bool ShowPivotGrid { get; set; }
public bool ShowRoundedDurationInEmployeeAnalysis { get; set; }
public bool ShowRtfTextfield { get; set; }
public bool ShowScheduler { get; set; }
public bool ShowServicesOverviewHalfOrWholeMonth { get; set; }
public bool ShowSignature { get; set; }
public bool ShowTeamNews { get; set; }
public bool ShowUrlaubsplanung { get; set; }
public bool ShowWohnheime { get; set; }
public bool AllowStorno { get; set; }
public bool DontShowSpitzabrechnung { get; set; }
public bool IsOnlyYearMonthVisible { get; set; }
public bool IsPasswordSecurityActiv { get; set; }
public bool PrinterSettingsUseLandscape { get; set; }
public bool PrinterSettingsUseMargins { get; set; }
public bool PrinterSettingsUsePaperKind { get; set; }
public bool ShowResources { get; set; }
public int MaxDaysEditServiceRecordsAllowed { get; set; }
public int ZeiterfassungsSchwellwert { get; set; }
public int AnzTageZeiterfassErfolgt { get; set; }
public int DienstplanungStandardZeilenAnzahl { get; set; }
public int HilfeplanAuslaufAuswahl { get; set; }
public int TimeUntilUILock { get; set; }
public int EinheitZeiterfassung { get; set; }
}
}