예제 #1
0
        private void LoadUI()
        {
            SlotsView     = new ObservableCollection <DataAccess.DataModels.Slot>();
            BlocksView    = new ObservableCollection <Block>();
            SelectedBlock = null;
            _slotsList    = new List <DataAccess.DataModels.Slot>();
            _blocksList   = new List <DataAccess.DataModels.Block>();

            var task1 = Task.Run(async() => _slotsList = await _slotsRepository.GetAllSlotsAsync());
            var task2 = Task.Run(async() => _blocksList = await _blocksRepository.GetAllBlocksAsync());

            var result = Task.WhenAll(task1, task2);

            result.ContinueWith((t) =>
            {
                if (t.IsCompleted)
                {
                    Application.Current.Dispatcher.InvokeAsync(() =>
                    {
                        foreach (var slot in _slotsList)
                        {
                            SlotsView.Add(slot);
                        }
                        foreach (var block in _blocksList)
                        {
                            BlocksView.Add(block);
                        }
                    });
                }
            });
        }
예제 #2
0
        private async Task Load()
        {
            _slotsList = new List <DataAccess.DataModels.Slot>();
            _slotsList = await _slotsRepository.GetAllSlotsAsync();

            _blocksList = new List <DataAccess.DataModels.Block>();
            _blocksList = await _blocksRepository.GetAllBlocksAsync();
        }
        private async Task Load()
        {
            _slotsList = new List <DataAccess.DataModels.Slot>();
            _slotsList = await _slotsRepository.GetAllSlotsAsync();

            _parkingsList = new List <DataAccess.DataModels.Parking>();
            _parkingsList = await _parkingsRepository.GetAllParkingsAsync();
        }
        private async Task Load()
        {
            _parkingsList = new List <DataAccess.DataModels.Parking>();
            _parkingsList = await _parkingsRepository.GetAllParkingsAsync();

            _customersList = new List <Customer>();
            _customersList = await _customersRepository.GetAllCustomersAsync();

            _parkingLotsList = new List <ParkingLot>();
            _parkingLotsList = await _parkingLotsRepository.GetAllParkingLotsAsync();

            _monthlyIncomesList = new List <MonthlyIncome>();
            _monthlyIncomesList = await _monthlyIncomesRepository.GetMonthlyIncomesAsync();

            _slotsList = new List <Slot>();
            _slotsList = await _slotsRepository.GetAllSlotsAsync();
        }