Correctly lock inputs in AreaCommitmentWindow

This commit is contained in:
2023-03-31 22:54:51 +02:00
parent 57bc038357
commit ceadc8b2f8

View File

@ -7,6 +7,7 @@ using Elwig.Helpers;
using Elwig.Models;
using System.Runtime.CompilerServices;
using System;
using System.Threading.Tasks;
namespace Elwig.Windows {
public partial class AreaCommAdminWindow : AdministrationWindow {
@ -118,7 +119,6 @@ namespace Elwig.Windows {
AreaCommitmentList.IsEnabled = false;
AreaCommitmentList.SelectedItem = null;
ContractList.IsEnabled = false;
ContractList.SelectedItem = null;
HideAreaCommitmentNewEditDeleteButtons();
ShowAreaCommitmentSaveResetCancelButtons();
DisableContractNewDeleteButtons();
@ -132,11 +132,15 @@ namespace Elwig.Windows {
IsEditing = true;
AreaCommitmentList.IsEnabled = false;
ContractList.IsEnabled = false;
HideAreaCommitmentNewEditDeleteButtons();
ShowAreaCommitmentSaveResetCancelButtons();
DisableContractNewDeleteButtons();
UnlockInputs();
//TODO schöner?
VNrInput.IsReadOnly = true;
MgNrInput.IsReadOnly = true;
}
private void DeleteAreaCommitmentButton_Click(object sender, RoutedEventArgs evt) {
@ -163,6 +167,16 @@ namespace Elwig.Windows {
ShowContractSaveCancelButtons();
DisableAreaCommitmentNewEditDeleteButtons();
UnlockInputs();
//TODO schöner?
KgInput.IsEnabled = false;
RdInput.IsEnabled = false;
GstNrInput.IsReadOnly = true;
GstNrInput.IsEnabled = false;
AreaInput.IsReadOnly = true;
AreaInput.IsEnabled = false;
SortInput.IsEnabled = false;
AttrInput.IsEnabled = false;
CultInput.IsEnabled = false;
InitInputs();
}
@ -239,7 +253,15 @@ namespace Elwig.Windows {
}
private void ContractSaveButton_Click(object sender, RoutedEventArgs evt) {
//TODO
IsEditing = false;
IsCreating = false;
AreaCommitmentList.IsEnabled = true;
ContractList.IsEnabled = true;
HideContractSaveCancelButtons();
ShowContractNewDeleteButtons();
EnableAreaCommitmentNewEditDeleteButtons();
LockInputs();
RefreshContractList();
}
private void ContractCancelButton_Click(object sender, RoutedEventArgs evt) {