コード例 #1
0
 // sua
 private void button2_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Bạn có thực sự muốn sửa thông tin nhà cung cấp này không ?", "Xác nhận", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         dataGridView1.Enabled = false;
         ncc = new BUS_NhaCungCap();
         string codeId = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value.ToString();
         if (ncc.SuaNcc(them(), codeId))
         {
             MessageBox.Show("Đã sửa nhà cung cấp !", "Thông báo", MessageBoxButtons.OK);
             DataTable tbl = ncc.DSNcc();
             dataGridView1.DataSource = tbl;
             dataGridView1.Enabled    = true;
         }
         else
         {
             MessageBox.Show("Không sửa được nhà cung cấp ! Vui lòng thử lại !", "Lỗi ", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }