Ejemplo n.º 1
0
        private async Task RefreshAsync()
        {
            Log("Refreshing data...");

            var items = await Task.Run(() => _uow.Chapels.GetAll());

            DataItemList.Clear();
            foreach (var item in items)
            {
                DataItemList.Add(item);
            }

            Log("Loaded");
        }
Ejemplo n.º 2
0
        public void Refresh()
        {
            // 清除原有資料
            DataItemList.Clear();
            Random fooRM = new Random();

            // 隨機新增多筆新的資料
            for (int i = 0; i < fooRM.Next(20, 100); i++)
            {
                DataItemList.Add(new DataItem
                {
                    DataVale = $"多奇數位創意有限公司 {fooRM.Next(9999)}",
                });
            }
        }
        private async Task RefreshAsync()
        {
            Log("Refreshing data...");

            using (var uow = _uowFactory.CreateNew())
            {
                var dbManagers = await Task.Run(() => uow.Managers.GetAll());

                DataItemList.Clear();
                foreach (var item in dbManagers)
                {
                    DataItemList.Add(item);
                }
                _persons = await Task.Run(() => uow.Persons.GetUnemployeedPersons());

                addBtn.IsEnabled = _persons.Any();
            }
            Log("Loaded");
        }
        private async Task RefreshAsync()
        {
            Log("Refreshing data...");

            using (var uow = _uowFactory.CreateNew())
            {
                var dbDeathRecords = await Task.Run(() => uow.DeathRecords.GetAll());

                DataItemList.Clear();
                foreach (var item in dbDeathRecords)
                {
                    DataItemList.Add(item);
                }
                _alivePersons = await Task.Run(() => uow.Persons.GetAlivePersons());

                addBtn.IsEnabled = _alivePersons.Any();
            }
            Log("Loaded");
        }
Ejemplo n.º 5
0
        private async Task RefreshAsync()
        {
            Log("Refreshing data...");

            using (var uow = _uowFactory.CreateNew())
            {
                var contracts = await Task.Run(() => uow.Contracts.GetAll());

                DataItemList.Clear();
                foreach (var item in contracts)
                {
                    DataItemList.Add(item);
                }

                _managers = await Task.Run(() => uow.Managers.GetAll());

                _familyMembers = await Task.Run(() => uow.FamilyMembers.GetAll());

                _chapels = await Task.Run(() => uow.Chapels.GetAll());

                addBtn.IsEnabled = _familyMembers.Any() && _managers.Any() && _chapels.Any();
            }
            Log("Loaded");
        }