public void SetSelectedWord(WordProgressModel word) { selectedWord = word.word; WordCategoryModel categoryFound = db.WordCategories.Find( (cat) => cat.id == word.categoryId); Debug.Log(categoryFound); selectedWordCategory = categoryFound.categoryName; }
public IHttpActionResult RemoveWordProgress(WordProgressModel wordProgress) { if (wordProgress == null) { throw new ArgumentNullException("wordProgress", "WordProgress can't be null"); } return(wordProgressService.RemoveByStudent(wordProgressMapper.Map(wordProgress)) ? Ok() as IHttpActionResult : BadRequest() as IHttpActionResult); }
public void UpdateWordProgress(WordProgressModel wordProgress) { IDbCommand cmd = GetDbCommand(); cmd.CommandText = $@"UPDATE {TABLE_NAME} SET {TIMES_HIT}={wordProgress.timesHit}, {TIMES_ATTEMPTED}={wordProgress.timesAttempted} WHERE id={wordProgress.id}"; cmd.ExecuteNonQuery(); }
private void InitializeWordButton(int wordIndex) { WordProgressModel wordProgress = gm.GetWordProgressData(wordList[wordIndex]); currentWord.GetComponent <WordSelectionController>().SetWordProgress(wordProgress); currentWord.GetComponent <Button>().onClick.AddListener(() => { string selectedWord = wordList[wordIndex]; gm.SetSelectedWord(wordProgress); SetVideoDetails(selectedWord); }); }
public void Create(WordProgressModel wordProgress) { IDbCommand cmd = GetDbCommand(); cmd.CommandText = $@"INSERT INTO {TABLE_NAME} ( {WORD}, {TIMES_HIT}, {TIMES_ATTEMPTED}, {USER_ID}, {CATEGORY_ID} ) VALUES ( '{wordProgress.word}', {wordProgress.timesHit}, {wordProgress.timesAttempted}, {wordProgress.userId}, {wordProgress.categoryId} );"; cmd.ExecuteNonQuery(); }
public void SetWordProgress(WordProgressModel wordProgress) { word = wordProgress; wordText.SetText(wordProgress.word); AssignStarsBasedOnHits(); }