コード例 #1
0
        public static DataTable GetDevByClass(int Classid)
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("txt");
            dt.Columns.Add("val");
            try
            {
                DeviceDefineGetByDevClassIDRequest DeviceDefineRequest = new DeviceDefineGetByDevClassIDRequest();
                DeviceDefineRequest.DevClassID = Classid;
                var result = deviceDefineService.GetDeviceDefineCacheByDevClassID(DeviceDefineRequest).Data;
                if (result.Count > 0)
                {
                    foreach (Jc_DevInfo tempdev in result)
                    {
                        object[] obj = new object[dt.Columns.Count];
                        obj[0] = tempdev.Name;
                        obj[1] = tempdev.Devid;
                        dt.Rows.Add(obj);
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error("ClientAlarmServer-GetClassByProperty-发生异常 " + ex.Message);
            }
            return(dt);
        }
コード例 #2
0
 public BasicResponse <List <Jc_DevInfo> > GetDeviceDefineCacheByDevClassID(Sys.Safety.Request.DeviceDefine.DeviceDefineGetByDevClassIDRequest DeviceDefineRequest)
 {
     return(_DeviceDefineService.GetDeviceDefineCacheByDevClassID(DeviceDefineRequest));
 }