private void btnUpdate_Click(object sender, EventArgs e) { if (MessageBox.Show("Bạn có chắc muốn sửa?", "Confirm", MessageBoxButtons.OKCancel) == DialogResult.OK) { try { string rowVersion = dgvPhong.Rows[RowEnter].Cells[4].Value.ToString(); int maPhong = int.Parse(dgvPhong.Rows[RowEnter].Cells[0].Value.ToString()); int soHang; int soCot; soHang = int.Parse(txtSoHang.Text); soCot = int.Parse(txtSoCot.Text); string tenPhong = txtTenPhong.Text; if (pcBLL.UpdatePhong(maPhong, soHang, soCot, tenPhong, rowVersion)) { MessageBox.Show("Update thành công!"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } QuanLyPhong_Load(sender, e); } }