public void WriteInJobOfferts() { Random r = new Random(); using (var db = new PracujContext()) { for (int i = 0; i < 10000; i++) { var job = new JobOffert { NiceToHave = AddNeeded(skills, 5), Requirements = AddNeeded(weRequire, 2), Post = professions[r.Next(0, professions.Length - 1)], Workplace = adress[r.Next(0, adress.Length - 1)], Responsabilities = AddNeeded(responsabilities, 2), WePropose = AddNeeded(wePropose, 2), CompanyName = companyNames[r.Next(0, companyNames.Length - 1)], TypeOfContractId = r.Next(1, typesOfContract.Length), LevelOfExperienceId = r.Next(1, levelOfExperience.Length), JobDescription = AddNeeded(responsabilities, 2) }; db.Add(job); db.SaveChanges(); } } }
public void WriteInServiceUser() { Random r = new Random(); using (var db = new PracujContext()) { for (int i = 1; i <= 10000; i++) { int expectedSalafyPriorRound = r.Next(20000, 200000); var usr = new ServiceUser { FirstName = firstnames[r.Next(0, firstnames.Length - 1)], LastName = lastnames[r.Next(0, lastnames.Length - 1)], Adress = adress[r.Next(0, adress.Length - 1)], PnoneNumber = r.Next(5000000, 9999999).ToString(), ExpectedSalary = (decimal)(Math.Round(expectedSalafyPriorRound / 100d, 0) * 100), Profession = professions[r.Next(0, professions.Length - 1)], Experience = MakingExperience(professions[r.Next(0, professions.Length - 1)]), DateOfBirth = BirthDate(), Skills = AddNeeded(skills, 3), LevelOfLanguageId = r.Next(1, 6), RecomendedOffertId = r.Next(1, 10000), SavedOffertId = r.Next(1, 10000), MyApplicationId = r.Next(1, 10000), Language = AddLanguage() }; db.Add(usr); db.SaveChanges(); } } }
public void WriteInTypeOfContract() { Random r = new Random(); using (var db = new PracujContext()) { for (int i = 0; i < typesOfContract.Length; i++) { var type = new TypeOfContract { Name = typesOfContract[i] }; db.Add(type); db.SaveChanges(); } } }
public void WriteInLevelOfExperience() { Random r = new Random(); using (var db = new PracujContext()) { for (int i = 0; i < levelOfExperience.Length; i++) { var lvl = new LevelOfExperience { Name = levelOfExperience[i] }; db.Add(lvl); db.SaveChanges(); } } }
public void WriteInLevelOfLanguage() { Random r = new Random(); using (var db = new PracujContext()) { string[] levels = { "A1", "A2", "B1", "B2", "C1", "C2" }; for (int i = 0; i < levels.Length; i++) { int indexLevel = r.Next(0, levels.Length - 1); var lvl = new LevelOfLanguage { Level = levels[i] }; db.Add(lvl); db.SaveChanges(); } } }