private void btnAdd_Click(object sender, EventArgs e) { frmDeviceManagementEdit frmDeviceManagementEdit = new frmDeviceManagementEdit("", "", "", "", ""); if (frmDeviceManagementEdit.ShowDialog() == DialogResult.OK) { frmDeviceManagementEdit.Dispose(); loadData(); } }
private void btnEdit_Click(object sender, EventArgs e) { if (rowindex < 0) { return; } frmDeviceManagementEdit frmDeviceManagementEdit = new frmDeviceManagementEdit(dataGridView.Rows[rowindex].Cells["设备ID"].Value.ToString(), dataGridView.Rows[rowindex].Cells["设备名称"].Value.ToString(), dataGridView.Rows[rowindex].Cells["部门"].Value.ToString(), dataGridView.Rows[rowindex].Cells["IP地址"].Value.ToString(), dataGridView.Rows[rowindex].Cells["备注"].Value.ToString()); if (frmDeviceManagementEdit.ShowDialog() == DialogResult.OK) { frmDeviceManagementEdit.Dispose(); loadData(); } }