コード例 #1
0
 public int Delete(ArmAndDisarmList entityToInsert)
 {
     using (Conn)
     {
         return(Conn.Delete(entityToInsert));
     }
 }
コード例 #2
0
 public Guid Insert(ArmAndDisarmList entityToInsert)
 {
     using (Conn)
     {
         return(Conn.Insert <Guid>(entityToInsert));
     }
 }
コード例 #3
0
ファイル: PresetForm.cs プロジェクト: liuslayer/RCCP
        private void button2_Click(object sender, EventArgs e)
        {
            if (dataGridView1.CurrentCell == null)
            {
                MessageBox.Show("请选择需要修改的报警预案");
                return;
            }
            int index = dataGridView1.CurrentCell.RowIndex;

            if (listBox1.SelectedItem != null)
            {
                string             temp_AlarmName        = listBox1.SelectedItem.ToString();
                ArmAndDisarmList[] L_ArmAndDisarmList    = ClassPlan.armAndDisarmList.ToArray();
                ArmAndDisarmList   temp_ArmAndDisarmList = Array.Find(L_ArmAndDisarmList, _ => _.AlarmName == temp_AlarmName);
                temp_Add_AlarmDeviceID = temp_ArmAndDisarmList.AlarmDeviceID;
                Guid    Add_PlanDeviceID = new Guid(dataGridView1.Rows[index].Cells[9].Value.ToString());
                PlanSet PS = new PlanSet(classplan, temp_Add_AlarmDeviceID, Add_PlanDeviceID, new Guid(temp_ArmAndDisarmList.DeviceID.ToString()), temp_ArmAndDisarmList.AlarmType);
                PS.Show();
            }
            else
            {
                MessageBox.Show("请选择需要设置报警预案的报警器");
                return;
            }
        }
コード例 #4
0
ファイル: PresetForm.cs プロジェクト: liuslayer/RCCP
 private void button1_Click(object sender, EventArgs e)
 {
     //测试数据
     //PlanSet PS = new PlanSet(classplan, new Guid());
     //PS.Show();
     if (listBox1.SelectedItem != null)
     {
         string             temp_AlarmName        = listBox1.SelectedItem.ToString();
         ArmAndDisarmList[] L_ArmAndDisarmList    = ClassPlan.armAndDisarmList.ToArray();
         ArmAndDisarmList   temp_ArmAndDisarmList = Array.Find(L_ArmAndDisarmList, _ => _.AlarmName == temp_AlarmName);
         temp_Add_AlarmDeviceID = temp_ArmAndDisarmList.AlarmDeviceID;
         PlanSet PS = new PlanSet(classplan, temp_Add_AlarmDeviceID, new Guid("00000000-0000-0000-0000-000000000000"), new Guid(temp_ArmAndDisarmList.DeviceID.ToString()), temp_ArmAndDisarmList.AlarmType);
         PS.Show();
     }
     else
     {
         MessageBox.Show("请选择需要设置报警预案的报警器");
         return;
     }
 }
コード例 #5
0
 /// <summary>
 /// 添加ArmAndDisArmList
 /// </summary>
 /// <param name="_armAndDisarmDataList"></param>
 /// <returns></returns>
 static public int[] AddData(List <ArmAndDisarmList> _armAndDisarmDataList)
 {
     int[] i = null;
     if (_armAndDisarmDataList != null && _armAndDisarmDataList.Count > 0)
     {
         i = new int[_armAndDisarmDataList.Count];
         for (int j = 0; j < _armAndDisarmDataList.Count; j++)
         {
             ArmAndDisarmList tmparmAndDisarmDataList = new ArmAndDisarmList();
             tmparmAndDisarmDataList.AlarmDeviceID     = _armAndDisarmDataList[j].AlarmDeviceID;
             tmparmAndDisarmDataList.AlarmLevel        = _armAndDisarmDataList[j].AlarmLevel;
             tmparmAndDisarmDataList.AlarmLine         = _armAndDisarmDataList[j].AlarmLine;
             tmparmAndDisarmDataList.AlarmName         = _armAndDisarmDataList[j].AlarmName;
             tmparmAndDisarmDataList.AlarmRecPictureID = _armAndDisarmDataList[j].AlarmRecPictureID;
             tmparmAndDisarmDataList.AlarmSensitive    = _armAndDisarmDataList[j].AlarmSensitive;
             tmparmAndDisarmDataList.AlarmType         = _armAndDisarmDataList[j].AlarmType;
             tmparmAndDisarmDataList.CurrentArmStatus  = _armAndDisarmDataList[j].CurrentArmStatus;
             tmparmAndDisarmDataList.Description       = _armAndDisarmDataList[j].Description;
             tmparmAndDisarmDataList.DeviceID          = _armAndDisarmDataList[j].DeviceID;
             tmparmAndDisarmDataList.IsAlarmSound      = _armAndDisarmDataList[j].IsAlarmSound;
             tmparmAndDisarmDataList.IsArm             = _armAndDisarmDataList[j].IsArm;
             tmparmAndDisarmDataList.IsVideoFlashing   = _armAndDisarmDataList[j].IsVideoFlashing;
             tmparmAndDisarmDataList.Mark             = _armAndDisarmDataList[j].Mark;
             tmparmAndDisarmDataList.PictureboxSize   = _armAndDisarmDataList[j].PictureboxSize;
             tmparmAndDisarmDataList.ScreenFrame      = _armAndDisarmDataList[j].ScreenFrame;
             tmparmAndDisarmDataList.ScreenResolution = _armAndDisarmDataList[j].ScreenResolution;
             tmparmAndDisarmDataList.TimeType         = _armAndDisarmDataList[j].TimeType;
             try
             {
                 _tmparmAndDisarmDataList.Insert(tmparmAndDisarmDataList);
                 i[j] = 1;
             }
             catch { i[j] = 2; }
         }
     }
     return(i);
 }
