Skip to content

Commit

Permalink
Kan redigere sluttdato for bruker i admin
Browse files Browse the repository at this point in the history
  • Loading branch information
Pål Bøckmann authored and palbock committed Dec 4, 2024
1 parent 6ddc032 commit ebb7355
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions packages/adminpanel/Client/Pages/Employees/Employee.razor
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
>
@Localizer["Common.StartDate"]: @(_employee.StartDate.HasValue ? _employee.StartDate.Value.ToString("dd.MM.yyyy") : "")
</MudText>
<MudText
>
@Localizer["Common.EndDate"]: @(_employee.EndDate.HasValue ? _employee.EndDate.Value.ToString("dd.MM.yyyy") : "")
</MudText>
<MudText>
@Localizer["Common.Email"]: @_employee.Email
</MudText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@
DateFormat="dd/MM/yyyy"
Required="true"
RequiredError="@Localizer["Validation.Date.Required"]"/>

<MudDatePicker
Label="@Localizer["Common.EndDate"]"
@bind-Date="_endDate"
DateFormat="dd/MM/yyyy"/>
</MudForm>
</DialogContent>
<DialogActions>
Expand Down Expand Up @@ -76,7 +79,7 @@
private string? _email;
private int? _employeeId;
private DateTime? _startDate = DateTime.UtcNow.Date;

private DateTime? _endDate;

protected override Task OnParametersSetAsync()
{
Expand All @@ -86,6 +89,7 @@
_email = CurrentEmployeeData.Email;
_employeeId = CurrentEmployeeData.EmployeeId;
_startDate = CurrentEmployeeData.StartDate;
_endDate = CurrentEmployeeData.EndDate;
}

return base.OnParametersSetAsync();
Expand All @@ -103,7 +107,8 @@
EmployeeId = _employeeId ?? 0,
Name = _name ?? string.Empty,
Email = _email ?? string.Empty,
StartDate = _startDate
StartDate = _startDate,
EndDate = _endDate
};

try
Expand Down Expand Up @@ -135,5 +140,4 @@
{
MudDialog.Cancel();
}

}

0 comments on commit ebb7355

Please sign in to comment.