示例#1
0
        private void GetWordsFromDb(List <string> lstSelectedLetters, List <DiffLevel> lstSelectedDiffs)
        {
            lstWords.Clear();
            DAWords dawords = new DAWords();

            foreach (DiffLevel diffLvl in lstSelectedDiffs)
            {
                foreach (string lettedr in lstSelectedLetters)
                {
                    DataTable dtWords = dawords.GetWordsByDiffAndLetter(lettedr, diffLvl.ID);
                    foreach (DataRow dr in dtWords.Rows)
                    {
                        int temp;
                        int.TryParse(dr["id"].ToString(), out temp);
                        Word w = new Word(temp, dr["word"].ToString(), DiffLevel.GetDifflvlByID(dr["diffID"].ToString()), dr["meaning"].ToString());
                        lstWords.Add(w);
                    }
                }
            }
            // lstWords = SuffleList(lstWords);

            if (lstWords.Count > 0)
            {
                frmQuiz quiz = new frmQuiz(lstWords, this);
                Hide();
                quiz.Show();
            }
            else
            {
                MessageBox.Show("אין מילים תחת הנתונים המבוקשים");
            }
        }
示例#2
0
        public void CmbFill()
        {
            try
            {
                List <string> lstStr  = new List <string>();
                DAWords       daWords = new DAWords();

                DataTable dt = daWords.GetAllLettersLst();
                lstStr.Add("בחר אותיות לבחינה");

                foreach (DataRow dr in dt.Rows)
                {
                    lstStr.Add(dr["startingLet"].ToString());
                }

                cmbLetters.ItemsSource = lstStr;
                // cmbLetters.SelectedIndex = 0;
                //*****************Difflvl**************************

                List <string> lstDif = new List <string>();
                DADiffLevel   daDiff = new DADiffLevel();

                DataTable dtdiff = daDiff.GetDiffLevelData();


                cmbDiffLvl.ItemsSource = DiffLevel.GetLstFromDb();
            }
            catch (Exception ex)
            {
                Globals.GetExData("CmbFill", "Frmmain", ex);
            }
        }
示例#3
0
        public static List <Word> GetLstFromDb()
        {
            try
            {
                List <Word> Reslst = new List <Word>();

                DAWords daWords = new DAWords();

                DataTable dt;
                dt = daWords.GetWordsData();
                foreach (DataRow dr in dt.Rows)
                {
                    int tempid = 0;
                    int.TryParse(dr["id"].ToString(), out tempid);
                    DiffLevel df = DiffLevel.GetDifflvlByID(dr["diffID"].ToString());
                    Reslst.Add(new Word(tempid, dr["word"].ToString(), df, dr["meaning"].ToString()));
                }
                return(Reslst);
            }
            catch (Exception ex)
            {
                Globals.GetExData("GetLstFromDb", "word", ex);
                return(null);
            }
        }
示例#4
0
 public Word(int id, string TheWord, DiffLevel diff, string meaning)
 {
     ID             = id;
     theWord        = TheWord;
     Difflvl        = diff;
     Meaning        = meaning;
     StartingLetter = TheWord[0];
 }
示例#5
0
        public static DiffLevel GetDifflvlByID(string id)
        {
            DADiffLevel dadiflvl = new DADiffLevel();
            int         temp;

            int.TryParse(id, out temp);
            DataTable dt  = dadiflvl.GetDiffByID(temp);
            DiffLevel dfl = new DiffLevel(temp, dt.Rows[0]["diff"].ToString());

            return(dfl);
        }
示例#6
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                FillCmbData();
                cmbDiff.ItemsSource   = DiffLevel.GetLstFromDb();
                cmbDiff.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                MessageBox.Show("תקראי למושיקו ותגידי לו שיש בעיה תצלמי לו את הטקסט הבא הוא יביו כי הוא גאון: תעשי אוקי ואז זה יופיע");

                Globals.GetExData("Window_Loaded", "frmaddwords", ex);
            }
        }
示例#7
0
 private void cmbDiff_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     diffGlob = (DiffLevel)cmbDiff.SelectedItem;
 }