public void UpdateRequirement(Requirement item)
        {
            var oldItem = Requirements.FirstOrDefault(i => i.ID == item.ID);

            if (oldItem != null)
            {
                oldItem = item;
            }
        }
コード例 #2
0
        private async void AttachRequirement(Requirement theRequirement, Senior theSenior = null, Volunteer theVolunteer = null, string additionalInformation = null)
        {
            //first we check to see who is getting the requirement
            bool isSenior;

            if (theSenior == null)
                isSenior = true;
            else if (theVolunteer == null)
                isSenior = false;
            else
                return;

            if (isSenior)
            {
                SeniorRequirements req = new SeniorRequirements();
                req.RequirementID = theRequirement.ID;
                req.SeniorID = theSenior.ID;
                req.AdditionalInformation = additionalInformation;

                await _seniorRequirements.InsertAsync(req);
            }
            else
            {
                VolunteerRequirements req = new VolunteerRequirements();
                req.RequirementID = theRequirement.ID;
                req.VolunteerID = theVolunteer.ID;

                await _volunteerRequirements.InsertAsync(req);
            }
        }
コード例 #3
0
 private async void AddRequirement(Requirement newRequirement)
 {
     await requirementTable.InsertAsync(newRequirement);
 }
コード例 #4
0
        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 DeleteRequirement(Requirement item)
 {
     Requirements.Remove(item);
 }
 public void AddRequirement(Requirement item)
 {
     item.ID = Requirements.Last().ID + 1;
     Requirements.Add(item);
 }