Exemple #1
0
        private void DeleteCourseProc()
        {
            if (MessageBox.Show("Are you sure?", "", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
            {
                //remove course
                //remove session
                //remove candidatesession
                //remove sessionlocation
                //remove qualificationsdevelopedbycourse
                //remove prerequisitesforcourse
                foreach (var v in CandidateSessionService.GetAll().Where(d => d.Session.CourseId == Course.Id))
                {
                    CandidateSessionService.Remove(v.CandidateId, v.SessionId);
                }

                foreach (var v in SessionService.GetAllSessions().Where(d => d.CourseId == Course.Id))
                {
                    SessionService.RemoveSession(v);
                }

                foreach (var v in SessionLocationService.GetAll().Where(d => d.Session.CourseId == Course.Id))
                {
                    SessionLocationService.Remove(v.SessionId, v.LocationId);
                }

                foreach (var v in SessionLocationService.GetAll().Where(d => d.Session.CourseId == Course.Id))
                {
                    SessionLocationService.Remove(v.SessionId, v.LocationId);
                }

                foreach (var v in QualificationDevelopedByCourseService.GetAll().Where(d => d.CourseId == Course.Id))
                {
                    QualificationDevelopedByCourseService.Remove(Course.Id, v.QualificationId);
                }

                foreach (var v in PrerequisitesForCourseService.GetAll().Where(d => d.CourseId == Course.Id))
                {
                    PrerequisitesForCourseService.Remove(Course.Id, v.QualificationId);
                }
                CourseService.RemoveCourse(Course);

                BackProc();
            }
        }
Exemple #2
0
        public void RemoveTest()
        {
            foreach (var v in QualificationsService.GetAllQualifications())
            {
                QualificationsService.RemoveQualification(v);
            }

            foreach (var v in AddressCandidateService.GetAllAddressCandidatePairs())
            {
                AddressCandidateService.Remove(v);
            }

            foreach (var v in AddressService.GetAllAdresses())
            {
                AddressService.RemoveAddress(v);
            }

            foreach (var v in CandidateQualificationService.GetAll())
            {
                CandidateQualificationService.RemoveQualificationFromCandidate(v.CandidateId, v.QualificationId);
            }

            foreach (var v in CandidateService.GetAllCandidates())
            {
                CandidateService.RemoveCandidate(v);
            }

            foreach (var v in CompanyService.GetAllCompanies())
            {
                CompanyService.RemoveCompany(v);
            }

            foreach (var v in CourseService.GetAllCourses())
            {
                CourseService.RemoveCourse(v);
            }

            foreach (var v in JobHistoryCompanyService.GetAll())
            {
                JobHistoryCompanyService.Remove(v.JobHistoryId, v.CompanyId);
            }

            foreach (var v in JobHistoryJobService.GetAll())
            {
                JobHistoryJobService.Remove(v.JobHistoryId, v.JobId);
            }

            foreach (var v in JobHistoryService.GetAllJobHistories())
            {
                JobHistoryService.RemoveJobHistory(v);
            }

            foreach (var v in JobService.GetAllJobs())
            {
                JobService.RemoveJob(v);
            }

            foreach (var v in LocationService.GetAllLocations())
            {
                LocationService.RemoveLocation(v);
            }

            foreach (var v in OpeningService.GetAllOpenings())
            {
                OpeningService.RemoveOpening(v);
            }

            foreach (var v in PlacementService.GetAllPlacements())
            {
                PlacementService.RemovePlacement(v);
            }

            foreach (var v in PrerequisitesForCourseService.GetAll())
            {
                PrerequisitesForCourseService.Remove(v.CourseId, v.QualificationId);
            }

            foreach (var v in QualificationDevelopedByCourseService.GetAll())
            {
                QualificationDevelopedByCourseService.Remove(v.CourseId, v.QualificationId);
            }
        }