Пример #1
0
        /// <summary>
        /// 是否存在设备已被同类型交管
        /// </summary>
        /// <param name="tct"></param>
        /// <param name="devid"></param>
        /// <returns></returns>
        public bool ExistsTrafficControl(TrafficControlTypeE tct, uint devid, out uint otherDevid)
        {
            otherDevid = TrafficCtlList.Find(c => c.TrafficControlStatus != TrafficControlStatusE.已完成 && c.TrafficControlType == tct && c.restricted_id == devid)?.control_id ?? 0;

            if (otherDevid == 0)
            {
                otherDevid = TrafficCtlList.Find(c => c.TrafficControlStatus != TrafficControlStatusE.已完成 && c.TrafficControlType == tct && c.control_id == devid)?.restricted_id ?? 0;
            }

            return(otherDevid > 0);
        }
Пример #2
0
 public List <TrafficControl> GetTrafficCtlList(TrafficControlTypeE type)
 {
     return(TrafficCtlList.FindAll(c => c.TrafficControlType == type));
 }