コード例 #1
0
        protected override async Task OnInitializedAsync()
        {
            try
            {
                EmployeeService    = ScopedServices.GetRequiredService <IEmployeeService>();
                AppSettingsService = ScopedServices.GetRequiredService <IAppSettingsService>();
                DataTableService   = ScopedServices.GetRequiredService <IDataTableService <Account, AccountFilter> >();
                LdapService        = ScopedServices.GetRequiredService <ILdapService>();

                SynchronizationService.UpdateEmployeeDetailsPage += UpdateEmployeeDetailsPage;
                SynchronizationService.UpdateHardwareVaultState  += UpdateHardwareVaultState;

                await LoadEmployeeAsync();

                await BreadcrumbsService.SetEmployeeDetails(Employee?.FullName);
                await LoadLdapSettingsAsync();

                await DataTableService.InitializeAsync(EmployeeService.GetAccountsAsync, EmployeeService.GetAccountsCountAsync, StateHasChanged, nameof(Account.Name), entityId : EmployeeId);

                await LoadEmployeeSsoState();

                SetInitialized();
            }
            catch (Exception ex)
            {
                SetLoadFailed(ex.Message);
                Logger.LogError(ex.Message);
            }
        }
コード例 #2
0
        protected override async Task OnInitializedAsync()
        {
            try
            {
                ApplicationUserService = ScopedServices.GetRequiredService <IApplicationUserService>();
                EmailSenderService     = ScopedServices.GetRequiredService <IEmailSenderService>();
                DataTableService       = ScopedServices.GetRequiredService <IDataTableService <ApplicationUser, ApplicationUserFilter> >();

                SynchronizationService.UpdateAdministratorsPage     += UpdateAdministratorsPage;
                SynchronizationService.UpdateAdministratorStatePage += UpdateAdministratorStatePage;

                AuthenticationState = await AuthenticationStateProvider.GetAuthenticationStateAsync();

                await BreadcrumbsService.SetAdministrators();

                await DataTableService.InitializeAsync(ApplicationUserService.GetAdministratorsAsync, ApplicationUserService.GetAdministratorsCountAsync, StateHasChanged, nameof(ApplicationUser.Email), ListSortDirection.Ascending);

                SetInitialized();
            }
            catch (Exception ex)
            {
                Logger.LogError(ex.Message);
                SetLoadFailed(ex.Message);
            }
        }
コード例 #3
0
        protected override async Task OnInitializedAsync()
        {
            try
            {
                WorkstationService = ScopedServices.GetRequiredService <IWorkstationService>();
                DataTableService   = ScopedServices.GetRequiredService <IDataTableService <Workstation, WorkstationFilter> >();
                SynchronizationService.UpdateWorkstationsPage += UpdateWorkstationsPage;

                switch (DashboardFilter)
                {
                case "NotApproved":
                    DataTableService.DataLoadingOptions.Filter.Approved = false;
                    break;

                case "Online":
                    //TODO
                    break;
                }

                await BreadcrumbsService.SetWorkstations();

                await DataTableService.InitializeAsync(WorkstationService.GetWorkstationsAsync, WorkstationService.GetWorkstationsCountAsync, StateHasChanged, nameof(Workstation.Name));

                SetInitialized();
            }
            catch (Exception ex)
            {
                Logger.LogError(ex.Message);
                SetLoadFailed(ex.Message);
            }
        }
コード例 #4
0
        protected override async Task OnInitializedAsync()
        {
            try
            {
                WorkstationAuditService = ScopedServices.GetRequiredService <IWorkstationAuditService>();
                DataTableService        = ScopedServices.GetRequiredService <IDataTableService <WorkstationSession, WorkstationSessionFilter> >();

                switch (DashboardFilter)
                {
                case "NonHideezUnlock":
                    DataTableService.DataLoadingOptions.Filter.UnlockedBy = Hideez.SDK.Communication.SessionSwitchSubject.NonHideez;
                    break;

                case "LongOpenSession":
                    DataTableService.DataLoadingOptions.Filter.Query = WorkstationAuditService.SessionQuery().Where(x => x.StartDate <= DateTime.UtcNow.AddHours(-12) && x.EndDate == null);
                    break;

                case "OpenedSessions":
                    DataTableService.DataLoadingOptions.Filter.Query = WorkstationAuditService.SessionQuery().Where(x => x.EndDate == null);
                    break;
                }

                await BreadcrumbsService.SetAuditWorkstationSessions();

                await DataTableService.InitializeAsync(WorkstationAuditService.GetWorkstationSessionsAsync, WorkstationAuditService.GetWorkstationSessionsCountAsync, StateHasChanged, nameof(WorkstationSession.StartDate), ListSortDirection.Descending);

                SetInitialized();
            }
            catch (Exception ex)
            {
                Logger.LogError(ex.Message);
                SetLoadFailed(ex.Message);
            }
        }
