コード例 #1
0
 /// <summary>
 /// 删除视频
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void DToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show($"是否删除编号{transmissionvideo.Id}的视频,删除视频前请确认解帧图片一并删除?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
     {
         return;
     }
     if (!VideoData.DeleteVideo(transmissionvideo.Id))
     {
         MessageBox.Show("删除失败");
         Program.log.Error($"删除{transmissionvideo.Id}失败", new Exception($"{transmissionvideo.Id}"));
     }
     videoplays.Remove(transmissionvideo);
     bindingSource1.DataSource = videoplays;
     transmissionvideo         = (VideoPlay)gridView1.GetRow(gridView1.FocusedRowHandle);
     gridView1.ExpandAllGroups();
     unfold = true;
     gridView1.RefreshData();
     OnSave();
     //Program.log.Error($"删除{transmissionvideo.Id}", new Exception($"{url}"));
 }
コード例 #2
0
        private void DeleteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ReturnRepetition re = (ReturnRepetition)gridView1.GetRow(gridView1.FocusedRowHandle);

            if (MessageBox.Show($"是否删除编号{re.ID}的视频?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
            {
                return;
            }
            if (!VideoData.DeleteVideo(re.ID))
            {
                MessageBox.Show("删除失败");
                Program.log.Error($"删除{re.ID}失败", new Exception($"{re.ID}"));
                return;
            }
            if (!VideoData.DeleteRepetitionVideo(re.ID))
            {
                MessageBox.Show("删除失败");
                Program.log.Error($"删除{re.ID}失败", new Exception($"{re.ID}"));
                return;
            }
            MessageBox.Show("删除成功");
        }