@page "/organization/designation" @using Indotalent.Features.Organization.Designation @using Indotalent.Features.Organization.Designation.Cqrs @using MudBlazor @if (_view == View.Create) { <_DesignationCreateForm OnCancel="() => _view = View.Table" OnSuccess="() => _view = View.Table" /> } else if (_view == View.Update || _view == View.Detail) { <_DesignationUpdateForm Data="_data!" ReadOnly="@(_view == View.Detail)" OnCancel="() => _view = View.Table" OnSuccess="() => _view = View.Table" /> } else { <_DesignationDataTable 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 UpdateDesignationRequest? _data; }