public static ShortSeekiosDTO SeekiosToShortSeekiosDTO(seekios source) { if (source == null) { return(null); } return(new ShortSeekiosDTO() { Idseekios = source.idseekios, SeekiosName = source.seekiosName, SeekiosPicture = source.seekiosPicture == null ? "" : Convert.ToBase64String(source.seekiosPicture), User_iduser = source.user_iduser, }); }
public static DBSeekios SeekiosToDBSeekios(seekios source1, seekiosAndSeekiosProduction source2) { if (source1 == null) { return(null); } if (source2 == null) { return(null); } return(new DBSeekios() { UIdSeekios = source2.uidSeekios, Imei = source2.imei, LastUpdateConfirmed = source2.lastUpdateConfirmed == 1, VersionEmbedded_idversionEmbedded = source2.versionEmbedded_idversionEmbedded, DateFirstRegistration = source2.dateFirstRegistration, FreeCredit = source2.freeCredit, Idseekios = source1.idseekios, SeekiosName = source1.seekiosName, SeekiosPicture = source1.seekiosPicture == null ? string.Empty : Convert.ToBase64String(source1.seekiosPicture), SeekiosDateCreation = source1.seekios_dateCretaion, BatteryLife = source1.batteryLife ?? 0, SignalQuality = source1.signalQuality ?? 0, DateLastCommunication = source1.dateLastCommunication, LastKnownLocation_longitude = source1.lastKnownLocation_longitude, LastKnownLocation_latitude = source1.lastKnownLocation_latitude, LastKnownLocation_altitude = source1.lastKnownLocation_altitude ?? 0.0, LastKnownLocation_accuracy = source1.lastKnownLocation_accuracy ?? 0.0, LastKnownLocation_dateLocationCreation = source1.lastKnownLocation_dateLocationCreation, LastKnowLocation_idlocationDefinition = source1.lastKnowLocation_idlocationDefinition, User_iduser = source1.user_iduser, HasGetLastInstruction = source1.hasGetLastInstruction == 1, IsAlertLowBattery = source1.isAlertLowBattery == 1, IsInPowerSaving = source1.isInPowerSaving == 1, PowerSaving_hourStart = source1.powerSaving_hourStart, PowerSaving_hourEnd = source1.powerSaving_hourEnd, AlertSOS_idalert = source1.alertSOS_idalert, IsRefreshingBattery = source1.isRefreshingBattery == 1, DateLastOnDemandRequest = source1.dateLastOnDemandRequest, IsLastSOSRead = source1.isLastSOSRead == 1, DateLastSOSSent = source1.dateLastSOSSent, SendNotificationOnNewTrackingLocation = source1.sendNotificationOnNewTrackingLocation == 1, SendNotificationOnNewOutOfZoneLocation = source1.sendNotificationOnNewOutOfZoneLocation == 1, SendNotificationOnNewDontMoveLocation = source1.sendNotificationOnNewDontMoveLocation == 1 }); }