Ejemplo n.º 1
0
        private async Task LoadDataAsync()
        {
            var filter = new HardwareVaultFilter()
            {
                Status = VaultStatus.Ready
            };

            TotalRecords = await HardwareVaultService.GetVaultsCountAsync(new DataLoadingOptions <HardwareVaultFilter>
            {
                SearchText = SearchText,
                Filter     = filter
            });

            HardwareVaults = await HardwareVaultService.GetVaultsAsync(new DataLoadingOptions <HardwareVaultFilter>
            {
                Take          = TotalRecords,
                SortedColumn  = nameof(HardwareVault.Id),
                SortDirection = ListSortDirection.Ascending,
                SearchText    = SearchText,
                Filter        = filter
            });

            SelectedHardwareVault = null;
            StateHasChanged();
        }
Ejemplo n.º 2
0
        private async Task LoadDataAsync()
        {
            var filter = new HardwareVaultFilter()
            {
                Status = VaultStatus.Active
            };

            TotalRecords = await HardwareVaultService.GetVaultsCountAsync(new DataLoadingOptions <HardwareVaultFilter>
            {
                SearchText = SearchText,
                Filter     = filter
            });

            HardwareVaults = await HardwareVaultService.GetVaultsAsync(new DataLoadingOptions <HardwareVaultFilter>
            {
                Take          = TotalRecords,
                SortedColumn  = nameof(HardwareVault.Id),
                SortDirection = ListSortDirection.Ascending,
                SearchText    = SearchText,
                Filter        = filter
            });

            var count = await WorkstationService.GetProximityVaultsCountAsync(new DataLoadingOptions <WorkstationDetailsFilter>() { EntityId = WorkstationId });

            var proximityVaultFilter = new DataLoadingOptions <WorkstationDetailsFilter>()
            {
                Take          = count,
                SortedColumn  = nameof(WorkstationProximityVault.HardwareVaultId),
                SortDirection = ListSortDirection.Ascending,
                EntityId      = WorkstationId
            };
            var proximityVaults = await WorkstationService.GetProximityVaultsAsync(proximityVaultFilter);

            AlreadyAdded = proximityVaults.Count > 0;

            HardwareVaults        = HardwareVaults.Where(x => !proximityVaults.Select(s => s.HardwareVaultId).Contains(x.Id)).ToList();
            SelectedHardwareVault = null;
            StateHasChanged();
        }
Ejemplo n.º 3
0
 private async Task ClearAsync()
 {
     Filter = new HardwareVaultFilter();
     await FilterChanged.Invoke(Filter);
 }
Ejemplo n.º 4
0
 protected override void OnInitialized()
 {
     Filter            = new HardwareVaultFilter();
     VaultStatusList   = new SelectList(Enum.GetValues(typeof(VaultStatus)).Cast <VaultStatus>().ToDictionary(t => (int)t, t => t.ToString()), "Key", "Value");
     LicenseStatusList = new SelectList(Enum.GetValues(typeof(VaultLicenseStatus)).Cast <VaultLicenseStatus>().ToDictionary(t => (int)t, t => t.ToString()), "Key", "Value");
 }
Ejemplo n.º 5
0
        public async Task<ActionResult<IEnumerable<HardwareVault>>> GetFilteredHardwareVaults(HardwareVaultFilter hardwareVaultFilter)
        {
            var count = await _hardwareVaultService.GetVaultsCountAsync(new DataLoadingOptions<HardwareVaultFilter>
            {
                Filter = hardwareVaultFilter
            });

            return await _hardwareVaultService.GetVaultsAsync(new DataLoadingOptions<HardwareVaultFilter>
            {
                Take = count,
                SortedColumn = nameof(HardwareVault.Id),
                SortDirection = ListSortDirection.Ascending,
                Filter = hardwareVaultFilter
            });
        }