MailWindow: Add feature to change location
This commit is contained in:
@ -7,13 +7,12 @@ using System.Linq;
|
||||
namespace Elwig.Documents {
|
||||
public abstract class BusinessDocument : Document {
|
||||
|
||||
public bool ShowDateAndLocation = false;
|
||||
|
||||
public Member Member;
|
||||
public string? Location;
|
||||
public bool IncludeSender = false;
|
||||
public bool UseBillingAddress = false;
|
||||
public bool ShowDateAndLocation = false;
|
||||
public string Aside;
|
||||
public string? Location;
|
||||
|
||||
public BusinessDocument(string title, Member m, bool includeSender = false) : base(title) {
|
||||
Member = m;
|
||||
|
@ -193,6 +193,11 @@
|
||||
<TextBox x:Name="PostalSender2"
|
||||
Margin="10,330,10,10"/>
|
||||
|
||||
<TextBox x:Name="PostalLocation"
|
||||
Margin="10,360,10,10" Width="120" HorizontalAlignment="Left"/>
|
||||
<Label Margin="130,360,10,10" FontSize="14">
|
||||
<TextBlock>, am <Run x:Name="PostalDate">01.01.2020</Run></TextBlock>
|
||||
</Label>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
|
@ -119,6 +119,8 @@ namespace Elwig.Windows {
|
||||
|
||||
PostalSender1.Text = App.Client.Sender1;
|
||||
PostalSender2.Text = App.Client.Sender2;
|
||||
PostalLocation.Text = App.BranchLocation;
|
||||
PostalDate.Text = $"{Utils.Today:dd.MM.yyyy}";
|
||||
EmailSubjectInput.Text = App.Client.TextEmailSubject ?? "Rundschreiben";
|
||||
EmailBodyInput.Text = App.Client.TextEmailBody ?? "Sehr geehrtes Mitglied,\n\nim Anhang finden Sie das aktuelle Rundschreiben.\n\nIhre Winzergenossenschaft\n";
|
||||
}
|
||||
@ -375,6 +377,7 @@ namespace Elwig.Windows {
|
||||
await UpdateTextParameters();
|
||||
|
||||
var doublePaged = DoublePagedInput.IsChecked == true;
|
||||
var location = PostalLocation.Text.Trim();
|
||||
var docs = SelectedDocs.OrderByDescending(d => d.Type).ToList();
|
||||
|
||||
IEnumerable<Member> recipients = Recipients;
|
||||
@ -497,8 +500,10 @@ namespace Elwig.Windows {
|
||||
var docs = m.Docs.Select(d => d.Doc).ToList();
|
||||
foreach (var doc in docs) {
|
||||
doc!.DoublePaged = false;
|
||||
if (doc is BusinessDocument b)
|
||||
if (doc is BusinessDocument b) {
|
||||
b.IncludeSender = false;
|
||||
b.Location = location;
|
||||
}
|
||||
};
|
||||
return docs;
|
||||
});
|
||||
@ -529,7 +534,11 @@ namespace Elwig.Windows {
|
||||
if (docs.Count == 0 || m.Docs[0].Type == DocType.Custom) {
|
||||
docs.Insert(0, new Letterhead(m.Member));
|
||||
}
|
||||
docs.ForEach(doc => doc.DoublePaged = doublePaged);
|
||||
docs.ForEach(doc => {
|
||||
doc.DoublePaged = doublePaged;
|
||||
if (doc is BusinessDocument b)
|
||||
b.Location = location;
|
||||
});
|
||||
if (docs.Count > 0 && docs[0] is BusinessDocument b)
|
||||
b.IncludeSender = true;
|
||||
return docs;
|
||||
|
Reference in New Issue
Block a user