For anyone recorded on PNomis / NDelius as non-British / non-Irish, documentation is required to support their Right to Work. More information on this requirement can be found in the CFO Enrolment Guidance.
@@ -38,22 +38,24 @@
To your knowledge, is any Right to Work (RTW) documentation required for the enrolment of this person?
- Yes, Right to Work is required
- No, Right to Work is not required
+ Yes, Right to Work is required
+ No, Right to Work is not required
-
@if (_isRequired)
{
+
-
-
+ @bind-Date="Model.ValidFrom" Required />
+ @if (_isIndefiniteRtwChecked == false)
+ {
+
+ }
@@ -63,7 +65,7 @@
StartIcon="@Icons.Material.Filled.Upload">
@if (_uploading)
{
-
+
@ConstantString.Uploading
}
else
@@ -84,13 +86,11 @@
private bool _isRequired = true;
private bool _uploading = false;
- private bool _disabled = false;
- private MudDatePicker? _dpValidTo;
- MudCheckBox IndefiniteRtw { get; set; } = default!;
+ private bool _isIndefiniteRtwChecked { get; set; } = false;
[EditorRequired]
[Parameter]
- public AddRightToWork.Command? Model { get; set; }
+ public AddRightToWork.Command? Model { get; set; }
[Parameter]
public RightToWorkDto[]? RightToWorkDtos { get; set; }
@@ -143,16 +143,27 @@
}
}
- private void IndefiniteRtwOnValueChanged()
+ private void RightToWorkRequiredOnClick()
+ {
+ _isRequired = true;
+
+ IndefiniteRtwOnValueChanged(_isIndefiniteRtwChecked);
+ }
+ private void NoRightToWorkRequiredOnClick()
+ {
+ _isRequired = false;
+
+ IndefiniteRtwOnValueChanged(_isIndefiniteRtwChecked);
+ }
+ private void IndefiniteRtwOnValueChanged(bool isIndefiniteRtwChecked)
{
- if (IndefiniteRtw.Value)
+ _isIndefiniteRtwChecked = isIndefiniteRtwChecked;
+ if (_isIndefiniteRtwChecked)
{
- _disabled = true;
Model!.ValidTo = new DateTime(9999, 12, 31);
}
else
{
- _disabled = false;
Model!.ValidTo = null;
}
}