예제 #1
0
 //private void PrepareDataToSave()
 //{
 //    //foreach (var user in Users)
 //    //    user.ToSave();
 //    //foreach (var hr in Recruters)
 //    //    hr.ToSave();
 //    foreach (var vacancy in Vacancies)
 //        vacancy.ToSave();
 //}
 public void SaveConfig()
 {
     //PrepareDataToSave();
     if (LocalFiles.SaveList(Users, "users.json") && LocalFiles.SaveList(Vacancies, "vacancies.json") &&
         LocalFiles.SaveList(Recruters, "recruters.json") && LocalFiles.SaveList(Applies, "applies.json"))
     {
         Console.WriteLine("Successfull saving!");
     }
     else
     {
         Console.WriteLine("Somethenig went wrong!");
     }
 }
예제 #2
0
 public Repository()
 {
     Universities = LocalFiles.LoadUniversities();
     Users        = LocalFiles.LoadList <User>("users.json");
     Recruters    = LocalFiles.LoadList <Recruter>("recruters.json");
     //Vacancies = LocalFiles.LoadList<Vacancy>("vacancies.json");
     LoadVacancies();
     LoadApplies();
     Recover();
     //foreach (var user in Users)
     //    user.ApplyIds.Clear();
     //foreach (var rec in Recruters)
     //    rec.VacIds.Clear();
     //foreach (var vac in Vacancies)
     //    vac.applyIds.Clear();
 }