private void dgvPhieuMuon_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { try { if (checkOverTime == false) { resetleftform(); } idPhieuMuon = int.Parse(dgvPhieuMuon.Rows[e.RowIndex].Cells[3].Value.ToString()); dtNgayMuon.Text = dgvPhieuMuon.Rows[e.RowIndex].Cells[5].Value.ToString(); dtHanTra.Text = dgvPhieuMuon.Rows[e.RowIndex].Cells[1].Value.ToString(); dtNgayTra.Text = dgvPhieuMuon.Rows[e.RowIndex].Cells[6].Value.ToString(); if (dgvPhieuMuon.Rows[e.RowIndex].Cells[8].Value.ToString().Equals("True")) { cbTinhTrang.Text = "Đã trả"; } else { cbTinhTrang.Text = "Chưa trả"; } cbDocGia.SelectedValue = dgvPhieuMuon.Rows[e.RowIndex].Cells[2].Value; cbThuThu.SelectedValue = dgvPhieuMuon.Rows[e.RowIndex].Cells[4].Value; btnSuaPhieuMuon.Enabled = true; btnLuuPhieuMuon.Enabled = true; btnHuyPhieuMuon.Enabled = true; btnXoaPhieuMuon.Enabled = true; dgvChiTietMuon.DataSource = client.listAllRentDetail(idPhieuMuon); txtMaPhieu.Text = idPhieuMuon.ToString(); btnThemChiTietMuon.Enabled = true; resetrightform(); sumBook = client.countQuantityBookBorrowed(idPhieuMuon); } catch (Exception) { MessageBox.Show("Click chuột sai vị trí", "Lỗi", MessageBoxButtons.OK); } }