コード例 #5
0
        protected override async Task OnInitializedAsync()
        {
            try
            {
                HardwareVaultService = ScopedServices.GetRequiredService <IHardwareVaultService>();
                DataTableService     = ScopedServices.GetRequiredService <IDataTableService <HardwareVault, HardwareVaultFilter> >();

                SynchronizationService.UpdateHardwareVaultsPage += UpdateHardwareVaultsPage;
                SynchronizationService.UpdateHardwareVaultState += UpdateHardwareVaultState;

                switch (DashboardFilter)
                {
                case "LowBattery":
                    DataTableService.DataLoadingOptions.Filter.Battery = "low";
                    break;

                case "VaultLocked":
                    DataTableService.DataLoadingOptions.Filter.Status = VaultStatus.Locked;
                    break;

                case "VaultReady":
                    DataTableService.DataLoadingOptions.Filter.Status = VaultStatus.Ready;
                    break;

                case "LicenseWarning":
                    DataTableService.DataLoadingOptions.Filter.LicenseStatus = VaultLicenseStatus.Warning;
                    break;

                case "LicenseCritical":
                    DataTableService.DataLoadingOptions.Filter.LicenseStatus = VaultLicenseStatus.Critical;
                    break;

                case "LicenseExpired":
                    DataTableService.DataLoadingOptions.Filter.LicenseStatus = VaultLicenseStatus.Expired;
                    break;
                }

                await BreadcrumbsService.SetHardwareVaults();

                await DataTableService.InitializeAsync(HardwareVaultService.GetVaultsAsync, HardwareVaultService.GetVaultsCountAsync, StateHasChanged, nameof(HardwareVault.Id));

                SetInitialized();
            }
            catch (Exception ex)
            {
                Logger.LogError(ex.Message);
                SetLoadFailed(ex.Message);
            }
        }
コード例 #6
0
ファイル: ByEmployeesTab.razor.cs プロジェクト: minkione/HES
        protected override async Task OnInitializedAsync()
        {
            try
            {
                WorkstationAuditService = ScopedServices.GetRequiredService <IWorkstationAuditService>();
                DataTableService        = ScopedServices.GetRequiredService <IDataTableService <SummaryByEmployees, SummaryFilter> >();
                await DataTableService.InitializeAsync(WorkstationAuditService.GetSummaryByEmployeesAsync, WorkstationAuditService.GetSummaryByEmployeesCountAsync, StateHasChanged, nameof(SummaryByEmployees.Employee), syncPropName : "Employee");

                SetInitialized();
            }
            catch (Exception ex)
            {
                Logger.LogError(ex.Message);
                SetLoadFailed(ex.Message);
            }
        }
コード例 #7
0
        protected override async Task OnInitializedAsync()
        {
            try
            {
                WorkstationAuditService = ScopedServices.GetRequiredService <IWorkstationAuditService>();
                DataTableService        = ScopedServices.GetRequiredService <IDataTableService <WorkstationEvent, WorkstationEventFilter> >();

                await BreadcrumbsService.SetAuditWorkstationEvents();

                await DataTableService.InitializeAsync(WorkstationAuditService.GetWorkstationEventsAsync, WorkstationAuditService.GetWorkstationEventsCountAsync, StateHasChanged, nameof(WorkstationEvent.Date), ListSortDirection.Descending);

                SetInitialized();
            }
            catch (Exception ex)
            {
                Logger.LogError(ex.Message);
                SetLoadFailed(ex.Message);
            }
        }
