Exemple #1
0
        private void dataGridView1_CellContentClick_1(object sender, DataGridViewCellEventArgs e)
        {
            SqlConnection con = new SqlConnection(ConnectionString);

            con.Open();

            if (e.ColumnIndex == dbGrid1.Columns["del"].Index)
            {
                int        row = e.RowIndex;
                int        sel = Convert.ToInt32(dbGrid1.Rows[row].Cells["Id"].Value);
                SqlCommand exe = new SqlCommand("DELETE FROM Assessment WHERE Id = '" + sel + "'", con);
                exe.ExecuteNonQuery();
                MessageBox.Show("Deleted!");
                this.Hide();
                Form18 form = new Form18();
                form.Show();
            }
            if (e.ColumnIndex == dbGrid1.Columns["edit"].Index)
            {
                int row = e.RowIndex;
                int sel = Convert.ToInt32(dbGrid1.Rows[row].Cells["Id"].Value);

                this.Hide();
                Form22 form = new Form22(sel);
                form.Show();
            }
        }
Exemple #2
0
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Form18 form4 = new Form18();

            this.Hide();


            form4.Show();
        }