private static void CreateNewSources(Candidate destination, CandidateDTO source) { source.Sources.Where(x => x.IsNew()).ToList().ForEach(newSource => { var toDomain = new CandidateSource(); toDomain.Update(newSource); destination.Sources.Add(toDomain); }); }
public static Candidate GetCandidateEntity( CandidateSource item, IReadOnlyList <int> weightings) { var candidate = new Candidate { CandidateId = item.CandidateId, Name = item.Name, FirstName = CandidateHelper.GetFirstName(item.Name), LastName = CandidateHelper.GetLastName(item.Name), CandidateSkills = CandidateHelper.GetCandidateSkills( item.CandidateId, item.SkillTags, weightings) }; candidate.SkillTags = CandidateHelper.GetCandidatesSkillsCsv(candidate.CandidateSkills); return(candidate); }
public static void Update(this CandidateSource domain, CandidateSourceDTO dto) { domain.Path = dto.Path; domain.SourceId = dto.SourceId; domain.State = dto.State; }
public void Add_Candidate() { var _controller = new CandidatesController(new DummyRepositoryFacade()); _controller.Request = new System.Net.Http.HttpRequestMessage(); _controller.Configuration = new System.Web.Http.HttpConfiguration(); #region Candidate Comment candidateComment = new Comment() { CommentType = CommentType.Candidate, Message = "msg", RelativeId = 0, }; File candidateFile = new File() { Description = "description", FilePath = "path", }; CandidateSource candidateSource = new CandidateSource() { Path = "Path", Source = Source.HeadHunter, }; Language language = new Language() { Id = 1, Title = "language" }; LanguageSkill languageSkill = new LanguageSkill() { Language = language, LanguageLevel = LanguageLevel.Fluent, }; Country country = new Country() { Title = "name" }; Location city = new Location() { Id = 1, Country = country, Title = "dnepr" }; Photo photo = new Photo() { Description = "descr", ImagePath = "path" }; Skill skill = new Skill() { Id = 1, Title = "C#" }; SocialNetwork socialNetwork = new SocialNetwork() { Id = 1, ImagePath = "path", Title = "Path" }; CandidateSocial candidateSocial = new CandidateSocial() { Path = "path", SocialNetwork = socialNetwork, }; Candidate candidate = new Candidate() { Skype = "skype", BirthDate = DateTime.Now, Comments = new List <Comment>() { candidateComment }, Description = "descrpition", Education = "High", Email = "email", Files = new List <File>() { candidateFile }, Sources = new List <CandidateSource>() { candidateSource }, FirstName = "TESTNAME", IsMale = true, LanguageSkills = new List <LanguageSkill>() { languageSkill }, LastName = "lname", Location = city, MiddleName = "mname", PhoneNumbers = new List <PhoneNumber>() { new PhoneNumber { Number = "+380978762352" } }, Photo = photo, PositionDesired = "architecht", Practice = "best", RelocationAgreement = true, SalaryDesired = 10500, Skills = new List <Skill>() { skill }, SocialNetworks = new List <CandidateSocial>() { candidateSocial }, TypeOfEmployment = TypeOfEmployment.FullTime, VacanciesProgress = new List <VacancyStageInfo>() { } }; #endregion }
public DummyBotContext() { #region Candidate Comment candidateComment = new Comment() { CommentType = CommentType.Candidate, Message = "msg", RelativeId = 0, }; File candidateFile = new File() { Description = "description", FilePath = "path", }; CandidateSource candidateSource = new CandidateSource() { Path = "Path", Source = Source.HeadHunter, }; LanguageSkill languageSkill = new LanguageSkill() { Language = _languages[0], LanguageLevel = LanguageLevel.Fluent, }; Photo photo = new Photo() { Description = "descr", ImagePath = "path" }; SocialNetwork socialNetwork = new SocialNetwork() { Id = 1, ImagePath = "path", Title = "Path" }; _socialNetworks.Add(socialNetwork); CandidateSocial candidateSocial = new CandidateSocial() { Path = "path", SocialNetwork = socialNetwork, }; Candidate candidate = new Candidate() { Id = 1, Skype = "skype", BirthDate = DateTime.Now, Comments = new List <Comment>() { candidateComment }, Description = "descrpition", Education = "High", Email = "email", Industry = industries[0], StartExperience = DateTime.Now, Tags = new List <Tag>() { _tags[0] }, Files = new List <File>() { candidateFile }, Sources = new List <CandidateSource>() { candidateSource }, FirstName = "TESTNAME", IsMale = true, LanguageSkills = new List <LanguageSkill>() { languageSkill }, LastName = "lname", Location = _locations[0], MiddleName = "mname", PhoneNumbers = new List <PhoneNumber>() { new PhoneNumber() { Id = 1, Number = "+380978762352" } }, Photo = photo, PositionDesired = "architecht", Practice = "best", RelocationAgreement = true, SalaryDesired = 10500, Skills = new List <Skill>() { _skills[0] }, SocialNetworks = new List <CandidateSocial>() { candidateSocial }, TypeOfEmployment = TypeOfEmployment.FullTime, VacanciesProgress = new List <VacancyStageInfo>() { } }; #endregion Comment vacancyComment = new Comment() { CommentType = CommentType.Vacancy, Message = "msg", RelativeId = 0, }; File vacancyFile = new File() { Description = "file", FilePath = "path", }; Permission permission = new Permission() { Id = 1, AccessRights = AccessRights.AddCandidateToVacancy, Description = "Permis", }; Role role = new Role() { Id = 1, Title = "adm", Permissions = new List <Permission>() { permission }, }; User user = new User() { Id = 1, BirthDate = DateTime.Now, Email = "mail", FirstName = "fname", isMale = true, LastName = "lastname", Location = _locations[0], Login = "******", Password = "******", MiddleName = "mname", PhoneNumbers = new List <PhoneNumber>() { new PhoneNumber() { Number = "+3565234662" } }, Photo = photo, Role = role, Skype = "skype", }; Vacancy vacancy = new Vacancy() { Id = 1, TypeOfEmployment = TypeOfEmployment.FullTime, Title = "Architecht", Comments = new List <Comment>() { vacancyComment }, DeadlineDate = DateTime.Now, Description = "descr", EndDate = DateTime.Now, Files = new List <File>() { vacancyFile }, LanguageSkill = languageSkill, Level = new List <Level>() { Level.Senior }, Locations = new List <Location>() { _locations[0] }, ParentVacancy = null, RequiredSkills = new List <Skill>() { _skills[0] }, Responsible = user, SalaryMax = 100500, SalaryMin = 15, StartDate = DateTime.Now, Department = _departments[0], CandidatesProgress = new List <VacancyStageInfo>() }; Comment vsicomment = new Comment() { CommentType = CommentType.StageInfo, Message = "msg", RelativeId = 0, }; VacancyStage vs = new VacancyStage() { IsCommentRequired = true, Order = 1, Stage = _stages[0], Vacacny = vacancy }; VacancyStageInfo vsi = new VacancyStageInfo() { Candidate = candidate, Comment = vsicomment, VacancyStage = vs }; candidate.VacanciesProgress.Add(vsi); vacancy.CandidatesProgress.Add(vsi); _vacancies.Add(vacancy); _candidates.Add(candidate); }