private void checkWord_Click_1(object sender, EventArgs e) { isClickeable = false; timer.Enabled = true; string wordOnLettrs = wordService.getWordById(translationForTestList.word_id_2); int n = wordOnLettrs.Length; char[] chars = wordOnLettrs.ToCharArray(); for (int i = 0; i < n; i++) { if (chars[i].ToString() != buttonArray[i].Text) { panel2.BackColor = Color.LightPink; if_word_is_correct = false; //return; } } if (if_word_is_correct) { panel2.BackColor = Color.LightGreen; translationForTestList.retry_count = (short)(translationForTestList.retry_count + 2); } //else //translationForTestList.retry_count = (short)(translationForTestList.retry_count - 1); translationForTestList.last_attempt_timestamp = DateTime.Now; translationDBservice.update(translationForTestList); if_word_is_correct = true; }
private void checkWord(Button clickedButton) { setProperColorsOnButtons(); isClickeable = false; timer.Enabled = true; if (clickedButton.Text == wordToTranslatePair.Value) { rightTranslation.retry_count = (short)(rightTranslation.retry_count - 1); } else { rightTranslation.retry_count = (short)(rightTranslation.retry_count + 1); applicationSettingsService.incrementMistakeCounterByOne(); } rightTranslation.last_attempt_timestamp = DateTime.Now; translationDBservice.update(rightTranslation); }