예제 #1
0
 /// <summary>
 /// ����豸
 /// </summary>
 /// <param name="dvr">�豸</param>
 public void Add(IVOD dvr)
 {
     Num = List.Add(dvr);
 }
예제 #2
0
        ///// <summary>
        ///// �޸�
        ///// </summary>
        ///// <param name="deviceID">�豸ID</param>
        ///// <param name="device">�豸</param>
        ///// <returns></returns>
        //public bool UpdateByID(int deviceID, IDVR device)
        //{
        //    if (device == null) throw new ArgumentNullException("device" + "�豸�б��޸�ʱ�豸Ϊ��");
        //    IDVR _device = FindByID(deviceID);
        //    if (_device != null)
        //    {
        //        // ReSharper disable RedundantAssignment
        //        device = _device;
        //        // ReSharper restore RedundantAssignment
        //        return true;
        //    }
        //    // ReSharper disable RedundantIfElseBlock
        //    else
        //    // ReSharper restore RedundantIfElseBlock
        //    {
        //        return false;
        //    }
        //}
        /// <summary>
        /// �޸�
        /// </summary>
        /// <param name="dvrIP">�豸IP</param>
        /// <param name="dvr">�豸</param>
        /// <returns></returns>
        public bool UpdateByIP(string dvrIP, IVOD dvr)
        {
            if (dvr == null) throw new ArgumentNullException("device" + "�豸�б��޸�ʱ�豸Ϊ��");
            IVOD _dvr = FindByIP(dvrIP);
            if (_dvr != null)
            {
                // ReSharper disable RedundantAssignment
                dvr = _dvr;
                // ReSharper restore RedundantAssignment
                return true;
            }
            // ReSharper disable RedundantIfElseBlock
            else
            // ReSharper restore RedundantIfElseBlock
            {
                return false;

            }
        }