Beispiel #1
0
        public void LoadData(LoadingType loadingType)
        {
            loadTimer.Stop();

            if (!IsLoading)
            {
                switch (loadingType)
                {
                case LoadingType.ChangedMaxRows:
                case LoadingType.ChangedDataInCurrentPage:
                case LoadingType.ChangedSelectedPage:
                case LoadingType.ChangedSearchCriteria:
                case LoadingType.ChangedBrandItems:
                    AsyncOperationService
                    .PerformAsyncOperation(AsyncOperationType.LoadCatalog, LoadPricelist, !IsLoading,
                                           ActionAfterLoadCatalog);
                    break;

                case LoadingType.ChangedDirectoryItems:
                    AsyncOperationService
                    .PerformAsyncOperation(AsyncOperationType.LoadBrands, LoadBrands, !IsLoading,
                                           ActionAfterLoadBrand);
                    break;

                case LoadingType.СhangedAdvancedSearch:
                    AsyncOperationService
                    .PerformAsyncOperation(AsyncOperationType.LoadDirectories, LoadDirectories, !IsLoading,
                                           ActionAfterLoadDirectory);
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
        }
 private void UpdateProductDirection(DateTimeOffset lastUpdate)
 {
     SetProductDirectionLabel();
     AsyncOperationService.PerformAsyncOperation(AsyncOperationType.LoadFromWeb,
                                                 LoadProductDirections,
                                                 lastUpdate,
                                                 UpdateInfoAfterLoadProductDirections);
 }
 private void UpdateDirectories(DateTimeOffset lastUpdate)
 {
     SetDirectoriesLabel();
     AsyncOperationService.PerformAsyncOperation(AsyncOperationType.LoadFromWeb,
                                                 LoadDirectories,
                                                 lastUpdate,
                                                 UpdateInfoAfterLoadDirectories);
 }
 private void UpdatePhotos(DateTimeOffset lastUpdate)
 {
     SetPhotosLabel();
     AsyncOperationService.PerformAsyncOperation(AsyncOperationType.LoadFromWeb,
                                                 LoadPhotos,
                                                 new PhotoRequestInfo(lastUpdate, ids),
                                                 UpdateInfoAfterLoadPhotos);
 }
 private void UpdateCatalogs(DateTimeOffset lastUpdate)
 {
     SetBrandsLabel();
     AsyncOperationService.PerformAsyncOperation(AsyncOperationType.LoadFromWeb,
                                                 LoadCatalogs,
                                                 lastUpdate,
                                                 UpdateInfoAfterLoadCatalogs);
 }
Beispiel #6
0
 private void RefreshBasketCapture(EventArgs args = null)
 {
     //decimal sum = DatabaseService.GetSumBasket();
     //BasketCaption = PrecisionService?.Convert(sum) + CurrencySuffix;
     AsyncOperationService
     .PerformAsyncOperation(databaseIsVerified ? AsyncOperationType.GetSumBasket : AsyncOperationType.CheckDatabase,
                            GetSumBasket, !DomainContext?.IsLoading ?? false, ActionAfterGetSumBasket);
 }