private void ModifyVideo() { if (lbxVideo.SelectedItems == null || lbxVideo.SelectedItems.Count < 1) { MessageBox.Show("수정할 비디오를 먼저 선택해 주십시오.", "비디오정보 수정안내"); lbxVideo.Focus(); return; } int idx = lbxVideo.SelectedItems[0].Index; VRSVideoForm dlg = new VRSVideoForm(); dlg.Text = "비디오정보 수정"; dlg.m_Video = lbxVideo.Items[idx].Tag as Video; if (dlg.ShowDialog() == DialogResult.OK) { int id = Convert.ToInt32(lbxVideo.Items[idx].Name); VRSDataSet.tblVideoRow row = vrsDataSet.tblVideo.FindById(id); SetVideoData(dlg.m_Video, ref row); if (row.RowState == DataRowState.Modified) { //데이터소스에 반영 this.Validate(); this.tblVideoTableAdt.Update(row); SetVideoListView(); } } }
private void CreateVideo() { VRSVideoForm dlg = new VRSVideoForm(); dlg.Text = "비디오정보 등록"; if (dlg.ShowDialog() == DialogResult.OK) { VRSDataSet.tblVideoRow row = vrsDataSet.tblVideo.NewtblVideoRow(); SetVideoData(dlg.m_Video, ref row); vrsDataSet.tblVideo.Rows.Add(row); //데이터소스에 반영 this.Validate(); this.tblVideoTableAdt.Update(row); SetVideoListView(); } }