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