private void btn_device_append_Click(object sender, EventArgs e) { Form_DeviceInfo_appendModify form_DeviceInfo_appendModify = new Form_DeviceInfo_appendModify(); form_DeviceInfo_appendModify.isAppend = true; form_DeviceInfo_appendModify.Text = "设备信息添加"; if (form_DeviceInfo_appendModify.ShowDialog() == DialogResult.OK) { dataGridView_device.DataSource = mDBM.Select(deviceViewSQL).Tables[0]; } }
private void dataGridView_device_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { Form_DeviceInfo_appendModify form_DeviceInfo_appendModify = new Form_DeviceInfo_appendModify(); form_DeviceInfo_appendModify.isAppend = false; form_DeviceInfo_appendModify.Text = "设备信息修改"; form_DeviceInfo_appendModify.deviceNo = dataGridView_device.Rows[e.RowIndex].Cells["设备编号"].Value.ToString(); form_DeviceInfo_appendModify.deviceDescription = dataGridView_device.Rows[e.RowIndex].Cells["设备描述"].Value.ToString(); form_DeviceInfo_appendModify.deviceManufacture = dataGridView_device.Rows[e.RowIndex].Cells["制造厂商"].Value.ToString(); form_DeviceInfo_appendModify.deviceSerial = dataGridView_device.Rows[e.RowIndex].Cells["设备型号"].Value.ToString(); form_DeviceInfo_appendModify.examItemName = dataGridView_device.Rows[e.RowIndex].Cells["考试项目名称"].Value.ToString(); form_DeviceInfo_appendModify.placeCode = dataGridView_device.Rows[e.RowIndex].Cells["考场代码"].Value.ToString(); form_DeviceInfo_appendModify.acceptanceDate = dataGridView_device.Rows[e.RowIndex].Cells["验收日期"].Value.ToString(); form_DeviceInfo_appendModify.expireDate = dataGridView_device.Rows[e.RowIndex].Cells["有效截止日期"].Value.ToString(); if (form_DeviceInfo_appendModify.ShowDialog() == DialogResult.OK) { dataGridView_device.DataSource = mDBM.Select(deviceViewSQL).Tables[0]; } } }