23 lines
825 B
Plaintext
23 lines
825 B
Plaintext
@page "/organization/department"
|
|
@using Indotalent.Features.Organization.Department
|
|
@using Indotalent.Features.Organization.Department.Cqrs
|
|
@using MudBlazor
|
|
|
|
@if (_view == View.Create)
|
|
{
|
|
<_DepartmentCreateForm OnCancel="() => _view = View.Table" OnSuccess="() => _view = View.Table" />
|
|
}
|
|
else if (_view == View.Update || _view == View.Detail)
|
|
{
|
|
<_DepartmentUpdateForm Data="_data!" ReadOnly="@(_view == View.Detail)" OnCancel="() => _view = View.Table" OnSuccess="() => _view = View.Table" />
|
|
}
|
|
else
|
|
{
|
|
<_DepartmentDataTable OnAdd="() => _view = View.Create" OnEdit="d => { _data = d; _view = View.Update; }" OnView="d => { _data = d; _view = View.Detail; }" />
|
|
}
|
|
|
|
@code {
|
|
private enum View { Table, Create, Update, Detail }
|
|
private View _view = View.Table;
|
|
private UpdateDepartmentRequest? _data;
|
|
} |