From 11ea958059aafdae62960b46be48bef177610299 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Thu, 26 Oct 2023 23:27:28 +0200 Subject: [PATCH] Documents: restructure Documents/ directory --- Elwig/App.xaml.cs | 7 ++++--- .../{BusinessDocument.cshtml.cs => BusinessDocument.cs} | 0 Elwig/Documents/BusinessDocument.cshtml | 2 +- .../{style-businessdocument.css => BusinessDocument.css} | 0 .../{BusinessLetter.cshtml.cs => BusinessLetter.cs} | 0 Elwig/Documents/{CreditNote.cshtml.cs => CreditNote.cs} | 0 Elwig/Documents/CreditNote.cshtml | 2 +- Elwig/Documents/{style-creditnote.css => CreditNote.css} | 0 ...iveryConfirmation.cshtml.cs => DeliveryConfirmation.cs} | 0 Elwig/Documents/DeliveryConfirmation.cshtml | 2 +- ...e-deliveryconfirmation.css => DeliveryConfirmation.css} | 0 .../{DeliveryJournal.cshtml.cs => DeliveryJournal.cs} | 0 Elwig/Documents/DeliveryJournal.cshtml | 2 +- .../{style-deliveryjournal.css => DeliveryJournal.css} | 0 .../Documents/{DeliveryNote.cshtml.cs => DeliveryNote.cs} | 0 Elwig/Documents/DeliveryNote.cshtml | 2 +- .../Documents/{style-deliverynote.css => DeliveryNote.css} | 0 Elwig/Documents/{style-page.css => Document.Page.css} | 0 Elwig/Documents/{Document.cshtml.cs => Document.cs} | 1 + Elwig/Documents/Document.cshtml | 4 ++-- Elwig/Documents/{style.css => Document.css} | 0 Elwig/Documents/{Letterhead.cshtml.cs => Letterhead.cs} | 0 Elwig/{Documents => Helpers/Printing}/Html.cs | 2 +- Elwig/{Documents => Helpers/Printing}/Pdf.cs | 3 +-- 24 files changed, 14 insertions(+), 13 deletions(-) rename Elwig/Documents/{BusinessDocument.cshtml.cs => BusinessDocument.cs} (100%) rename Elwig/Documents/{style-businessdocument.css => BusinessDocument.css} (100%) rename Elwig/Documents/{BusinessLetter.cshtml.cs => BusinessLetter.cs} (100%) rename Elwig/Documents/{CreditNote.cshtml.cs => CreditNote.cs} (100%) rename Elwig/Documents/{style-creditnote.css => CreditNote.css} (100%) rename Elwig/Documents/{DeliveryConfirmation.cshtml.cs => DeliveryConfirmation.cs} (100%) rename Elwig/Documents/{style-deliveryconfirmation.css => DeliveryConfirmation.css} (100%) rename Elwig/Documents/{DeliveryJournal.cshtml.cs => DeliveryJournal.cs} (100%) rename Elwig/Documents/{style-deliveryjournal.css => DeliveryJournal.css} (100%) rename Elwig/Documents/{DeliveryNote.cshtml.cs => DeliveryNote.cs} (100%) rename Elwig/Documents/{style-deliverynote.css => DeliveryNote.css} (100%) rename Elwig/Documents/{style-page.css => Document.Page.css} (100%) rename Elwig/Documents/{Document.cshtml.cs => Document.cs} (99%) rename Elwig/Documents/{style.css => Document.css} (100%) rename Elwig/Documents/{Letterhead.cshtml.cs => Letterhead.cs} (100%) rename Elwig/{Documents => Helpers/Printing}/Html.cs (97%) rename Elwig/{Documents => Helpers/Printing}/Pdf.cs (98%) diff --git a/Elwig/App.xaml.cs b/Elwig/App.xaml.cs index f20aebc..ef69575 100644 --- a/Elwig/App.xaml.cs +++ b/Elwig/App.xaml.cs @@ -12,6 +12,7 @@ using System.Globalization; using System.Threading; using System.Windows.Markup; using System.Reflection; +using Elwig.Helpers.Printing; namespace Elwig { public partial class App : Application { @@ -45,7 +46,7 @@ namespace Elwig { public static IList Scales { get; private set; } public static ClientParameters Client { get; private set; } - public static bool IsPrintingReady => Documents.Html.IsReady && Documents.Pdf.IsReady; + public static bool IsPrintingReady => Html.IsReady && Pdf.IsReady; public static Dispatcher MainDispatcher { get; private set; } public App() : base() { @@ -92,8 +93,8 @@ namespace Elwig { } } - Utils.RunBackground("HTML Initialization", () => Documents.Html.Init(PrintingReadyChanged)); - Utils.RunBackground("PDF Initialization", () => Documents.Pdf.Init(PrintingReadyChanged)); + Utils.RunBackground("HTML Initialization", () => Html.Init(PrintingReadyChanged)); + Utils.RunBackground("PDF Initialization", () => Pdf.Init(PrintingReadyChanged)); var list = new List(); foreach (var s in Config.Scales) { diff --git a/Elwig/Documents/BusinessDocument.cshtml.cs b/Elwig/Documents/BusinessDocument.cs similarity index 100% rename from Elwig/Documents/BusinessDocument.cshtml.cs rename to Elwig/Documents/BusinessDocument.cs diff --git a/Elwig/Documents/BusinessDocument.cshtml b/Elwig/Documents/BusinessDocument.cshtml index 7a985d9..1d843e4 100644 --- a/Elwig/Documents/BusinessDocument.cshtml +++ b/Elwig/Documents/BusinessDocument.cshtml @@ -2,7 +2,7 @@ @inherits TemplatePage @model Elwig.Documents.BusinessDocument @{ Layout = "Document"; } - +
diff --git a/Elwig/Documents/style-businessdocument.css b/Elwig/Documents/BusinessDocument.css similarity index 100% rename from Elwig/Documents/style-businessdocument.css rename to Elwig/Documents/BusinessDocument.css diff --git a/Elwig/Documents/BusinessLetter.cshtml.cs b/Elwig/Documents/BusinessLetter.cs similarity index 100% rename from Elwig/Documents/BusinessLetter.cshtml.cs rename to Elwig/Documents/BusinessLetter.cs diff --git a/Elwig/Documents/CreditNote.cshtml.cs b/Elwig/Documents/CreditNote.cs similarity index 100% rename from Elwig/Documents/CreditNote.cshtml.cs rename to Elwig/Documents/CreditNote.cs diff --git a/Elwig/Documents/CreditNote.cshtml b/Elwig/Documents/CreditNote.cshtml index d83fb1d..f6bf043 100644 --- a/Elwig/Documents/CreditNote.cshtml +++ b/Elwig/Documents/CreditNote.cshtml @@ -2,7 +2,7 @@ @inherits TemplatePage @model Elwig.Documents.CreditNote @{ Layout = "BusinessDocument"; } - + @{ var binNum = Model.BinNames.Length; } diff --git a/Elwig/Documents/style-creditnote.css b/Elwig/Documents/CreditNote.css similarity index 100% rename from Elwig/Documents/style-creditnote.css rename to Elwig/Documents/CreditNote.css diff --git a/Elwig/Documents/DeliveryConfirmation.cshtml.cs b/Elwig/Documents/DeliveryConfirmation.cs similarity index 100% rename from Elwig/Documents/DeliveryConfirmation.cshtml.cs rename to Elwig/Documents/DeliveryConfirmation.cs diff --git a/Elwig/Documents/DeliveryConfirmation.cshtml b/Elwig/Documents/DeliveryConfirmation.cshtml index f866463..fa3df41 100644 --- a/Elwig/Documents/DeliveryConfirmation.cshtml +++ b/Elwig/Documents/DeliveryConfirmation.cshtml @@ -2,7 +2,7 @@ @inherits TemplatePage @model Elwig.Documents.DeliveryConfirmation @{ Layout = "BusinessDocument"; } - +

@Model.Title

diff --git a/Elwig/Documents/style-deliveryconfirmation.css b/Elwig/Documents/DeliveryConfirmation.css similarity index 100% rename from Elwig/Documents/style-deliveryconfirmation.css rename to Elwig/Documents/DeliveryConfirmation.css diff --git a/Elwig/Documents/DeliveryJournal.cshtml.cs b/Elwig/Documents/DeliveryJournal.cs similarity index 100% rename from Elwig/Documents/DeliveryJournal.cshtml.cs rename to Elwig/Documents/DeliveryJournal.cs diff --git a/Elwig/Documents/DeliveryJournal.cshtml b/Elwig/Documents/DeliveryJournal.cshtml index 678aab4..e48a158 100644 --- a/Elwig/Documents/DeliveryJournal.cshtml +++ b/Elwig/Documents/DeliveryJournal.cshtml @@ -2,7 +2,7 @@ @inherits TemplatePage @model Elwig.Documents.DeliveryJournal @{ Layout = "Document"; } - +

Lieferjournal

@Model.Filter

diff --git a/Elwig/Documents/style-deliveryjournal.css b/Elwig/Documents/DeliveryJournal.css similarity index 100% rename from Elwig/Documents/style-deliveryjournal.css rename to Elwig/Documents/DeliveryJournal.css diff --git a/Elwig/Documents/DeliveryNote.cshtml.cs b/Elwig/Documents/DeliveryNote.cs similarity index 100% rename from Elwig/Documents/DeliveryNote.cshtml.cs rename to Elwig/Documents/DeliveryNote.cs diff --git a/Elwig/Documents/DeliveryNote.cshtml b/Elwig/Documents/DeliveryNote.cshtml index 7855909..1c10201 100644 --- a/Elwig/Documents/DeliveryNote.cshtml +++ b/Elwig/Documents/DeliveryNote.cshtml @@ -2,7 +2,7 @@ @inherits TemplatePage @model Elwig.Documents.DeliveryNote @{ Layout = "BusinessDocument"; } - +

@Model.Title

diff --git a/Elwig/Documents/style-deliverynote.css b/Elwig/Documents/DeliveryNote.css similarity index 100% rename from Elwig/Documents/style-deliverynote.css rename to Elwig/Documents/DeliveryNote.css diff --git a/Elwig/Documents/style-page.css b/Elwig/Documents/Document.Page.css similarity index 100% rename from Elwig/Documents/style-page.css rename to Elwig/Documents/Document.Page.css diff --git a/Elwig/Documents/Document.cshtml.cs b/Elwig/Documents/Document.cs similarity index 99% rename from Elwig/Documents/Document.cshtml.cs rename to Elwig/Documents/Document.cs index e826769..fee9ba2 100644 --- a/Elwig/Documents/Document.cshtml.cs +++ b/Elwig/Documents/Document.cs @@ -4,6 +4,7 @@ using System.IO; using Elwig.Helpers; using System.Collections.Generic; using System.Linq; +using Elwig.Helpers.Printing; namespace Elwig.Documents { public abstract partial class Document : IDisposable { diff --git a/Elwig/Documents/Document.cshtml b/Elwig/Documents/Document.cshtml index bfac449..74e33af 100644 --- a/Elwig/Documents/Document.cshtml +++ b/Elwig/Documents/Document.cshtml @@ -7,8 +7,8 @@ @Model.Title - - + + @if (Model.DoubleSided) {