コード例 #6
0
        //public static CHCNetSDK.NET_DVR_COMPRESSION_INFO_V30 m_comPressionCFG_INFO = new CHCNetSDK.NET_DVR_COMPRESSION_INFO_V30();
        /// <summary>
        /// 窝阳预置位布撤防接口
        /// </summary>
        /// <param name="DeviceID">摄像机设备ID</param>
        /// <param name="PresetID">预置位名字</param>
        /// <param name="Switch">1-布放;0-撤防</param>
        /// <returns>1-成功;非1-失败</returns>
        public static int AlarmSet_Yang(Guid DeviceID, string PresetName, int Switch)
        {
            int result = -1;

            armAndDisarmList = Alarm_Command.ArmAndDisarmList_QueryData();
            cameraList       = CameraList_Command._QueryData();
            streamMediaList  = StreamMediaList_Command._QueryData();
            string StreamMedia_DeviceID = "";
            string pDVRIP       = "";
            Int32  nChanne      = -1;
            Int32  m_lUserID    = -1;
            Int32  nAlarmType   = -1;
            Int32  nSensitive   = -1;
            string pChannelName = "";
            string PointStr     = "";
            Int32  SizeX        = -1;
            Int32  SizeY        = -1;

            if (cameraList != null)
            {
                DatabaseConfiguration.DeviceEntitiy.CameraList temp_CameraList = cameraList.Find(_ => _.DeviceID == DeviceID);
                if (temp_CameraList != null)
                {
                    StreamMedia_DeviceID = temp_CameraList.StreamMedia_DeviceID.ToString();
                    nChanne = temp_CameraList.VideoChannel;
                }
            }
            if (streamMediaList != null && StreamMedia_DeviceID != "")
            {
                DatabaseConfiguration.DeviceEntitiy.StreamMediaList temp_StreamMediaList = streamMediaList.Find(_ => _.DeviceID.ToString() == StreamMedia_DeviceID);
                if (temp_StreamMediaList != null)
                {
                    pDVRIP = temp_StreamMediaList.VideoIP;
                }
            }
            if (armAndDisarmList != null)
            {
                ArmAndDisarmList temp_ArmAndDisarmList = armAndDisarmList.Find(_ => _.DeviceID == DeviceID && _.PresetName == PresetName);
                if (temp_ArmAndDisarmList != null)
                {
                    nAlarmType   = temp_ArmAndDisarmList.AlarmType;
                    nSensitive   = temp_ArmAndDisarmList.AlarmSensitive;
                    pChannelName = temp_ArmAndDisarmList.AlarmName;
                    PointStr     = temp_ArmAndDisarmList.AlarmLine;
                    string[] pictureBoxSize = new string[2];
                    if (temp_ArmAndDisarmList.PictureboxSize != null)
                    {
                        pictureBoxSize = temp_ArmAndDisarmList.PictureboxSize.Split(',');
                        SizeX          = int.Parse(pictureBoxSize[0]);
                        SizeY          = int.Parse(pictureBoxSize[1]);
                    }
                }
            }
            if (ManualRec.userIDList.ContainsKey(pDVRIP))
            {
                m_lUserID = ManualRec.userIDList[pDVRIP];
            }
            if (pDVRIP != "" && nChanne != -1 && m_lUserID != -1 && nAlarmType != -1 && nSensitive != -1 && pChannelName != "")
            {
                if (Switch == 1)
                {
                    result = AlarmSet(pDVRIP, nChanne, m_lUserID, nAlarmType, nSensitive, pChannelName, PointStr, SizeX, SizeY);
                }
                else if (Switch == 0)
                {
                    result = Alarm_Close(pDVRIP, nChanne, m_lUserID);
                }
                return(result);
            }
            else
            {
                return(result);
            }
        }