예제 #1
0
        private void DelEqiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            List <TreeListNode> nodes = GetEquipmentCheckNode();

            if (nodes.Count == 0)
            {
                return;
            }
            if (MessageBox.Show(
                    $"删除通道将清除通道所属视频,是否删除\r\n{string.Join(",\r\n", nodes.Select(t => t.GetValue(0).ToString()).ToList())}\r\n共{nodes.Count()}个通道",
                    "删除提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
            {
                return;
            }
            if (!EquipmentData.DeleteEquipmengt(nodes.Select(t => int.Parse(t.Tag.ToString())).ToList()))
            {
                MessageBox.Show($"删除失败");
            }

            RefreshAll();
        }
예제 #2
0
 /// <summary>
 /// 删除通道
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void DeleteGroupToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (transmissionvideo?.Rquipment == null)
     {
         return;
     }
     if (MessageBox.Show($"是否删除{transmissionvideo.EquipmentName}通道?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
     {
         return;
     }
     if (EquipmentData.DeleteEquipmengt(transmissionvideo.EquipmentID))
     {
         MessageBox.Show("删除成功");
         Program.log.Info($"通道:{transmissionvideo.EquipmentID + transmissionvideo.EquipmentName}删除--成功");
         GridViewClear();
         PostVideos();
         RefEquipment();
         return;
     }
     MessageBox.Show("删除失败");
     Program.log.Error($"通道:{transmissionvideo.EquipmentID + transmissionvideo.EquipmentName}删除--失败");
 }