예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            DBManager db = new DBManager();

            db.InsertCategory(textCategory.Text);
            frmCateg.SetGridDatasourse(db.SelectCategories());
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string words = "";
            string idCtg = frmCategor.GetIdCat();

            for (int i = 0; i < gridWords.RowCount; i++)
            {
                if (gridWords[0, i].Selected)
                {
                    words = words + gridWords[0, i].Value.ToString() + ", ";
                }
            }

            char[] charsToTrim = { ',', ' ' };
            words = words.TrimEnd(charsToTrim);

            DBManager db = new DBManager();

            db.UpdateWordCategory(idCtg, words);
            frmCategor.SetGridDatasourse(db.SelectCategories());
            Close();
        }