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 Elwig.Models;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System; using System;
using System.Threading.Tasks;
namespace Elwig.Windows { namespace Elwig.Windows {
public partial class AreaCommAdminWindow : AdministrationWindow { public partial class AreaCommAdminWindow : AdministrationWindow {
@ -118,7 +119,6 @@ namespace Elwig.Windows {
AreaCommitmentList.IsEnabled = false; AreaCommitmentList.IsEnabled = false;
AreaCommitmentList.SelectedItem = null; AreaCommitmentList.SelectedItem = null;
ContractList.IsEnabled = false; ContractList.IsEnabled = false;
ContractList.SelectedItem = null;
HideAreaCommitmentNewEditDeleteButtons(); HideAreaCommitmentNewEditDeleteButtons();
ShowAreaCommitmentSaveResetCancelButtons(); ShowAreaCommitmentSaveResetCancelButtons();
DisableContractNewDeleteButtons(); DisableContractNewDeleteButtons();
@ -132,11 +132,15 @@ namespace Elwig.Windows {
IsEditing = true; IsEditing = true;
AreaCommitmentList.IsEnabled = false; AreaCommitmentList.IsEnabled = false;
ContractList.IsEnabled = false;
HideAreaCommitmentNewEditDeleteButtons(); HideAreaCommitmentNewEditDeleteButtons();
ShowAreaCommitmentSaveResetCancelButtons(); ShowAreaCommitmentSaveResetCancelButtons();
DisableContractNewDeleteButtons(); DisableContractNewDeleteButtons();
UnlockInputs(); UnlockInputs();
//TODO schöner?
VNrInput.IsReadOnly = true;
MgNrInput.IsReadOnly = true;
} }
private void DeleteAreaCommitmentButton_Click(object sender, RoutedEventArgs evt) { private void DeleteAreaCommitmentButton_Click(object sender, RoutedEventArgs evt) {
@ -163,6 +167,16 @@ namespace Elwig.Windows {
ShowContractSaveCancelButtons(); ShowContractSaveCancelButtons();
DisableAreaCommitmentNewEditDeleteButtons(); DisableAreaCommitmentNewEditDeleteButtons();
UnlockInputs(); 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(); InitInputs();
} }
@ -239,7 +253,15 @@ namespace Elwig.Windows {
} }
private void ContractSaveButton_Click(object sender, RoutedEventArgs evt) { 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) { private void ContractCancelButton_Click(object sender, RoutedEventArgs evt) {