Remove BankDetailsWindow
This commit is contained in:
@ -7,17 +7,11 @@
|
|||||||
</ApplicationDefinition>
|
</ApplicationDefinition>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Update="Windows\BankDetailsWindow.xaml.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Update="Windows\MemberListWindow.xaml.cs">
|
<Compile Update="Windows\MemberListWindow.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Page Update="Windows\BankDetailsWindow.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Update="Windows\MainWindow.xaml">
|
<Page Update="Windows\MainWindow.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
<Window x:Class="WGneu.Windows.BankDetailsWindow"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:local="clr-namespace:WGneu.Windows"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
Title="Bankverbindung" Height="295" Width="440" ResizeMode="NoResize" MinWidth="440" MinHeight="295">
|
|
||||||
<Grid>
|
|
||||||
<GroupBox Header="IBAN" Margin="10,10,10,0" Height="60" VerticalAlignment="Top">
|
|
||||||
<Grid>
|
|
||||||
<TextBox x:Name="Iban" HorizontalAlignment="Left" Margin="105,0,-0.6,0" TextWrapping="NoWrap" Width="280" VerticalAlignment="Center" TextChanged="Iban_TextChanged" LostFocus="Iban_LostFocus"/>
|
|
||||||
<TextBlock HorizontalAlignment="Left" Margin="5,0,0,0" TextWrapping="Wrap" VerticalAlignment="Center" Width="90"><Run Language="de-de" Text="IBAN:"/></TextBlock>
|
|
||||||
</Grid>
|
|
||||||
</GroupBox>
|
|
||||||
<GroupBox Header="Bank/Kontonummer" Margin="10,80,10,0" Height="135" VerticalAlignment="Top">
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="1*"/>
|
|
||||||
<RowDefinition Height="1*"/>
|
|
||||||
<RowDefinition Height="1*"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="100"/>
|
|
||||||
<ColumnDefinition Width="1*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<ComboBox HorizontalAlignment="Left" VerticalAlignment="Center" Width="280" Height="22" Margin="5,-0.3,0,0" Grid.Column="2"/>
|
|
||||||
<TextBox x:Name="BankCode" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="80" TextChanged="BankCode_TextChanged" Height="18" Grid.Column="2" Grid.Row="1" Margin="5,0,0,0"/>
|
|
||||||
<TextBox x:Name="AccountNumber" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="280" Height="18" Grid.Column="1" Grid.Row="2" Margin="5,0,0,0" TextChanged="AccountNumber_TextChanged"/>
|
|
||||||
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Land:" VerticalAlignment="Center" Height="16" Width="90" Margin="5,0,0,0"/>
|
|
||||||
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Bank:" VerticalAlignment="Center" Height="16" Width="90" Grid.Row="1" Margin="5,0,0,0" Grid.RowSpan="1"/>
|
|
||||||
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Kontonummer:" VerticalAlignment="Center" Grid.Row="2" Margin="5,0,0,0"/>
|
|
||||||
<ComboBox Margin="92,0,0,0" VerticalAlignment="Center" Height="22" HorizontalAlignment="Left" Width="193" Grid.Column="2" Grid.Row="1"/>
|
|
||||||
</Grid>
|
|
||||||
</GroupBox>
|
|
||||||
<Button Content="Übernehmen" HorizontalAlignment="Right" Margin="0,0,20,10" VerticalAlignment="Bottom" Padding="5,1,5,1"/>
|
|
||||||
</Grid>
|
|
||||||
</Window>
|
|
@ -1,148 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
using WGneu.Models;
|
|
||||||
|
|
||||||
|
|
||||||
namespace WGneu.Windows {
|
|
||||||
/// <summary>
|
|
||||||
/// Interaktionslogik für BankDetailsWindow.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class BankDetailsWindow : Window {
|
|
||||||
public BankDetailsWindow() {
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Iban_TextChanged(object sender, TextChangedEventArgs e) {
|
|
||||||
string iban = "";
|
|
||||||
int pos = Iban.CaretIndex;
|
|
||||||
for (int i = 0, v = 0; i < Iban.Text.Length && v < 34; i++) {
|
|
||||||
char ch = Iban.Text[i];
|
|
||||||
if (Char.IsLetterOrDigit(ch) && Char.IsAscii(ch)) {
|
|
||||||
if (v != 0 && v % 4 == 0)
|
|
||||||
iban += ' ';
|
|
||||||
v++;
|
|
||||||
iban += Char.ToUpper(ch);
|
|
||||||
}
|
|
||||||
if (i == Iban.CaretIndex - 1)
|
|
||||||
pos = iban.Length;
|
|
||||||
if (iban.StartsWith("AT") && v >= 20)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
Iban.Text = iban;
|
|
||||||
Iban.CaretIndex = pos;
|
|
||||||
|
|
||||||
if (Iban.IsFocused)
|
|
||||||
GenerateBankDetails();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Iban_LostFocus(object sender, EventArgs e) {
|
|
||||||
// TODO vaildate checksum
|
|
||||||
}
|
|
||||||
|
|
||||||
private void BankCode_TextChanged(object sender, TextChangedEventArgs e) {
|
|
||||||
string cc = "AT";
|
|
||||||
string code = "";
|
|
||||||
int pos = BankCode.CaretIndex;
|
|
||||||
|
|
||||||
if (cc == "AT") {
|
|
||||||
|
|
||||||
for (int i = 0, v = 0; i < BankCode.Text.Length && v < 5; i++) {
|
|
||||||
char ch = BankCode.Text[i];
|
|
||||||
if (Char.IsDigit(ch)) {
|
|
||||||
v++;
|
|
||||||
code += ch;
|
|
||||||
}
|
|
||||||
if (i == BankCode.CaretIndex - 1)
|
|
||||||
pos = code.Length;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BankCode.Text = code;
|
|
||||||
BankCode.CaretIndex = pos;
|
|
||||||
|
|
||||||
if (BankCode.IsFocused)
|
|
||||||
GenerateIban();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AccountNumber_TextChanged(object sender, TextChangedEventArgs e) {
|
|
||||||
string cc = "AT";
|
|
||||||
string num = "";
|
|
||||||
int pos = AccountNumber.CaretIndex;
|
|
||||||
|
|
||||||
if (cc == "AT") {
|
|
||||||
for (int i = 0, v = 0; i < AccountNumber.Text.Length && v < 11; i++) {
|
|
||||||
char ch = AccountNumber.Text[i];
|
|
||||||
if (Char.IsLetterOrDigit(ch) && Char.IsAscii(ch)) {
|
|
||||||
v++;
|
|
||||||
num += ch;
|
|
||||||
}
|
|
||||||
if (i == AccountNumber.CaretIndex - 1)
|
|
||||||
pos = num.Length;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AccountNumber.Text = num;
|
|
||||||
AccountNumber.CaretIndex = pos;
|
|
||||||
|
|
||||||
if (AccountNumber.IsFocused)
|
|
||||||
GenerateIban();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void GenerateIban() {
|
|
||||||
string cc = "AT";
|
|
||||||
string iban = cc + "00";
|
|
||||||
|
|
||||||
if (cc == "AT") {
|
|
||||||
iban += BankCode.Text.PadLeft(5, '0') + AccountNumber.Text.PadLeft(11, '0');
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO calculate checksum
|
|
||||||
|
|
||||||
Iban.Text = iban;
|
|
||||||
Iban.CaretIndex = iban.Length;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void GenerateBankDetails() {
|
|
||||||
BankCode.Text = "";
|
|
||||||
AccountNumber.Text = "";
|
|
||||||
|
|
||||||
string iban = Iban.Text.Replace(" ", "");
|
|
||||||
if (iban.Length <= 2)
|
|
||||||
return;
|
|
||||||
|
|
||||||
string cc = iban.Substring(0, 2);
|
|
||||||
if (cc == "AT") {
|
|
||||||
if (iban.Length > 4) {
|
|
||||||
string bankCodeStr = iban.Substring(4, Math.Min(5, iban.Length - 4));
|
|
||||||
if (bankCodeStr.All(Char.IsDigit)) {
|
|
||||||
int bankCode = int.Parse(bankCodeStr);
|
|
||||||
BankCode.Text = bankCode.ToString();
|
|
||||||
}
|
|
||||||
if (iban.Length > 9) {
|
|
||||||
string accNumStr = iban.Substring(9, Math.Min(11, iban.Length - 9));
|
|
||||||
if (accNumStr.All(Char.IsDigit)) {
|
|
||||||
int accNum = int.Parse(accNumStr);
|
|
||||||
AccountNumber.Text = (accNum != 0) ? accNum.ToString() : "";
|
|
||||||
} else {
|
|
||||||
AccountNumber.Text = accNumStr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BankCode.CaretIndex = BankCode.Text.Length;
|
|
||||||
AccountNumber.CaretIndex = AccountNumber.Text.Length;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -16,7 +16,6 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Button x:Name="Button1" Content="Bankverbindung" VerticalAlignment="Top" Click="Button1_Click" Margin="454,109,159,0"/>
|
|
||||||
<ComboBox HorizontalAlignment="Left" Margin="175,149,0,0" VerticalAlignment="Top" Width="120" ItemsSource="{Binding Source={StaticResource countryViewSource}}" ItemTemplate="{StaticResource asdf}" SelectionChanged="ComboBox_SelectionChanged" IsEditable="True"/>
|
<ComboBox HorizontalAlignment="Left" Margin="175,149,0,0" VerticalAlignment="Top" Width="120" ItemsSource="{Binding Source={StaticResource countryViewSource}}" ItemTemplate="{StaticResource asdf}" SelectionChanged="ComboBox_SelectionChanged" IsEditable="True"/>
|
||||||
<Button x:Name="Button2" Content="Mitglieder" Margin="472,182,178,0" VerticalAlignment="Top" Click="Button2_Click"/>
|
<Button x:Name="Button2" Content="Mitglieder" Margin="472,182,178,0" VerticalAlignment="Top" Click="Button2_Click"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
@ -40,13 +40,8 @@ namespace WGneu.Windows {
|
|||||||
base.OnClosing(e);
|
base.OnClosing(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Button1_Click(object sender, EventArgs e) {
|
|
||||||
BankDetailsWindow w = new BankDetailsWindow();
|
|
||||||
w.Show();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Button2_Click(object sender, EventArgs e) {
|
private void Button2_Click(object sender, EventArgs e) {
|
||||||
MemberListWindow w = new MemberListWindow();
|
var w = new MemberListWindow();
|
||||||
w.Show();
|
w.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user