public void AddDeleteLocation(Location delete)
 {
     if (delete != null)
     {
         this.DeleteLocations.Add(delete);
     }
 }
 public void AddUpdateLocation(Location update)
 {
     if (update != null)
     {
         this.UpdateLocations.Add(update);
     }
 }
 public static Location ConvertLocationLocalToServer(Location local)
 {
     Location remote = new Location();
     if (local.Deleted == ModelStatusEnum.DELETED_TRASH)
     {
         remote.Removed = true;
     }
     else
     {
         remote.Address = local.Address;
         remote.ShortAddress = local.ShortAddress;
         remote.Radius = local.Radius;
         remote.TransitionType = local.TransitionType;
         remote.Alias = local.Alias;
         Loc loc = new Loc();
         loc.Latitude = local.Latitude;
         loc.Longitude = local.Longitude;
         remote.Loc = loc;
     }
     return remote;
 }
 public static async Task<Location> ConvertServerToLocal(TasksServer serverTask, Location localLocation)
 {
     Location locationRemote = serverTask.Location;
     Location locationLocal = localLocation;
     if (locationLocal == null)
     {
         locationLocal = new Location();
         locationLocal.Id = Constants.EntityIdentifie.DEFAULT_LOCATION_ID;
         locationLocal.TaskSid = serverTask.Id;
     }
     locationLocal.Address = locationRemote.Address;
     locationLocal.ShortAddress = locationRemote.ShortAddress;
     Loc loc = locationRemote.Loc;
     if (loc == null)
     {
         locationLocal.Latitude = 0;
         locationLocal.Longitude = 0;
     }
     else
     {
         locationLocal.Latitude = loc.Latitude;
         locationLocal.Longitude = loc.Longitude;
     }
     if (locationRemote.Radius != null)
     {
         locationLocal.Radius = locationRemote.Radius;
     }
     if (locationRemote.TransitionType != null)
     {
         locationLocal.TransitionType = locationRemote.TransitionType;
     }
     locationLocal.Alias = locationRemote.Alias;
     if (LoggerHelper.IS_LOG_ENABLED)
     {
         await LoggerHelper.LogToAllChannels(null, locationLocal.ToString());
     }
     return locationLocal;
 }
 public void AddUpdateLocation(Location update)
 {
     LocationSyncBean.AddUpdateLocation(update);
 }
Exemple #6
0
        public bool IsContentChanged(Location origin)
        {

            if (!string.Equals(GeofenceId, origin.GeofenceId))
            {
                return true;
            }
            if (Latitude != origin.Latitude)
            {
                return true;
            }
            if (Longitude != origin.Longitude)
            {
                return true;
            }
            if (Radius != origin.Radius)
            {
                return true;
            }
            if (TransitionType != origin.TransitionType)
            {
                return true;
            }
            if (!string.Equals(Address, origin.Address))
            {
                return true;
            }
            if (!string.Equals(ShortAddress, origin.ShortAddress))
            {
                return true;
            }
            return !string.Equals(Alias, origin.Alias);
        }