Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(dataGridView1.CurrentRow.Cells["StudentId"].Value);

            if (comboBox1.Text == "ACTIVE")
            {
                string oss = "Update GroupStudent SET Status = '" + 3 + "' where StudentId = '" + id + "'";
                dbConnection.getInstance().exectuteQuery(oss);
            }
            else if (comboBox1.Text == "INACTIVE")
            {
                string oss = "Update GroupStudent SET Status = '" + 4 + "' where StudentId = '" + id + "'";
                dbConnection.getInstance().exectuteQuery(oss);
            }
            else if (comboBox1.Text == "")
            {
                labelerror.Text    = "Select Status Please";
                labelerror.Visible = true;
            }
            this.Hide();
            EditStatus ed = new EditStatus();

            ed.Show();
        }