Exemplo n.º 1
0
        public async void GetLineAsync()
        {
            if (!String.IsNullOrEmpty(Line.Id))
            {
                Line = await lineRepository.GetAsync(Line.Id);

                GetActionAsync();
            }
        }
        private async void GetActionData(ActionModel action)
        {
            IsBusy = true;

            Action           = action;
            NumberOfPatients = (await patientRepository.GetAllByActionIdAsync(Action.Id)).Count();
            Line             = await lineRepository.GetAsync(Action.IdLine);

            IsBusy = false;
        }
        private async Task <ConcurrentBag <Line> > GetLinesCollectionAsync()
        {
            ConcurrentBag <Line> lines = new ConcurrentBag <Line>();
            ObservableCollection <ActionModel> action = new ObservableCollection <ActionModel>((await actionRepository.GetAllAsync()).Where(x => x.ResponsibleCollection != null && x.ResponsibleCollection.FirstOrDefault(m => m.Id == Settings.UserId) != null));

            for (int i = 0; i < action.Count(); i++)
            {
                Line lineResponsible = lines.FirstOrDefault(x => x.Id == action[i].IdLine);

                if (lineResponsible == null)
                {
                    lineResponsible = await lineRepository.GetAsync(action[i].IdLine);

                    lines.Add(lineResponsible);
                }
            }

            return(lines);
        }
Exemplo n.º 4
0
        public async void LoadLineAction(string IdAction)
        {
            try
            {
                IsBusy = true;

                Action = await actionRepository.GetAsync(IdAction);

                Line = await lineRepository.GetAsync(Action.IdLine);

                LinesCollection = await lineRepository.GetAllAsync();

                Day = DaysCollection[0];

                IsBusy = false;
            }
            catch (Exception)
            {
                throw;
            }
        }