private void buttonX_Add_Click(object sender, EventArgs e) { VideoRecAddAndEditForm videoForm = new VideoRecAddAndEditForm("Add", null); if (videoForm.ShowDialog() == DialogResult.OK) { RefreshVideo(); } }
private void buttonX_Edit_Click(object sender, EventArgs e) { if (dataGridView_CameraInfo.SelectedRows.Count <= 0) { MessageBox.Show("请先选中一行数据"); return; } var row = dataGridView_CameraInfo.SelectedRows[0]; long ID = (long)(row.Cells[0].Value); var videoRec = videoRecList.Find(_ => _.ID == ID); if (videoRec == null) { MessageBox.Show("数据错误"); return; } VideoRecAddAndEditForm videoForm = new VideoRecAddAndEditForm("Edit", videoRec); if (videoForm.ShowDialog() == DialogResult.OK) { RefreshVideo(); } }