Exemplo n.º 1
0
 private void xoa()
 {
     if (tb_ma.Text != "")
     {
         using (SqlConnection connection = new SqlConnection(Dataconection.conection))
         {
             connection.Open();
             SqlCommand command = new SqlCommand("select*from dbo.ThiSinh where SBD=@ma", connection);
             command.Parameters.AddWithValue("@ma", tb_ma.Text);
             SqlDataReader reader = command.ExecuteReader();
             if (reader.Read() == true)
             {
                 Dataconection.sua("dbo.XoaThiSinh '" + tb_ma.Text + "'");
                 MessageBox.Show("Xóa thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 Quanlithisinhdnagki f = new Quanlithisinhdnagki();
                 this.Visible = false;
                 f.ShowDialog();
             }
             else
             {
                 MessageBox.Show("Mã không tồn tại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             connection.Close();
         }
     }
     else
     {
         MessageBox.Show("vui lòng nhập thông tin!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 2
0
        private void bt_thoat_Click(object sender, EventArgs e)
        {
            Quanlithisinhdnagki f = new Quanlithisinhdnagki();

            this.Visible = false;
            f.ShowDialog();
        }
Exemplo n.º 3
0
        private void danhSáchThíSinhĐăngKíToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Quanlithisinhdnagki f = new Quanlithisinhdnagki();

            this.Visible = false;
            f.ShowDialog();
        }