Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            DBManager db = new DBManager();

            db.InsertCategory(textCategory.Text);
            frmCateg.SetGridDatasourse(db.SelectCategories());
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 3
0
        private void FormCategory_Load(object sender, EventArgs e)
        {
            DBManager db = new DBManager();

            gridCategory.DataSource = db.SelectCategories();
        }