private void selectWors(bool isFilter) { if (isFilter) { string strKey = (cmbCategories.SelectedIndex + 1).ToString(); gridWords.DataSource = db.SelectWordsForCat(strKey, true); } else { gridWords.DataSource = db.SelectWords(); } }
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)); } } }
private void FormWordsToCat_Load(object sender, EventArgs e) { DBManager db = new DBManager(); gridWords.DataSource = db.SelectWordsForCat(); }