Esempio n. 1
0
        public async Task CreateWorkPermit()
        {
            await _createLock.WaitAsync();

            var permit = new WorkPermitViewModel(null, null);

            SelectedPermit = permit;
            WorkPermits.Add(permit);
        }
Esempio n. 2
0
        public async Task Initialize()
        {
            if (!await _initLock.WaitAsync(0))
            {
                return;
            }

            var list = await _workPermitRepository.FindAll();

            foreach (var workPermit in list)
            {
                var attachment = (await _attachmentRepository.FindAll()).Where(a => a.WorkPermitId == workPermit.Id);
                var permit     = new WorkPermitViewModel(workPermit, attachment);
                WorkPermits.Add(permit);
            }

            _createLock.Release();
        }