internal void HandleAddJobToFavoritesCommand(JobViewModel parameter) { //if (parameter != null && !this.favoriteJobsCollection.Contains(parameter,EqualityComparer<JobViewModel>.Default)) if (parameter != null && !this.favoriteJobsCollection.Any(x => (x.JobID == parameter.JobID))) { //if(this.favoriteJobsCollection.Any(x=>(x.JobID == parameter.JobID)); this.favoriteJobsCollection.Add(parameter); DataPersister.AddJob(favoriteJobsFilename, parameter); } }
internal void HandleAddSkillCommand(SkillViewModel parameter) { if (parameter != null && !String.IsNullOrEmpty(parameter.SkillName) && !personalSkillset.Any(x => (x.SkillName == parameter.SkillName))) { personalSkillset.Add(parameter); this.NewSkill = new SkillViewModel(); DataPersister.AddSkill(personalSkillestFilename, parameter); } }
internal void HandleRemoveJobCommand(JobViewModel parameter) { //if (parameter != null && this.favoriteJobsCollection.Contains(parameter)) if (parameter != null && this.favoriteJobsCollection.Any(x => (x.JobID == parameter.JobID))) { this.favoriteJobsCollection.Remove(parameter); DataPersister.RemoveJob(favoriteJobsFilename, parameter.JobID); DisplayJobsCollection = this.favoriteJobsCollection; //this.OnPropertyChanged("FavoriteJobsCollection"); //this.OnPropertyChanged("ResultJobsCollection"); //this.OnPropertyChanged("DisplayJobsCollection"); } }
internal void HandleRemoveSkillsCommand(ICollection <SkillViewModel> parameter) { if (parameter != null && parameter.Count > 0) { var listToDelete = new List <SkillViewModel>(); foreach (var item in parameter) { if (personalSkillset.Any(x => (x.SkillName == item.SkillName))) { listToDelete.Add(item); } } if (listToDelete.Count > 0) { foreach (var item in listToDelete) { personalSkillset.Remove(item); //DataPersister.RemoveSkill(personalSkillestFilename,item.SkillName); } DataPersister.RemoveSkills(personalSkillestFilename, listToDelete); } } }
private async void LoadPersonalSkillset(string fileName) { PersonalSkillset = await DataPersister.GetSkills(fileName); }
private async void LoadFavoriteJobs(string fileName) { this.FavoriteJobsCollection = await DataPersister.GetJobs(fileName); }