public static List <CompanyModel> InitializeJobApplicants(List <CompanyModel> companies) { var applicants = new List <ApplicantModel>() { new ApplicantModel("David", "Padilla"), new ApplicantModel("Don", "Draper"), new ApplicantModel("Rick", "Grimes"), new ApplicantModel("Sarah", "Connor"), new ApplicantModel("Jon", "Snow"), new ApplicantModel("Walter", "White"), new ApplicantModel("Ragnar", "Lothbrok"), new ApplicantModel("Dwayne", "Johnson"), new ApplicantModel("Sabrina", "Spellman"), new ApplicantModel("Daphne", "Bridgerton") }; foreach (var applicant in applicants) { applicant.Skillset = Randomizer(); foreach (var company in companies) { foreach (var jobPost in company.JobPostings) { jobPost.Applicants.Add(applicant); } } } SkillsetModel Randomizer() { var skillset = new SkillsetModel() { FrontendSkillset = new FrontendSkillsetModel(), BackendSkillset = new BackendSkillsetModel(), DatabaseSkillset = new DatabaseSkillsetModel() }; foreach (var lang in skillset.FrontendSkillset.GetType().GetProperties()) { lang.SetValue(skillset.FrontendSkillset, Convert.ToBoolean(Math.Round(new Random().NextDouble()))); } foreach (var lang in skillset.BackendSkillset.GetType().GetProperties()) { lang.SetValue(skillset.BackendSkillset, Convert.ToBoolean(Math.Round(new Random().NextDouble()))); } foreach (var lang in skillset.DatabaseSkillset.GetType().GetProperties()) { lang.SetValue(skillset.DatabaseSkillset, Convert.ToBoolean(Math.Round(new Random().NextDouble()))); } return(skillset); } return(companies); }
public static SkillsetModel IdentifyApplicantSkillset() { var skillset = new SkillsetModel() { FrontendSkillset = new FrontendSkillsetModel(), BackendSkillset = new BackendSkillsetModel(), DatabaseSkillset = new DatabaseSkillsetModel() }; SkillsetQuestionaire("front-end", skillset.FrontendSkillset); SkillsetQuestionaire("back-end", skillset.BackendSkillset); SkillsetQuestionaire("database", skillset.DatabaseSkillset); return(skillset); void SkillsetQuestionaire(string skillsetName, dynamic skillsetClass) { Console.WriteLine(); Console.WriteLine($"Do you have any experience working with {skillsetName} technology?"); Console.WriteLine("NOTE: Please key in y or n for each question."); var userSkillsetValidation = Console.ReadKey(); Console.WriteLine(); if (userSkillsetValidation.Key == ConsoleKey.Y) { foreach (var lang in skillsetClass.GetType().GetProperties()) { Console.WriteLine(); Console.WriteLine($"Have you worked with {lang.Name} before?"); lang.SetValue(skillsetClass, Console.ReadKey().Key == ConsoleKey.Y ? true : false); Console.WriteLine(); } } } }
public HttpResponseMessage GetAll(string parentId) { List <SkillsetModel> model = new List <SkillsetModel>(); IPublishedContent page = GetPage(parentId); IEnumerable <IPublishedContent> children = page.Children.Where(x => x.DocumentTypeAlias.Equals("Skillset")); if (children.Any()) { foreach (IPublishedContent child in children) { SkillsetModel skillset = new SkillsetModel() { Title = child.Name, Body = child.GetString("body"), Icon = child.GetImageSrc("icon") }; model.Add(skillset); } } return(Json(model)); }
public int RetrieveTopApplicantPercentage(SkillsetModel applicantSkillset, List <ApplicantModel> contenders, SkillsetModel requiredSkillset) { // Step One: Add Required Skills, Matching Applicant Skills, And Matching Contender Skills To Seperate Lists var employerSkillsetRequirements = new List <string>(); var applicantMatchedSkillset = new List <string>(); var contenderMatchingSkillsets = new List <List <string> >(); foreach (var contender in contenders) { var contenderMatchingSkillset = new List <string>(); AddMatchingSkillsToApplicantAndContenders(applicantSkillset.FrontendSkillset, contender.Skillset.FrontendSkillset, requiredSkillset.FrontendSkillset, contenderMatchingSkillset); AddMatchingSkillsToApplicantAndContenders(applicantSkillset.BackendSkillset, contender.Skillset.BackendSkillset, requiredSkillset.BackendSkillset, contenderMatchingSkillset); AddMatchingSkillsToApplicantAndContenders(applicantSkillset.DatabaseSkillset, contender.Skillset.DatabaseSkillset, requiredSkillset.DatabaseSkillset, contenderMatchingSkillset); contenderMatchingSkillsets.Add(contenderMatchingSkillset); } void AddMatchingSkillsToApplicantAndContenders(dynamic applicantSkillset, dynamic contenderSkillset, dynamic requiredSkillset, List <string> contenderMatchingSkillset) { foreach (var conSkill in contenderSkillset.GetType().GetProperties()) { foreach (var appSkill in applicantSkillset.GetType().GetProperties()) { foreach (var reqSkill in requiredSkillset.GetType().GetProperties()) { if (reqSkill.GetValue(requiredSkillset) && !employerSkillsetRequirements.Contains(reqSkill.Name)) { employerSkillsetRequirements.Add(reqSkill.Name); } if (appSkill.Name == reqSkill.Name && appSkill.GetValue(applicantSkillset) && reqSkill.GetValue(requiredSkillset) && !applicantMatchedSkillset.Contains(appSkill.Name)) { applicantMatchedSkillset.Add(appSkill.Name); } if (conSkill.Name == reqSkill.Name && conSkill.GetValue(contenderSkillset) && reqSkill.GetValue(requiredSkillset) && !contenderMatchingSkillset.Contains(conSkill.Name)) { contenderMatchingSkillset.Add(conSkill.Name); } } } } } // Step Two: Find Matching Skill Percentages Of All Contenders And Store Them var contenderMatchingPercentages = new List <double>(); foreach (var contenderMatchingSkillset in contenderMatchingSkillsets) { var contenderMatchingPercentage = Math.Round((double)contenderMatchingSkillset.Count / employerSkillsetRequirements.Count * 100, 2); contenderMatchingPercentages.Add(contenderMatchingPercentage); } // Step Three: Determine Applicant's Top Applicant Percentage var applicantRankNumber = contenderMatchingPercentages.Count; var applicantMatchingPercentage = Math.Round((double)applicantMatchedSkillset.Count / employerSkillsetRequirements.Count * 100, 2); foreach (var contenderMatchingPercentage in contenderMatchingPercentages) { if (applicantMatchingPercentage > contenderMatchingPercentage) { applicantRankNumber--; } } if (applicantRankNumber < contenderMatchingPercentages.Count * .10) { return(10); } if (applicantRankNumber < contenderMatchingPercentages.Count * .25) { return(25); } if (applicantRankNumber < contenderMatchingPercentages.Count * .50) { return(50); } else { return(0); } }