示例#1
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("删除成功");
        }