public static APIDeviceIO FromDeviceIO(DeviceIO sourceDeviceIO) { APIDeviceIO result = new APIDeviceIO(); result.ID = sourceDeviceIO.ID; result.DeviceID = long.Parse(sourceDeviceIO.DeviceID.ToString()); result.IOTypeID = long.Parse(sourceDeviceIO.IOTypeID.ToString()); result.Valu = sourceDeviceIO.Valu; result.TimeStamp = DateTime.Parse( sourceDeviceIO.TimeStamp.ToString()); result.ExecTimeStamp = sourceDeviceIO.ExecTimeStamp; result.ScheduleTimeStamp = sourceDeviceIO.ScheduleTimeStamp; return result; }
public List <APIDeviceIO> GetDevicePendingCommands(Guid deviceKeyPass) { List <APIDeviceIO> apiCmds = new List <APIDeviceIO>(); List <DeviceIO> cmds = UnitOfWork_Repositories.repoDeviceIOs.GetPendingCommandsList(deviceKeyPass); foreach (DeviceIO cmd in cmds) { APIDeviceIO apiCmd = new APIDeviceIO(); apiCmd = APIDeviceIOAdapter.FromDeviceIO(cmd); apiCmds.Add(apiCmd); } return(apiCmds); }
public static APIDeviceIO FromDeviceIO(DeviceIO sourceDeviceIO) { APIDeviceIO result = new APIDeviceIO(); result.ID = sourceDeviceIO.ID; result.DeviceID = long.Parse(sourceDeviceIO.DeviceID.ToString()); result.IOTypeID = long.Parse(sourceDeviceIO.IOTypeID.ToString()); result.Valu = sourceDeviceIO.Valu; result.TimeStamp = DateTime.Parse(sourceDeviceIO.TimeStamp.ToString()); result.ExecTimeStamp = sourceDeviceIO.ExecTimeStamp; result.ScheduleTimeStamp = sourceDeviceIO.ScheduleTimeStamp; return(result); }