public void otherOptions()
 {
     Classes.Words WordOperation = new Classes.Words();
     string[]      optionsWord   = new string[2];
     if (options != 0)
     {
         optionsWord = WordOperation.getWord(1, 1);
         aOptionsButton.ButtonText = optionsWord[0];
     }
     if (options != 1)
     {
         optionsWord = WordOperation.getWord(1, 1);
         bOptionsButton.ButtonText = optionsWord[0];
     }
     if (options != 2)
     {
         optionsWord = WordOperation.getWord(1, 1);
         cOptionsButton.ButtonText = optionsWord[0];
     }
     if (options != 3)
     {
         optionsWord = WordOperation.getWord(1, 1);
         dOptionsButton.ButtonText = optionsWord[0];
     }
 }
 void getWords()
 {
     string[] words = new string[2];
     words = appWords.getWord(1, 1);
     trWords.Add(words[0]);
     enWords.Add(words[1]);
 }
Exemple #3
0
        public List <string>[] QuizWords(int userID)
        {
            Words wrds = new Words();

            List <string>[] myWords    = new List <string> [4];
            List <string>   wordsID    = new List <string>();
            List <string>   wordsLevel = new List <string>();
            List <string>   wordsTR    = new List <string>();
            List <string>   wordsEN    = new List <string>();

            try
            {
                userWordConnect();
                MySqlCommand    listUserWordsCommand = new MySqlCommand("Select * from words_" + userID + " ORDER BY first_date ASC", userWordConnection);
                MySqlDataReader reader = listUserWordsCommand.ExecuteReader();
                while (reader.Read())
                {
                    int getLevelDay = levelDay(reader.GetInt32("level"));
                    if ((reader.GetDateTime("first_date") <= DateTime.Now) && reader.GetInt32("level") < 6)
                    {
                        TimeSpan extraction    = reader.GetDateTime("first_date") - DateTime.Now;
                        string   extractionDay = extraction.Duration().Days.ToString();
                        int      convertDay    = ((-1) * Convert.ToInt32(extractionDay)) + getLevelDay;
                        if (convertDay <= 0)
                        {
                            wordsID.Add(reader.GetString("word_id"));
                            wordsLevel.Add(reader.GetString("level"));
                            string[] getWord = wrds.getWord(0, reader.GetInt32("word_id"));
                            wordsTR.Add(getWord[0]);
                            wordsEN.Add(getWord[1]);
                        }
                    }
                }
                userWordConnect();

                myWords[0] = wordsID;
                myWords[1] = wordsLevel;
                myWords[2] = wordsTR;
                myWords[3] = wordsEN;
            }
            catch (Exception e)
            {
                MessageBox.Show("İşlem sırasında bir hata meydana geldi." + e);
                userWordConnect();
            }

            return(myWords);
        }