Esempio n. 1
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int id = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells["Id"].Value);

            if (dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString().ToLower() == "delete")
            {
                if (MessageBox.Show("Are you", "Delete", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    string   q  = "delete from student where id=" + id;
                    Database db = new Database(q);
                    db.ExecuteNonQuery();
                }
            }
            else
            {
                RegisterStudent rs = new RegisterStudent(id);
                rs.Show();
            }
        }
Esempio n. 2
0
        private void newStudentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            RegisterStudent rs = new RegisterStudent(0);

            rs.Show();
        }