public DeviceInfoJSON(DeviceMap map) : this() { ID = map.ID; Name = map.Name; Key = map.DeviceKey; DeviceType = map.DeviceTypeEnum.ToString(); Parent = map.ParentMapID; }
public static DeviceMap Create(string deviceKey, DeviceType type) { var match = ORM.Select <DeviceMap> ("DeviceMap", string.Format("DeviceKey = '{0}' and DeviceType = ", deviceKey, (int)type)).FirstOrDefault(); if (match != null) { return(match); } else { match = new DeviceMap(); match.Created = DateTimeStamp.Now; match.DeviceKey = deviceKey; match.DeviceTypeEnum = type; match.Name = deviceKey; ORM.Update <DeviceMap> ("DeviceMap", match); match = ORM.Select <DeviceMap> ("DeviceMap", string.Format("DeviceKey = '{0}' and DeviceType = ", deviceKey, (int)type)).FirstOrDefault(); return(match); } }
public DeviceResult(DeviceMap map, IEnumerable <DeviceLog> logs) { Map = map; LogEntries = new List <DeviceLog>(logs); }
public EditMapJSONResponse(DeviceMap map, bool success) : this() { Value = map; SuccessfullyUpdated = success; }