public void UpdateAppointment(Appointment item)
        {
            var oldItem = _appointments.FirstOrDefault(i => i.ID == item.ID);

            if (oldItem != null)
            {
                oldItem = item;
            }
        }
        private async void Refresh()
        {
            var temp = await _personRepository.GetPeople();
            IEnumerable<Person> people = new ObservableCollection<Person>(temp)
                .Where(p => p.ID == App.LoggedInAccount.PersonID);
            ObservableCollection<Person> loggedin = new ObservableCollection<Person>(people);

            var temp2 = await _appointmentRepository.GetAppointments();
            IEnumerable<Appointment> appointments = new ObservableCollection<Appointment>(temp2)
                .Where(a => a.VolunteerID == loggedin[0].ID);

            EventList = new ObservableCollection<Appointment>(appointments);

            _selectedAppointment = new Appointment { Address = "", Destination = "" };
        }
        private void Submit()
        {
            Appointment newappt = new Appointment { EventName = eventTitle, SeniorID = SelectedSenior.ID, Address = address, Destination = destination };

            if (_wheelchairSelected)
            {
                AppointmentRequirements link = new AppointmentRequirements { AppointmentID = newappt.ID, RequirementID = 1 };
                _apptRequirementRepo.AddApptReqs(link);
            }

            if (_hearingSelected)
            {
                AppointmentRequirements link = new AppointmentRequirements { AppointmentID = newappt.ID, RequirementID = 2 };
                _apptRequirementRepo.AddApptReqs(link);
            }

            if (_visionSelected)
            {
                AppointmentRequirements link = new AppointmentRequirements { AppointmentID = newappt.ID, RequirementID = 3 };
                _apptRequirementRepo.AddApptReqs(link);
            }

            if (_otherSelected)
            {
                Requirement newReq = new Requirement { Description = otherReqs };
                _requirementRepo.AddRequirement(newReq);

                AppointmentRequirements link = new AppointmentRequirements { RequirementID = newReq.ID, AppointmentID = newappt.ID };
                _apptRequirementRepo.AddApptReqs(link);
            }
        }
 public void DeleteAppointment(Appointment item)
 {
     _appointments.Remove(item);
 }
 public void AddAppointment(Appointment item)
 {
     item.ID = _appointments.Last().ID + 1;
     _appointments.Add(item);
 }