private void updateEntityWithDeeplinks(EntitySIMBase entityRow, JobTimeRange jobTimeRange) { // Decide what kind of timerange string DEEPLINK_THIS_TIMERANGE = DEEPLINK_TIMERANGE_LAST_15_MINUTES; if (jobTimeRange != null) { long fromTimeUnix = UnixTimeHelper.ConvertToUnixTimestamp(jobTimeRange.From); long toTimeUnix = UnixTimeHelper.ConvertToUnixTimestamp(jobTimeRange.To); long differenceInMinutes = (toTimeUnix - fromTimeUnix) / (60000); DEEPLINK_THIS_TIMERANGE = String.Format(DEEPLINK_TIMERANGE_BETWEEN_TIMES, toTimeUnix, fromTimeUnix, differenceInMinutes); } // Determine what kind of entity we are dealing with and adjust accordingly if (entityRow is EntitySIMApplication) { entityRow.ControllerLink = String.Format(DEEPLINK_CONTROLLER, entityRow.Controller, DEEPLINK_THIS_TIMERANGE); entityRow.ApplicationLink = String.Format(DEEPLINK_SIMAPPLICATION, entityRow.Controller, DEEPLINK_THIS_TIMERANGE); } else if (entityRow is EntitySIMTier) { EntitySIMTier entity = (EntitySIMTier)entityRow; entity.ControllerLink = String.Format(DEEPLINK_CONTROLLER, entity.Controller, DEEPLINK_THIS_TIMERANGE); entityRow.ApplicationLink = String.Format(DEEPLINK_SIMAPPLICATION, entityRow.Controller, DEEPLINK_THIS_TIMERANGE); } else if (entityRow is EntitySIMNode) { EntitySIMNode entity = (EntitySIMNode)entityRow; entity.ControllerLink = String.Format(DEEPLINK_CONTROLLER, entity.Controller, DEEPLINK_THIS_TIMERANGE); entityRow.ApplicationLink = String.Format(DEEPLINK_SIMAPPLICATION, entityRow.Controller, DEEPLINK_THIS_TIMERANGE); } else if (entityRow is EntitySIMMachine) { EntitySIMMachine entity = (EntitySIMMachine)entityRow; entity.ControllerLink = String.Format(DEEPLINK_CONTROLLER, entity.Controller, DEEPLINK_THIS_TIMERANGE); entityRow.ApplicationLink = String.Format(DEEPLINK_SIMAPPLICATION, entityRow.Controller, DEEPLINK_THIS_TIMERANGE); entity.MachineLink = String.Format(DEEPLINK_SIMMACHINE, entity.Controller, entity.ApplicationID, entity.MachineID, DEEPLINK_THIS_TIMERANGE); } }
private void updateEntityWithDeeplinks(EntitySIMBase entityRow) { updateEntityWithDeeplinks(entityRow, null); }