Esempio n. 1
0
        public async Task <IEnumerable <PhysioTherapyFactor> > GetPhysioFactors(PhysTherFactGroup physTherFactGroup)
        {
            using (HospitalDbContext db = _contextFactory.CreateDbContext())
            {
                IList <PhysioTherapyFactor> result = await db.PhysioTherapyFactors
                                                     .AsQueryable().AsNoTracking()
                                                     .Where(p => p.PhysTherFactGroup == physTherFactGroup)
                                                     .Include(p => p.PhysTherFactGroup)
                                                     .ToListAsync();

                return(result);
            }
        }
Esempio n. 2
0
        private async Task GetPhysioFactors(PhysTherFactGroup physTherFactGroup)
        {
            IsLoadingPhysio = true;
            try
            {
                PhysioTherapyFactors.Clear();
                var res = await _therapyDataService.GetPhysioFactors(physTherFactGroup);

                foreach (PhysioTherapyFactor factor in res)
                {
                    PhysioTherapyFactors.Add(factor);
                }
            }
            catch (Exception ex)
            {
                NotificationManager.AddException(ex, 4);
            }
            IsLoadingPhysio = false;
        }