Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            DbHandler dbh = new DbHandler();

            dbh.update("delete from Food where id =" + ((KeyValuePair <int, string>)comboBox4.SelectedItem).Key);
            dbh.addItemsToComboBox(comboBox4, 0, 2, "Food", -1);
            dbh.showHideLabel(label6);
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            DbHandler dbh   = new DbHandler();
            string    query = "update PartsOfFood set nname = '" + comboBox3.Text + "', price = '" + textBox4.Text + "', energyOnGram = '" + textBox3.Text + "', measurementUnitsId = '" + ((KeyValuePair <int, string>)comboBox1.SelectedItem).Key + "', howPrepareId = '" + ((KeyValuePair <int, string>)comboBox2.SelectedItem).Key + "' where id=" + pofId;

            dbh.update(query);
            dbh.showHideLabel(label6);
        }