Пример #1
0
        public void HireCandidate()
        {
            if (SelectedCandidate == null)
            {
                MessageBox.Show("Please select a candidate");
                return;
            }
            if (MessageBox.Show("Are you sure?", "", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
            {
                var placement = PlacementService.AddPlacementToCandidate(new Placement()
                {
                    Candidate        = SelectedCandidate,
                    Opening          = Opening,
                    Timestamp        = DateTime.Now,
                    TotalHoursWorked = 0
                                       //TODO UPdate function to increase total hours worked
                });
                var jobHistory = JobHistoryService.AddJobHistory(new JobHistory()
                {
                    Candidate     = SelectedCandidate,
                    DateTimeStart = DateTime.Now,
                });
                var jobHistoryCompany = JobHistoryCompanyService.Add(new JobHistory_Company()
                {
                    JobHistory = jobHistory,
                    Company    = Opening.Company
                });
                var jobHistoryJob = JobHistoryJobService.Add(new JobHistory_Job()
                {
                    JobHistory = jobHistory,
                    Job        = Opening.Job
                });

                if (MessageBox.Show("Close opening?", "", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                {
                    OpeningsService.CloseOpening(Opening);
                }
                BackProc();

                //TODO opening does not disappear after candidate is hired
            }
        }
Пример #2
0
        public void Add()
        {
            var jobHistory = new JobHistory
            {
                CandidateNumber = SelectedCandidate.CandidateNumber,
                CompanyId       = SelectedCompany.CompanyId,
                WorkedFrom      = WorkedFrom
            };

            if (WorkedTo != null)
            {
                jobHistory.WorkedTo = WorkedTo;
            }
            if (WorkedHours != null)
            {
                jobHistory.WorkedHours = WorkedHours;
            }

            _jobHistoryService.AddJobHistory(jobHistory);

            AssociatedJobHistory = new JobHistoryViewModel(jobHistory);
        }