private void SaveWord() { if (CurrentOptions.CurrentUser != null) { WordViewModel newWord = new WordViewModel(); newWord.OriginName = _newWord.OriginName; newWord.SecondName = _newWord.SecondName; newWord.Incorrect = _newWord.Incorrect; newWord.Correct = _newWord.Correct; newWord.WordID = _newWord.WordID; _dao.addWord(newWord.getWord()); NewWord = new WordViewModel(); } }
private void ConfirmWord() { Console.WriteLine("CONFIRM WORD"); bool correct = false; if (_currentWordIndex != null && _words.Count() > 0) { if (_currentWord.SecondName == _words.ElementAt((int)_currentWordIndex).SecondName) {//correct Console.WriteLine("Typed: " + _currentWord.SecondName); Console.WriteLine("Original: " + _words.ElementAt((int)_currentWordIndex).SecondName); Console.WriteLine("CORRECT"); ConfirmInfo = "DOBRZE"; correct = true; } else {//incorrect Console.WriteLine("Typed: " + _currentWord.SecondName); Console.WriteLine("Original: " + _words.ElementAt((int)_currentWordIndex).SecondName); Console.WriteLine("INCORRECT"); ConfirmInfo = "ŹLE"; correct = false; } //DAO _dao.updateWord(_currentWord.getWord(), correct); _currentWordIndex++; if (_words.Count > _currentWordIndex) {//next word copyWord(_words.ElementAt((int)_currentWordIndex), CurrentWord); } else { ConfirmInfo = _confirmInfo + "\nKoniec nauki" + "\nWybierz inny słownik i rozpocznij naukę"; _words = new List <WordViewModel>(); CurrentWord = new WordViewModel(); _currentWordIndex = null; Console.WriteLine("Przejrzane wszystkie wyrazy"); } } }