Esempio n. 1
0
        async Task ExecuteLoadVisitsCommand(Guest selectedGuest)
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Visits.Clear();
                var visits = await VisitDataStore.GetMembersAsync(true);

                foreach (var visit in visits)
                {
                    if (visit.GuestId == selectedGuest.PersonalCode)
                    {
                        Visits.Add(visit);
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
Esempio n. 2
0
        async Task ExecuteLoadVisitsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Visits.Clear();
                var dorms = await VisitDataStore.GetMembersAsync(true);

                foreach (var dorm in dorms)
                {
                    if (Title == "History")
                    {
                        if (dorm.IsOver)
                        {
                            Visits.Add(dorm);
                        }
                    }
                    else if (Title == "Upcoming")
                    {
                        if (!dorm.IsOver)
                        {
                            Visits.Add(dorm);
                        }
                    }
                    else
                    {
                        Visits.Add(dorm);
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }