private void SaveDatabaseUpdateWord() { _unitOfWork.WordRepository.Update(SelectedDatabaseWord); DataBaseGrid[DataBaseGrid.IndexOf(DataBaseGrid.FirstOrDefault(x => x.Id == SelectedDatabaseWord.Id))] = SelectedDatabaseWord; OnPropertyChanged("DataFilterGrid"); var word = ProjectWordList.FirstOrDefault(x => x.Id == SelectedDatabaseWord.Id); if (word != null) { ProjectWordList[ProjectWordList.IndexOf(word)] = SelectedDatabaseWord; } OnPropertyChanged("ProjectWordList"); }
private void SaveProjectWord() { Word dataWord = DataBaseGrid.FirstOrDefault(x => x.Name == NewProjectWordToSave.Name); if (dataWord != null) { _unitOfWork.WordRepository.Update(NewProjectWordToSave); DataBaseGrid[DataBaseGrid.IndexOf(dataWord)] = NewProjectWordToSave; } else { _unitOfWork.WordRepository.Insert(NewProjectWordToSave); DataBaseGrid.Add(NewProjectWordToSave); } ProjectWordList.Add(DataBaseGrid.First(x => x.Name == NewProjectWordToSave.Name)); //OnPropertyChanged("ProjectWordList"); var selected = SelectedTextWord; CleareSaveProjectWord(); DeleteProjectSelectedWord(selected); }