public static DeviceCheckpoint[] BuildDeviceCheckpoints(DeviceCheckpointSource[] deviceCheckpointSources) { if (deviceCheckpointSources == null) { return(null); } var deviceCheckpoints = new DeviceCheckpoint[0]; foreach (var deviceCheckpointSource in deviceCheckpointSources) { deviceCheckpoints = deviceCheckpoints.Append(BuildDeviceCheckpoint(deviceCheckpointSource)); } return(deviceCheckpoints); }
public static DeviceCheckpointSource BuildDeviceCheckpointSource(DeviceCheckpoint deviceCheckpoint) { if (deviceCheckpoint == null) { return(null); } var deviceCheckpointSource = new DeviceCheckpointSource(); deviceCheckpointSource.Description = deviceCheckpoint.Description; deviceCheckpointSource.DeviceInfo = DeviceInfoTransfer.BuildDeviceInfoSource(deviceCheckpoint.DeviceInfo); deviceCheckpointSource.Flag = typeof(DeviceCheckpointFlag).GetValueByEnum(deviceCheckpoint.Flag); deviceCheckpointSource.Id = deviceCheckpoint.Id; deviceCheckpointSource.LowerLimit = deviceCheckpoint.LowerLimit; deviceCheckpointSource.Remark = deviceCheckpoint.Remark; deviceCheckpointSource.UpperLimit = deviceCheckpoint.UpperLimit; return(deviceCheckpointSource); }
public static DeviceCheckpoint BuildDeviceCheckpoint(DeviceCheckpointSource deviceCheckpointSource) { if (deviceCheckpointSource == null) { return(null); } var deviceCheckpoint = new DeviceCheckpoint(); deviceCheckpoint.CreationDate = Utility.ConvertDateTime(deviceCheckpointSource.CreationDate); deviceCheckpoint.Description = deviceCheckpointSource.Description; deviceCheckpoint.DeviceInfo = DeviceInfoTransfer.BuildDeviceInfo(deviceCheckpointSource.DeviceInfo); deviceCheckpoint.Flag = (DeviceCheckpointFlag)typeof(DeviceCheckpointFlag).GetEnumByValue(deviceCheckpointSource.Flag); deviceCheckpoint.Id = deviceCheckpointSource.Id; deviceCheckpoint.LowerLimit = deviceCheckpointSource.LowerLimit; deviceCheckpoint.Remark = deviceCheckpointSource.Remark; deviceCheckpoint.UpperLimit = deviceCheckpointSource.UpperLimit; deviceCheckpoint.ModifiedDate = Utility.ConvertDateTime(deviceCheckpointSource.ModifiedDate); return(deviceCheckpoint); }