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 ProjectSelectionChange(object obj) { SelectedProjectHistory = CandidateHistoryCollection.Where(e => e.ProjectID.Equals(SelectedCandidateHistory.ProjectID)).ToList().OrderByDescending(e => e.Seq).ToObservableCollection(); SelectedCandidateHstoryTemp = new CandidateHistory(); SelectedConfigStatusLib = null; ProjectEverSelected = true; }
private void AssignNewProject(object obj) { //int? newcandidateCompanyId = null; int?newCompanyId; int?newcandidateProjectsId; CandidateHistory = new CandidateHistory(); if (ReceivedCandidateProjects.Where(e => e.ConfigProjectID.Equals(SelectedProject.ID)).Any()) { MessengerCandidateHistory.Default.Send <CandidateHistory>(CandidateHistory); return; } if (!ConfigCompanyCollectionAll.Where(e => e.Company.ToUpper().Equals(obj.ToString().ToUpper())).Any()) { newCompanyId = configCompanyRepository.AddConfigCompany(obj.ToString()); ConfigCompanyCollectionAll.Add(new ConfigCompany() { ID = (int)newCompanyId, Company = obj.ToString() }); } newcandidateProjectsId = configProjectsCandidateRepository.AddConfigProjectCandidate (ReceivedCandidateProjects.Select(e => e.ConfigCandidateID).FirstOrDefault(), SelectedProject, SelectedPosition, ConfigCompanyCollectionAll.Where(e => e.Company.ToUpper().Equals(obj.ToString().ToUpper())).FirstOrDefault().ID); CandidateHistory.CandidateID = ReceivedCandidateProjects.Select(e => e.ConfigCandidateID).FirstOrDefault();; CandidateHistory.ProjectID = SelectedProject.ID; CandidateHistory.ProjectName = SelectedProject.ProjectName; CandidateHistory.Position = SelectedPosition; CandidateHistory.Timestamp = DateTime.Now; CandidateHistory.StatusName = SelectedStatus.Description; CandidateHistory.CompanyID = ConfigCompanyCollectionAll.Where(e => e.Company.ToUpper().Equals(obj.ToString().ToUpper())).FirstOrDefault().ID; CandidateHistory.CompanyName = ConfigCompanyCollectionAll.Where(e => e.Company.ToUpper().Equals(obj.ToString().ToUpper())).FirstOrDefault().Company; CandidateHistory.ConfigAreaId = SelectedProject.ConfigAreaID; CandidateHistory.AreaName = SelectedProject.AreaName; CandidateHistory.Seq = 1; CandidateHistory.ConfigStatusID = SelectedStatus.ID; CandidateHistory.Comments = Comment; CandidateHistory.CandidatesProjectsID = (int)newcandidateProjectsId; CandidateHistory.ConfigProjectLib = SelectedProject.ConfigProjectLibID; MessengerCandidateHistory.Default.Send <CandidateHistory>(CandidateHistory); //new CandidateCompany() { } }
public static IDictionary <string, object> MapCandidateHistoryDictionary(this CandidateHistory candidateHistory) { return(new Dictionary <string, object> { { "CandidateHistoryId", candidateHistory.CandidateHistoryId }, { "CandidateId", candidateHistory.CandidateId }, { "CandidateHistoryEventTypeId", candidateHistory.CandidateHistoryEventTypeId }, { "CandidateHistorySubEventTypeId", candidateHistory.CandidateHistorySubEventTypeId }, { "EventDate", candidateHistory.EventDate }, { "Comment", candidateHistory.Comment }, { "UserName", candidateHistory.UserName }, }); }
public void AddCandidateHistory(CandidateHistory CandidateHistory) { Dictionary <dynamic, dynamic> Args = new Dictionary <dynamic, dynamic>(); Args.Add("@SEQ", CandidateHistory.Seq); Args.Add("@CONFIG_STATUS_ID", CandidateHistory.ConfigStatusID); Args.Add("@TIMESTAMP", CandidateHistory.Timestamp); Args.Add("@COMMENTS", CandidateHistory.Comments); Args.Add("@HISTORY_OF_CONTACT", CandidateHistory.HistoryOfContact); Args.Add("@CV_RECEIVED", false); Args.Add("@CANDIDATES_PROJECTS_ID", CandidateHistory.CandidatesProjectsID); DBObjects.ExecSqlProcedure("ADD_CANDIDATE_HISTORY", Args); }
public void UpdateCandidateHistory(CandidateHistory CandidateHistory) { CandidateHistory CandidateHistoryToUpdate = CandidateHistorys.Where(e => e.ID.Equals(CandidateHistory.ID)).FirstOrDefault(); CandidateHistoryToUpdate = CandidateHistory; }
public void DeleteCandidateHistory(CandidateHistory CandidateHistory) { CandidateHistorys.Remove(CandidateHistory); }