예제 #1
0
 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);
     }
 }
예제 #2
0
 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);
     }
 }
예제 #3
0
        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");
            }
        }
예제 #4
0
 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);
         }
     }
 }
예제 #5
0
 private async void LoadPersonalSkillset(string fileName)
 {
     PersonalSkillset = await DataPersister.GetSkills(fileName);
 }
예제 #6
0
 private async void LoadFavoriteJobs(string fileName)
 {
     this.FavoriteJobsCollection = await DataPersister.GetJobs(fileName);
 }