private void gvCongN1_CellClick(object sender, DataGridViewCellEventArgs e) { // Sửa if (e.ColumnIndex == 0) { string _id_rowindex = gvCongN1.Rows[e.RowIndex].Cells[2].Value.ToString(); _id_rowindex += "_" + e.RowIndex; var thongtin = new ttCongMay(_id_rowindex, this); thongtin.ShowDialog(); } // Xóa if (e.ColumnIndex == 1) { string _id = gvCongN1.Rows[e.RowIndex].Cells[2].Value.ToString(); DialogResult dr = MessageBox.Show("Bạn có muốn xóa Công này không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dr == DialogResult.Yes) { DA.Del_CongMay(new string[] { _id }); LoadGrid(); } } }
private void btThem_Click(object sender, EventArgs e) { var thongtin = new ttCongMay("", this); thongtin.ShowDialog(); }