From 747fc9008e83770d20f387543715912331cb9e32 Mon Sep 17 00:00:00 2001 From: phantomix Date: Tue, 18 Jan 2022 23:31:03 +0100 Subject: [PATCH] 2022-01-07PX reordered program configuration in preparation to separate settings for local, db --- Program.cs | 17 +------------ model/Configuration.cs | 54 ++++++++++++++++++++++++++---------------- 2 files changed, 35 insertions(+), 36 deletions(-) diff --git a/Program.cs b/Program.cs index 4aa185a..94e1250 100644 --- a/Program.cs +++ b/Program.cs @@ -14,31 +14,16 @@ TODO - Documentation - ErrorLog for all errors - frmMain: Menu option to miss an MV for selected/checked users -- FormMail: Add mail for automatic member type setting to "Foerdermitglied" -- FormMail: Membership type was changed manually -- FormMail: Cronjob found unassigned MoneyTransfers -- frmEditEntry: Optional (checkbox) request for a comment on data changes, when hitting OK - frmMain: Indicator that the data was modified after import + messagebox to remind user to export on quitting. -- add "database changed since last import/export" warning (e.g. you forgot to push your changes) -- frmMain: Member List: Column "monthly fee", Column "Last payment", disabled by default - Configuration window: MoneyTransferRegEx -- Bug: Generating testdata doesn't remove old xml files, thus the memberlist will be mixed after next restart -- Bug: Member list not reloaded after ProcessCSV (balance display is wrong) - Bug: Import/Export gpg uses command line parameter for password - this can be read out by any system user via "ps uxa" - CronjobConfig -- CustomListView: implement generic filtering - -- Improve import/export handling, e.g. check for newer database on program start -- Debt handling: Store explicit flags or status for "one month behind" -or "two months behind", in order to have an escalation chain - -- PGP for mails */ namespace dezentrale { public class Program { - public static uint VersionNumber { get; private set; } = 0x21052800; + public static uint VersionNumber { get; private set; } = 0x22010700; public static string VersionString { get; private set; } = $"{VersionNumber:x}"; public static string AppData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); diff --git a/model/Configuration.cs b/model/Configuration.cs index ea3f6e0..2646b83 100644 --- a/model/Configuration.cs +++ b/model/Configuration.cs @@ -8,19 +8,10 @@ namespace dezentrale.model { public class Configuration : XmlData { + //Program-wide configuration (single-instance settings in main configuration) [XmlElement] public ConfigSmtp Smtp { get; set; } = new ConfigSmtp(); - [XmlElement] public ConfigVSMail VS { get; set; } = new ConfigVSMail(); - [XmlElement] public MemberImportExport ImportExport{ get; set; } = new MemberImportExport(); - - [XmlElement] public string DbDirectory { get; set; } = DefaultDbDirectory; - //[XmlElement] public string DbBackupDirectory { get; set; } = DefaultDbBackupDirectory; - //[XmlElement] public string ImportExportDirectory { get; set; } = DefaultImportExportDirectory; - [XmlElement] public uint RegularPaymentAmount { get; set; } = 3200; //cents - [XmlElement] public string RegularPaymentCurrency { get; set; } = "EUR"; - [XmlElement] public string LocalUser { get; set; } = "John Doe"; - [XmlElement] public string KeylockCombination { get; set; } = "0000"; - - + [XmlElement] public string LocalUser { get; set; } = "John Doe"; + //UI: lstMembers: Columns [XmlElement("MemberListColumn")] public List MemberListColumns { get; set; } = new List(); [XmlElement("MTListColumn")] public List MTListColumns { get; set; } = new List(); @@ -29,19 +20,42 @@ namespace dezentrale.model public List MvInvitationsListColumns{ get; set; } = new List(); [XmlElement("AttachmentsColumn")]public List AttachmentsColumns{ get; set; } = new List(); [XmlElement("SelectFieldsColumn")]public List SelectFieldsColumns{ get; set; } = new List(); - - public List MemberCsvExportFields { get; set; } = new List(); - - [XmlElement] public List MoneyTransferRegEx { get; set; } = new List(); //This doesn't belong here! Move to new file within db-data! - [XmlElement] public DateTime LastCronjobRun { get; set; } = DateTime.Now; //This doesn't belong here! Move to new file within db-data! + [XmlIgnore] public static string DefaultDbDirectory { get; private set; } = "db-data"; + //[XmlIgnore] public static string DefaultDbBackupDirectory { get; private set; } = "db-backup"; + //[XmlIgnore] public static string DefaultImportExportDirectory { get; private set; } = "import-export"; + + + + + //Program-wide db metadata (multiple sub-objects in main configuration) + [XmlElement] public string DbDirectory { get; set; } = DefaultDbDirectory; + //[XmlElement] public string DbBackupDirectory { get; set; } = DefaultDbBackupDirectory; + //[XmlElement] public string ImportExportDirectory { get; set; } = DefaultImportExportDirectory; + [XmlElement] public DateTime LastDbLocalChange { get; set; } [XmlElement] public DateTime LastDbExport { get; set; } [XmlElement] public DateTime LastDbImport { get; set; } [XmlElement] public bool DbChangedSinceExport { get; set; } = false; + public List MemberCsvExportFields { get; set; } = new List(); + + + [XmlElement] public MemberImportExport ImportExport { get; set; } = new MemberImportExport(); + + + + + //db-wide configuration (in DB folder) + [XmlElement("VS")] public ConfigVSMail VS { get; set; } = new ConfigVSMail(); + [XmlElement] public ConfigVSMail Schatzmeister { get; set; } = new ConfigVSMail(); + + [XmlElement] public uint RegularPaymentAmount { get; set; } = 3200; //cents + [XmlElement] public string RegularPaymentCurrency { get; set; } = "EUR"; + [XmlElement] public string KeylockCombination { get; set; } = "0000"; + + [XmlElement] public List MoneyTransferRegEx { get; set; } = new List(); //This doesn't belong here! Move to new file within db-data! + [XmlElement] public DateTime LastCronjobRun { get; set; } = DateTime.Now; //This doesn't belong here! Move to new file within db-data! + - [XmlIgnore] public static string DefaultDbDirectory { get; private set; } = "db-data"; - //[XmlIgnore] public static string DefaultDbBackupDirectory { get; private set; } = "db-backup"; - //[XmlIgnore] public static string DefaultImportExportDirectory { get; private set; } = "import-export"; } }