@using Indotalent.Features.Organization.EmployeeGroup @using Indotalent.Features.Organization.EmployeeGroup.Cqrs @using Indotalent.Shared.Utils @using MudBlazor @inject EmployeeGroupService EmployeeGroupService @inject ISnackbar Snackbar
Add New Employee Group Create a new segment for your employee base.
Group Name Description
Cancel @if (_processing) { Processing... } else { Create Group }
@code { [Parameter] public EventCallback OnCancel { get; set; } [Parameter] public EventCallback OnSuccess { get; set; } private MudForm _form = default!; private CreateEmployeeGroupValidator _validator = new(); private CreateEmployeeGroupRequest _model = new(); private bool _processing = false; private async Task Submit() { await _form.Validate(); if (!_form.IsValid) return; _processing = true; try { var response = await EmployeeGroupService.CreateEmployeeGroupAsync(_model); await Task.Delay(500); if (response != null && response.IsSuccess) { Snackbar.Add("Employee group created successfully", Severity.Success); await OnSuccess.InvokeAsync(); } } finally { _processing = false; } } }