private void OnCandidateHistoryReceived(CandidateHistory candidateHistory)
        {
            dialogService.CloseDetailDialog();
            if (candidateHistory.ProjectID == 0)
            {
                return;
            }


            candidateHistoryRepository.AddCandidateHistory(candidateHistory);
            CandidateHistoryCollection.Add(candidateHistory);

            SelectedCandidate.CandidateProjects.Add(
                new ConfigProjectCandidate
            {
                ConfigCandidateID  = SelectedCandidateTemp.ID,
                ConfigProjectID    = candidateHistory.ProjectID,
                ConfigProjectLibID = candidateHistory.ConfigProjectLib,
                ProjectName        = candidateHistory.ProjectName,
                Company            = candidateHistory.CompanyName,
                Area = candidateHistory.AreaName,

                CompanyId    = candidateHistory.CompanyID,
                Position     = candidateHistory.Position,
                ConfigAreaID = candidateHistory.ConfigAreaId
            });

            var tempProjects = SelectedCandidate.CandidateProjects;

            SelectedCandidate.CandidateProjects = tempProjects;
            prepareCollection();
        }
        private void AddNewHistoryItem(object obj)
        {
            SelectedCandidateHstoryTemp.Seq                  = SelectedProjectHistory.Max(e => e.Seq) + 1;
            SelectedCandidateHstoryTemp.ConfigStatusID       = SelectedConfigStatusLib.ID;
            SelectedCandidateHstoryTemp.StatusName           = SelectedConfigStatusLib.Description;
            SelectedCandidateHstoryTemp.ProjectID            = SelectedProjectHistory.ToList().Select(e => e.ProjectID).FirstOrDefault();
            SelectedCandidateHstoryTemp.ProjectName          = SelectedProjectHistory.ToList().Select(e => e.ProjectName).FirstOrDefault();
            SelectedCandidateHstoryTemp.CompanyID            = SelectedProjectHistory.ToList().Select(e => e.CompanyID).FirstOrDefault();
            SelectedCandidateHstoryTemp.CompanyName          = SelectedProjectHistory.ToList().Select(e => e.CompanyName).FirstOrDefault();
            SelectedCandidateHstoryTemp.Position             = SelectedProjectHistory.ToList().Select(e => e.Position).FirstOrDefault();
            SelectedCandidateHstoryTemp.CandidatesProjectsID = SelectedProjectHistory.ToList().Select(e => e.CandidatesProjectsID).FirstOrDefault();
            SelectedCandidateHstoryTemp.CandidateID          = SelectedProjectHistory.ToList().Select(e => e.CandidateID).FirstOrDefault();
            SelectedProjectHistory.Add(SelectedCandidateHstoryTemp);
            CandidateHistoryCollection.Add(SelectedCandidateHstoryTemp);

            SelectedConfigStatusLib = null;

            candidateHistoryRepository.AddCandidateHistory(SelectedCandidateHstoryTemp);
            prepareCollection();
            SelectedCandidateHistory = SelectedCandidateHstoryTemp;
        }