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