コード例 #8
0
        protected override async Task OnInitializedAsync()
        {
            try
            {
                LicenseService   = ScopedServices.GetRequiredService <ILicenseService>();
                DataTableService = ScopedServices.GetRequiredService <IDataTableService <LicenseOrder, LicenseOrderFilter> >();

                SynchronizationService.UpdateLicensesPage += UpdateLicensesPage;

                await BreadcrumbsService.SetLicenseOrders();

                await DataTableService.InitializeAsync(LicenseService.GetLicenseOrdersAsync, LicenseService.GetLicenseOrdersCountAsync, StateHasChanged, nameof(LicenseOrder.CreatedAt), ListSortDirection.Descending);

                SetInitialized();
            }
            catch (Exception ex)
            {
                Logger.LogError(ex.Message);
                SetLoadFailed(ex.Message);
            }
        }
コード例 #9
0
        protected override async Task OnInitializedAsync()
        {
            try
            {
                EmployeeService  = ScopedServices.GetRequiredService <IEmployeeService>();
                DataTableService = ScopedServices.GetRequiredService <IDataTableService <Employee, EmployeeFilter> >();

                SynchronizationService.UpdateEmployeePage += UpdateEmployeePage;

                await BreadcrumbsService.SetEmployees();

                await DataTableService.InitializeAsync(EmployeeService.GetEmployeesAsync, EmployeeService.GetEmployeesCountAsync, StateHasChanged, nameof(Employee.FullName));

                SetInitialized();
            }
            catch (Exception ex)
            {
                Logger.LogError(ex.Message);
                SetLoadFailed(ex.Message);
            }
        }
コード例 #10
0
        protected override async Task OnInitializedAsync()
        {
            try
            {
                WorkstationService = ScopedServices.GetRequiredService <IWorkstationService>();
                DataTableService   = ScopedServices.GetRequiredService <IDataTableService <WorkstationProximityVault, WorkstationDetailsFilter> >();
                SynchronizationService.UpdateWorkstationDetailsPage += UpdateWorkstationDetailsPage;
                await LoadWorkstationAsync();

                await BreadcrumbsService.SetWorkstationDetails(Workstation.Name);

                await DataTableService.InitializeAsync(WorkstationService.GetProximityVaultsAsync, WorkstationService.GetProximityVaultsCountAsync, StateHasChanged, nameof(WorkstationProximityVault.HardwareVaultId), entityId : WorkstationId);

                SetInitialized();
            }
            catch (Exception ex)
            {
                Logger.LogError(ex.Message);
                SetLoadFailed(ex.Message);
            }
        }
コード例 #11
0
        protected override async Task OnInitializedAsync()
        {
            try
            {
                HardwareVaultService = ScopedServices.GetRequiredService <IHardwareVaultService>();
                DataTableService     = ScopedServices.GetRequiredService <IDataTableService <HardwareVaultProfile, HardwareVaultProfileFilter> >();

                SynchronizationService.UpdateHardwareVaultProfilesPage += UpdateHardwareVaultProfilesPage;

                await DataTableService.InitializeAsync(HardwareVaultService.GetHardwareVaultProfilesAsync, HardwareVaultService.GetHardwareVaultProfileCountAsync, StateHasChanged, nameof(HardwareVaultProfile.Name), ListSortDirection.Ascending);

                await BreadcrumbsService.SetHardwareVaultProfiles();

                SetInitialized();
            }
            catch (Exception ex)
            {
                Logger.LogError(ex.Message);
                SetLoadFailed(ex.Message);
            }
        }
コード例 #12
0
        protected override async Task OnInitializedAsync()
        {
            try
            {
                SharedAccountService = ScopedServices.GetRequiredService <ISharedAccountService>();
                DataTableService     = ScopedServices.GetRequiredService <IDataTableService <SharedAccount, SharedAccountsFilter> >();

                SynchronizationService.UpdateSharedAccountsPage += UpdateSharedAccountsPage;

                await BreadcrumbsService.SetSharedAccounts();

                await DataTableService.InitializeAsync(SharedAccountService.GetSharedAccountsAsync, SharedAccountService.GetSharedAccountsCountAsync, StateHasChanged, nameof(SharedAccount.Name), ListSortDirection.Ascending);

                SetInitialized();
            }
            catch (Exception ex)
            {
                Logger.LogError(ex.Message);
                SetLoadFailed(ex.Message);
            }
        }