diff --git a/DataStore/DataStructures.cs b/DataStore/DataStructures.cs index 6c81528..b082d93 100644 --- a/DataStore/DataStructures.cs +++ b/DataStore/DataStructures.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading.Tasks; namespace Logof_Client; @@ -32,11 +33,16 @@ public class KasAddressList //Address-Set this.owner_id = owner_id; } - public static string GenerateName(string basic_type, bool? is_rest = false) + public static async Task GenerateName(string basic_type, bool? is_rest = false) { + string pre = ""; + if (is_rest == true) return basic_type + " - " + DateTime.Now.ToShortDateString() + " - Rest"; - return basic_type + " - " + DateTime.Now.ToShortDateString(); + pre = basic_type + " - " + DateTime.Now.ToShortDateString(); + + var result = await NamingWindow.Show(MainWindow._instance, pre); + return string.IsNullOrWhiteSpace(result) ? pre : result; } // public void UpdateErrorList(List errorList) @@ -206,4 +212,4 @@ public class KasPersonError return output; } -} \ No newline at end of file +} diff --git a/DataStore/Settings.cs b/DataStore/Settings.cs index 5443e03..95bdb8b 100644 --- a/DataStore/Settings.cs +++ b/DataStore/Settings.cs @@ -10,6 +10,7 @@ public class Settings public static Settings _instance = new(); public AddressSets addressSets = new(); public Customers customers = new(); + public PdfExportSettings pdfExport { get; set; } = new(); public string settingsPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "logofclient", "config.json"); @@ -52,6 +53,25 @@ public class Settings } } +public class PdfExportSettings +{ + public double cellPaddingTopMm { get; set; } = 5; + public double cellPaddingBottomMm { get; set; } = 5; + public double cellPaddingLeftMm { get; set; } = 5; + public double cellPaddingRightMm { get; set; } = 5; + + public double pageMarginTopMm { get; set; } = 0; + public double pageMarginBottomMm { get; set; } = 0; + public double pageMarginLeftMm { get; set; } = 0; + public double pageMarginRightMm { get; set; } = 0; + + public int rowsPerPage { get; set; } = 7; + public int columnsPerPage { get; set; } = 3; + + public double fontSize { get; set; } = 9; + public double smallFontSize { get; set; } = 6; +} + public class Global { public static Global _instance; @@ -191,4 +211,4 @@ public class Country return null; } -} \ No newline at end of file +} diff --git a/MainWindow.axaml b/MainWindow.axaml index 006f2b5..74a96f0 100644 --- a/MainWindow.axaml +++ b/MainWindow.axaml @@ -28,7 +28,7 @@