forked from manuelbl/SwissQRBill.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml.cs
More file actions
63 lines (54 loc) · 1.7 KB
/
Copy pathMainWindow.xaml.cs
File metadata and controls
63 lines (54 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//
// Swiss QR Bill Generator for .NET
// Copyright (c) 2021 Manuel Bleichenbacher
// Licensed under MIT License
// https://opensource.org/licenses/MIT
//
using Codecrete.SwissQRBill.Generator;
using System.Windows;
namespace Codecrete.SwissQRBill.Examples.Wpf
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
private Bill bill;
public MainWindow()
{
InitializeComponent();
// create bill data
bill = new Bill
{
// creditor data
Account = "CH4431999123000889012",
Creditor = new Address
{
Name = "Robert Schneider AG",
AddressLine1 = "Rue du Lac 1268/2/22",
AddressLine2 = "2501 Biel",
CountryCode = "CH"
},
// payment data
//Amount = 199.95m,
Currency = "CHF",
// debtor data
Debtor = new Address
{
Name = "Pia-Maria Rutschmann-Schnyder",
AddressLine1 = "Grosse Marktgasse 28",
AddressLine2 = "9400 Rorschach",
CountryCode = "CH"
},
// more payment data
Reference = "210000000003139471430009017",
UnstructuredMessage = "Abonnement für 2020"
};
billImage.Source = QrBillImage.CreateImage(bill);
}
private void Button_Click(object sender, RoutedEventArgs e)
{
QrBillPrinting.Print(bill);
}
}
}