private void dgvDanhSach_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (dgvDanhSach.Rows.Count == e.RowIndex + 1 || e.RowIndex == -1) { return; } int id = Convert.ToInt32(dgvDanhSach.Rows[e.RowIndex].Cells["colMa"].Value.ToString()); if (e.ColumnIndex == dgvDanhSach.Columns["colSua"].Index) { frmThemCTPM f = new frmThemCTPM(id); f.ShowDialog(); loadDuLieu(); } else if (e.ColumnIndex == dgvDanhSach.Columns["colXoa"].Index) { int ketQua = PhieuMuonControl.xoaDuLieu(id); if (ketQua <= 0) { MessageBox.Show("Thực hiện thất bại"); } else { loadDuLieu(); } } //else if (e.ColumnIndex == dgvDanhSach.Columns["colChiTiet"].Index) //{ // // //} }
private void btnNhap_Click(object sender, EventArgs e) { frmThemCTPM f = new frmThemCTPM(); f.ShowDialog(); loadDuLieu(); }