MemberAdminWindow: Allow user to keep AreaCom YearTo when transfering
All checks were successful
Test / Run tests (push) Successful in 2m49s
All checks were successful
Test / Run tests (push) Successful in 2m49s
This commit is contained in:
@ -8,7 +8,7 @@
|
|||||||
ResizeMode="NoResize" ShowInTaskbar="False" Topmost="True"
|
ResizeMode="NoResize" ShowInTaskbar="False" Topmost="True"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
||||||
Title="Flächenbindungen übertragen" Height="230" Width="450">
|
Title="Flächenbindungen übertragen" Height="260" Width="450">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<Style TargetType="Label">
|
<Style TargetType="Label">
|
||||||
<Setter Property="HorizontalAlignment" Value="Left"/>
|
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||||
@ -48,11 +48,15 @@
|
|||||||
Minimum="1900" Maximum="9999"
|
Minimum="1900" Maximum="9999"
|
||||||
HorizontalAlignment="Center" VerticalAlignment="Top"
|
HorizontalAlignment="Center" VerticalAlignment="Top"
|
||||||
TextChanged="SeasonInput_TextChanged"/>
|
TextChanged="SeasonInput_TextChanged"/>
|
||||||
|
<CheckBox x:Name="CopyYearToInput" Content="Beginn der Laufzeit von Vorgänger übernehmen" Margin="0,80,0,0"
|
||||||
|
HorizontalAlignment="Center" VerticalAlignment="Top"
|
||||||
|
Checked="CopyYearToInput_Changed" Unchecked="CopyYearToInput_Changed"
|
||||||
|
IsChecked="{Binding MaintainYearTo}"/>
|
||||||
|
|
||||||
<TextBlock x:Name="DescBlock1" Margin="0,85,0,0" TextAlignment="Center"
|
<TextBlock x:Name="DescBlock1" Margin="0,105,0,0" TextAlignment="Center"
|
||||||
HorizontalAlignment="Center" VerticalAlignment="Top">
|
HorizontalAlignment="Center" VerticalAlignment="Top">
|
||||||
Die Flächenbindungen beim <Bold>Vorgänger</Bold> sind bis inkl. Saison <Bold><Run x:Name="CancelSeason1"/></Bold> gültig,<LineBreak/>
|
Die Flächenbindungen beim <Bold>Vorgänger</Bold> sind bis inkl. Saison <Bold><Run x:Name="CancelSeason1"/></Bold> gültig,<LineBreak/>
|
||||||
und werden beim <Bold>Nachfolger</Bold> ab inkl. Saison <Bold><Run x:Name="TransferSeason"/></Bold> übernommen.
|
und werden beim <Bold>Nachfolger</Bold> ab <Run x:Name="DescBlock1Season" Text="inkl. Saison "/><Bold><Run x:Name="TransferSeason"/></Bold> übernommen.
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock x:Name="DescBlock2" Margin="0,70,0,0" TextAlignment="Center" Visibility="Hidden"
|
<TextBlock x:Name="DescBlock2" Margin="0,70,0,0" TextAlignment="Center" Visibility="Hidden"
|
||||||
HorizontalAlignment="Center" VerticalAlignment="Top">
|
HorizontalAlignment="Center" VerticalAlignment="Top">
|
||||||
|
@ -7,6 +7,7 @@ namespace Elwig.Dialogs {
|
|||||||
|
|
||||||
public int CancelSeason { get; set; }
|
public int CancelSeason { get; set; }
|
||||||
public int SuccessorSeason => CancelSeason + 1;
|
public int SuccessorSeason => CancelSeason + 1;
|
||||||
|
public bool MaintainYearTo { get; set; }
|
||||||
|
|
||||||
public string AreaComNum { get; set; }
|
public string AreaComNum { get; set; }
|
||||||
public string Area { get; set; }
|
public string Area { get; set; }
|
||||||
@ -22,6 +23,7 @@ namespace Elwig.Dialogs {
|
|||||||
QuestionBlock2.Visibility = Visibility.Visible;
|
QuestionBlock2.Visibility = Visibility.Visible;
|
||||||
DescBlock1.Visibility = Visibility.Hidden;
|
DescBlock1.Visibility = Visibility.Hidden;
|
||||||
DescBlock2.Visibility = Visibility.Visible;
|
DescBlock2.Visibility = Visibility.Visible;
|
||||||
|
CopyYearToInput.Visibility = Visibility.Hidden;
|
||||||
Height = 240;
|
Height = 240;
|
||||||
SeasonInput.Margin = new(0, 40, 0, 0);
|
SeasonInput.Margin = new(0, 40, 0, 0);
|
||||||
SeasonLabel.Margin = new(0, 40, 100, 0);
|
SeasonLabel.Margin = new(0, 40, 100, 0);
|
||||||
@ -41,7 +43,13 @@ namespace Elwig.Dialogs {
|
|||||||
CancelSeason = (int)SeasonInput.Value!;
|
CancelSeason = (int)SeasonInput.Value!;
|
||||||
CancelSeason1.Text = $"{CancelSeason}";
|
CancelSeason1.Text = $"{CancelSeason}";
|
||||||
CancelSeason2.Text = $"{CancelSeason}";
|
CancelSeason2.Text = $"{CancelSeason}";
|
||||||
TransferSeason.Text = $"{SuccessorSeason}";
|
TransferSeason.Text = MaintainYearTo ? "" : $"{SuccessorSeason}";
|
||||||
|
DescBlock1Season.Text = MaintainYearTo ? "dem originalen Beginn der FB" : "inkl. Saison ";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CopyYearToInput_Changed(object sender, RoutedEventArgs evt) {
|
||||||
|
TransferSeason.Text = MaintainYearTo ? "" : $"{SuccessorSeason}";
|
||||||
|
DescBlock1Season.Text = MaintainYearTo ? "dem originalen Beginn der FB" : "inkl. Saison ";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ConfirmButton_Click(object sender, RoutedEventArgs evt) {
|
private void ConfirmButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
|
@ -597,7 +597,7 @@ namespace Elwig.Services {
|
|||||||
KgNr = c.KgNr,
|
KgNr = c.KgNr,
|
||||||
GstNr = c.GstNr,
|
GstNr = c.GstNr,
|
||||||
RdNr = c.RdNr,
|
RdNr = c.RdNr,
|
||||||
YearFrom = year,
|
YearFrom = vm.MaintainAreaComYearTo ? c.YearFrom : year,
|
||||||
YearTo = c.YearTo,
|
YearTo = c.YearTo,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ namespace Elwig.ViewModels {
|
|||||||
public partial class MemberAdminViewModel : ObservableObject {
|
public partial class MemberAdminViewModel : ObservableObject {
|
||||||
|
|
||||||
public int? TransferPredecessorAreaComs = null;
|
public int? TransferPredecessorAreaComs = null;
|
||||||
|
public bool MaintainAreaComYearTo = false;
|
||||||
public int? CancelAreaComs = null;
|
public int? CancelAreaComs = null;
|
||||||
|
|
||||||
public ObservableCollection<KeyValuePair<string, string>> PhoneNrTypes { get; set; } = new(Utils.PhoneNrTypes);
|
public ObservableCollection<KeyValuePair<string, string>> PhoneNrTypes { get; set; } = new(Utils.PhoneNrTypes);
|
||||||
|
@ -747,6 +747,7 @@ namespace Elwig.Windows {
|
|||||||
if (d.ShowDialog() != true)
|
if (d.ShowDialog() != true)
|
||||||
return;
|
return;
|
||||||
ViewModel.TransferPredecessorAreaComs = d.SuccessorSeason;
|
ViewModel.TransferPredecessorAreaComs = d.SuccessorSeason;
|
||||||
|
ViewModel.MaintainAreaComYearTo = d.MaintainYearTo;
|
||||||
if (IsEditing)
|
if (IsEditing)
|
||||||
SetOriginalValue(PredecessorMgNrInput, -1); // hack to allow user to save
|
SetOriginalValue(PredecessorMgNrInput, -1); // hack to allow user to save
|
||||||
UpdateButtons();
|
UpdateButtons();
|
||||||
|
Reference in New Issue
Block a user