@using Indotalent.Features.Multitenant.Tenant.Cqrs @using Indotalent.Shared.Utils @using MudBlazor @inject TenantService TenantService @inject ISnackbar Snackbar
Add New Tenant Register a new multi-tenant organization.
General Information Tenant Name Phone Number Fax Number Email Address Website Address Information Street City State Zip Code Country Status Is Active Additional Notes Description
Cancel @if (_processing) { Processing... } else { Create Tenant }
@code { [Parameter] public EventCallback OnCancel { get; set; } [Parameter] public EventCallback OnSuccess { get; set; } private MudForm _form = default!; private CreateTenantValidator _validator = new(); private CreateTenantRequest _model = new(); private bool _processing = false; private async Task Submit() { await _form.Validate(); if (!_form.IsValid) return; _processing = true; try { var response = await TenantService.CreateTenantAsync(_model); await Task.Delay(500); if (response != null && response.IsSuccess) { Snackbar.Add("Tenant created successfully", Severity.Success); await OnSuccess.InvokeAsync(); } } finally { _processing = false; } } }