示例#1
0
        private void btnAddWord_Click(object sender, EventArgs e)
        {
            DBManager db = new DBManager();

            if (textWord.Text != "" && textTranslate.Text != "")
            {
                db.InsertWordTrans(textWord.Text, textTranslate.Text);
                frmWords.SetGridDatasourse(db.SelectWords());
            }
        }
示例#2
0
        private void btnAddWord_Click(object sender, EventArgs e)
        {
            DBManager db = new DBManager();

            if (textWord.Text != "" && textTranslate.Text != "")
            {
                int id = frmWords.GetIdCategory();

                if (id == -1)
                {
                    db.InsertWordTrans(textWord.Text, textTranslate.Text);
                    frmWords.SetGridDatasourse(db.SelectWords());
                }
                else
                {
                    string idCat = (id + 1).ToString();
                    db.InsertWordTrans(textWord.Text, textTranslate.Text, idCat);
                    frmWords.SetGridDatasourse(db.SelectWordsForCat(idCat, true));
                }
            }
        }