Files
ucalc/ucalc/TenantWindow.xaml
T
Tobias Erbshäußer 3f97fbfae4 Implemented restrictions for the entry and departure dates.
Implemented restrictions for decimal values.
2020-06-15 18:25:35 +02:00

257 lines
14 KiB
XML

<Window x:Class="UCalc.TenantWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:UCalc"
xmlns:controls="clr-namespace:UCalc.Controls"
mc:Ignorable="d"
Title="Mieter bearbeiten"
Width="500"
Height="600"
MinWidth="400"
MinHeight="190"
WindowStartupLocation="CenterOwner"
ShowInTaskbar="False">
<Window.Resources>
<controls:FlatToRentedConverter x:Key="FlatToRentedConverter" />
<controls:DatePickerTextToDateTimeConverter x:Key="DatePickerTextToDateTimeConverter" />
</Window.Resources>
<DockPanel>
<StackPanel DockPanel.Dock="Bottom">
<Separator Margin="0, 12, 0, 0"
Background="{x:Static local:Constants.SubMainColor}" />
<DockPanel LastChildFill="False">
<Button DockPanel.Dock="Right"
MinWidth="100"
MinHeight="24"
Margin="12"
Content="OK"
Click="OnOkClick" />
</DockPanel>
</StackPanel>
<ScrollViewer HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto">
<StackPanel>
<controls:SectionHeader Header="Allgemeine Informationen" />
<DockPanel Margin="12, 12, 12, 0">
<Label DockPanel.Dock="Left"
Content="Anrede:"
Width="180"
Foreground="{x:Static local:Constants.SubMainColor}" />
<ComboBox Margin="0, 0, 28, 0"
ItemsSource="{x:Static local:Constants.SalutationStrs}"
SelectedIndex="{Binding Path=Tenant.Salutation.Value, RelativeSource={RelativeSource AncestorType=local:TenantWindow}}" />
</DockPanel>
<DockPanel Margin="12, 8, 12, 0">
<Label DockPanel.Dock="Left"
Content="Name:"
Width="180"
Foreground="{x:Static local:Constants.SubMainColor}" />
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Property="{Binding Path=Tenant.Name, RelativeSource={RelativeSource AncestorType=local:TenantWindow}}" />
<TextBox
VerticalAlignment="Center"
MinHeight="22"
Text="{Binding Path=Tenant.Name.Value, RelativeSource={RelativeSource AncestorType=local:TenantWindow}, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
<DockPanel Margin="12, 8, 12, 0">
<Label DockPanel.Dock="Left"
Content="Personenanzahl:"
Width="180"
Foreground="{x:Static local:Constants.SubMainColor}" />
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Property="{Binding Path=Tenant.PersonCount, RelativeSource={RelativeSource AncestorType=local:TenantWindow}}" />
<TextBox
VerticalAlignment="Center"
MinHeight="22"
Text="{Binding Path=Tenant.PersonCount.Value, RelativeSource={RelativeSource AncestorType=local:TenantWindow}, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
<controls:SectionHeader Header="Bankdaten"
Margin="0, 12, 0, 0" />
<DockPanel Margin="12, 8, 12, 0">
<Label DockPanel.Dock="Left"
Content="IBAN:"
Width="180"
Foreground="{x:Static local:Constants.SubMainColor}" />
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Property="{Binding Path=Tenant.BankAccount.Iban, RelativeSource={RelativeSource AncestorType=local:TenantWindow}}" />
<TextBox
VerticalAlignment="Center"
MinHeight="22"
Text="{Binding Path=Tenant.BankAccount.Iban.Value, RelativeSource={RelativeSource AncestorType=local:TenantWindow}, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
<DockPanel Margin="12, 8, 12, 0">
<Label DockPanel.Dock="Left"
Content="BIC:"
Width="180"
Foreground="{x:Static local:Constants.SubMainColor}" />
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Property="{Binding Path=Tenant.BankAccount.Bic, RelativeSource={RelativeSource AncestorType=local:TenantWindow}}" />
<TextBox
VerticalAlignment="Center"
MinHeight="22"
Text="{Binding Path=Tenant.BankAccount.Bic.Value, RelativeSource={RelativeSource AncestorType=local:TenantWindow}, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
<DockPanel Margin="12, 8, 12, 0">
<Label DockPanel.Dock="Left"
Content="Name der Bank:"
Width="180"
Foreground="{x:Static local:Constants.SubMainColor}" />
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Property="{Binding Path=Tenant.BankAccount.BankName, RelativeSource={RelativeSource AncestorType=local:TenantWindow}}" />
<TextBox
VerticalAlignment="Center"
MinHeight="22"
Text="{Binding Path=Tenant.BankAccount.BankName.Value, RelativeSource={RelativeSource AncestorType=local:TenantWindow}, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
<controls:SectionHeader Header="Ein- und Auszug"
Margin="0, 12, 0, 0" />
<DockPanel Margin="12, 8, 12, 0">
<Label DockPanel.Dock="Left"
Content="Einzug am:"
Width="180"
Foreground="{x:Static local:Constants.SubMainColor}" />
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Property="{Binding Path=Tenant.EntryDate, RelativeSource={RelativeSource AncestorType=local:TenantWindow}}" />
<DatePicker VerticalAlignment="Center"
MinHeight="22"
DisplayDateStart="{Binding Path=Model.StartDate, RelativeSource={RelativeSource AncestorType=local:TenantWindow}, Mode=OneWay}"
DisplayDateEnd="{Binding Path=Model.EndDate, RelativeSource={RelativeSource AncestorType=local:TenantWindow}, Mode=OneWay}"
Text="{Binding Path=Tenant.EntryDate.Value, RelativeSource={RelativeSource AncestorType=local:TenantWindow}, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay, Converter={StaticResource DatePickerTextToDateTimeConverter}}" />
</DockPanel>
<DockPanel Margin="12, 8, 12, 0">
<Label DockPanel.Dock="Left"
Content="Auszug am:"
Width="180"
Foreground="{x:Static local:Constants.SubMainColor}" />
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Property="{Binding Path=Tenant.DepartureDate, RelativeSource={RelativeSource AncestorType=local:TenantWindow}}" />
<DatePicker VerticalAlignment="Center"
MinHeight="22"
DisplayDateStart="{Binding Path=Model.StartDate, RelativeSource={RelativeSource AncestorType=local:TenantWindow}, Mode=OneWay}"
DisplayDateEnd="{Binding Path=Model.EndDate, RelativeSource={RelativeSource AncestorType=local:TenantWindow}, Mode=OneWay}"
Text="{Binding Path=Tenant.DepartureDate.Value, RelativeSource={RelativeSource AncestorType=local:TenantWindow}, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay, Converter={StaticResource DatePickerTextToDateTimeConverter}}" />
</DockPanel>
<controls:SectionHeader Header="Gemietete Wohnungen"
Margin="0, 12, 0, 0" />
<DockPanel Margin="12, 8, 12, 0">
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Property="{Binding Path=Tenant.RentedFlats, RelativeSource={RelativeSource AncestorType=local:TenantWindow}}" />
<ListBox Height="120"
ItemsSource="{Binding Path=House.Flats, RelativeSource={RelativeSource AncestorType=local:TenantWindow}}">
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox Content="{Binding Name.Value}"
IsChecked="{Binding Path=., Converter={StaticResource FlatToRentedConverter}, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
Checked="OnFlatChecked"
Unchecked="OnFlatUnchecked"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</DockPanel>
<controls:SectionHeader Header="Sonstiges"
Margin="0, 12, 0, 0" />
<DockPanel Margin="12, 8, 12, 0">
<Label DockPanel.Dock="Left"
Content="Bereits bezahlt:"
Width="180"
Foreground="{x:Static local:Constants.SubMainColor}" />
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Property="{Binding Path=Tenant.PaidRent, RelativeSource={RelativeSource AncestorType=local:TenantWindow}}" />
<TextBox VerticalAlignment="Center"
MinHeight="22"
Text="{Binding Path=Tenant.PaidRent.Value, RelativeSource={RelativeSource AncestorType=local:TenantWindow}, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
<DockPanel Margin="12, 8, 12, 0">
<Label DockPanel.Dock="Left"
Content="Nachricht 1:"
Width="180"
Foreground="{x:Static local:Constants.SubMainColor}" />
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Property="{Binding Path=Tenant.CustomMessage1, RelativeSource={RelativeSource AncestorType=local:TenantWindow}}" />
<TextBox VerticalAlignment="Center"
MinHeight="22"
Text="{Binding Path=Tenant.CustomMessage1.Value, RelativeSource={RelativeSource AncestorType=local:TenantWindow}, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
<DockPanel Margin="12, 8, 12, 0">
<Label DockPanel.Dock="Left"
Content="Nachricht 2:"
Width="180"
Foreground="{x:Static local:Constants.SubMainColor}" />
<controls:ErrorIcon Margin="12, 0, 0, 0"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Property="{Binding Path=Tenant.CustomMessage2, RelativeSource={RelativeSource AncestorType=local:TenantWindow}}" />
<TextBox VerticalAlignment="Center"
MinHeight="22"
Text="{Binding Path=Tenant.CustomMessage2.Value, RelativeSource={RelativeSource AncestorType=local:TenantWindow}, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
</StackPanel>
</ScrollViewer>
</DockPanel>
</Window>