Exemplo n.º 1
0
        public List <DevInfo> GetListWithDetail(List <Archor> archors, List <Dev_CameraInfo> cameras)
        {
            var list = this.ToList();

            foreach (var dev in list)
            {
                var type = TypeCodeHelper.GetTypeName(dev.Local_TypeCode + "");
                if (type == "基站")
                {
                    dev.DevDetail = archors.FirstOrDefault(i => i.DevInfoId == dev.Id);
                }
                else if (type == "摄像头")
                {
                    dev.DevDetail = cameras.FirstOrDefault(i => i.DevInfoId == dev.Id);
                }
                else if (type == "生产设备")
                {
                    //return (int)Abutment_DevTypes.生产设备;
                }
                else if (type == "门禁")
                {
                    //return (int)Abutment_DevTypes.门禁;
                }
                else if (type == "警报设备")
                {
                    //return (int)Abutment_DevTypes.消防设备;
                }
                else if (type == "其他设备")
                {
                    //return (int)Abutment_DevTypes.无;
                }
            }
            return(list);
        }
Exemplo n.º 2
0
        private static int GetDeviceType(DevInfo devinfo)
        {
            var type = TypeCodeHelper.GetTypeName(devinfo.Local_TypeCode + "");

            if (type == "基站")
            {
                return((int)Abutment_DevTypes.定位基站);
            }
            else if (type == "摄像头")
            {
                return((int)Abutment_DevTypes.摄像头);
            }
            else if (type == "生产设备")
            {
                return((int)Abutment_DevTypes.生产设备);
            }
            else if (type == "门禁")
            {
                return((int)Abutment_DevTypes.门禁);
            }
            else if (type == "警报设备")
            {
                return((int)Abutment_DevTypes.消防设备);
            }
            else if (type == "其他设备")
            {
                return((int)Abutment_DevTypes.无);
            }
            return(0);
        }
Exemplo n.º 3
0
 private void BindingDev(List <TEntity> devInfoList)
 {
     BindingDevParent(devInfoList, db.Areas.ToList().ToTModel());
     foreach (var item in devInfoList)
     {
         item.TypeName = TypeCodeHelper.GetTypeName(item.TypeCode + "");
     }
 }
Exemplo n.º 4
0
 public static string GetTypeName(int code)
 {
     return(TypeCodeHelper.GetTypeName(code.ToString()));
     //if (code == TypeCodes.Archor)
     //{
     //    return "基站";
     //}
     //else if (code == 20180825)
     //{
     //    return "摄像头";
     //}
     //else if (code == TypeCodes.Door)
     //{
     //    return "门禁";
     //}
     //else
     //{
     //    return "其他设备";
     //}
     //todo:这里改成设备类型表中获取的设备类型信息
 }