/// <summary>
        /// Syncs Profile User and Pump Tables with mobile API values
        /// </summary>
        /// <param name="Id">Current Authorized User Id</param>
        /// <returns>System.Threading.Tasks.Task</returns>

        /*
         * public async Task<SyncState> SyncUserData(string Id)
         * {
         *  SyncState state = SyncState.Offline;
         *  if (CrossConnectivity.Current.IsConnected)
         *  {
         *      try
         *      {
         *          string transId = "pullProfileUser" + Id;
         *          if (transId.Length > 50)
         *          {
         *              transId = transId.Substring(0, 50);
         *          }
         *          await profileUserTable.PullAsync(transId, profileUserTable.Where(w => w.UserId == Id));
         *      }
         *      catch (MobileServicePushFailedException exc)
         *      {
         *          await SimpleConflictResolution(exc);
         *          state = SyncState.CompleteWithConflicts;
         *      }
         *      catch (Exception ex)
         *      {
         *          Debug.WriteLine(ex.Message);
         *          state = SyncState.Error;
         *      }
         *
         *      IList<string> profileIds = await profileUserTable.Select(s => s.ProfileId).ToListAsync();
         *
         *      try
         *      {
         *          string transId = "pullProfile" + Id;
         *          if (transId.Length > 50)
         *          {
         *              transId = transId.Substring(0, 50);
         *          }
         *          await profileTable.PullAsync(transId, profileTable.Where(w => profileIds.Contains(w.Id)));
         *      }
         *      catch (MobileServicePushFailedException exc)
         *      {
         *          await SimpleConflictResolution(exc);
         *          if(state != SyncState.Error)
         *          {
         *              state = SyncState.CompleteWithConflicts;
         *          }
         *      }
         *      catch (Exception ex)
         *      {
         *          Debug.WriteLine(ex.Message);
         *          state = SyncState.Error;
         *      }
         *
         *      try
         *      {
         *          string transId = "pullPumps" + Id;
         *          if (transId.Length > 50)
         *          {
         *              transId = transId.Substring(0, 50);
         *          }
         *          await profileTable.PullAsync(transId, pumpTable.Where(w => profileIds.Contains(w.ProfileId)));
         *      }
         *      catch (MobileServicePushFailedException exc)
         *      {
         *          await SimpleConflictResolution(exc);
         *          if (state != SyncState.Error)
         *          {
         *              state = SyncState.CompleteWithConflicts;
         *          }
         *      }
         *      catch (Exception ex)
         *      {
         *          Debug.WriteLine(ex.Message);
         *          state = SyncState.Error;
         *      }
         *      if(state != SyncState.Error && state != SyncState.CompleteWithConflicts)
         *      {
         *          state = SyncState.Complete;
         *      }
         *
         *  }
         *  return state;
         * }
         */
        /// <summary>
        /// Adds or Inserts Pump Into Pump Table and Syncs with mobile API values
        /// </summary>
        /// <param name="pump">DataObjects.Pump row to add or update</param>
        /// <returns>System.Threading.Tasks.Task</returns>
        public async Task AddUpdatePump(DataObjects.Pump pump)
        {
            try
            {
                // Make sure the user is logged in so UserId and ProfileId are valid
                if (_isLoggedIn)
                {
                    pump.ProfileId = _currentProfileId;

                    if (null == await pumpTable.LookupAsync(pump.Id))
                    {
                        await pumpTable.InsertAsync(pump);
                    }
                    else
                    {
                        await pumpTable.UpdateAsync(pump);
                    }
                    await SyncPump();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("Error adding Pump: " + ex.Message);
            }
        }
 /// <summary>
 /// Deletes Pump From Local Tables the Syncs Changes with mobile api
 /// </summary>
 /// <param name="pump">DataObjects.Pump row to delete</param>
 /// <returns></returns>
 public async Task DeletePump(DataObjects.Pump pump)
 {
     try
     {
         await pumpTable.DeleteAsync(pump);
         await SyncPump();
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine("Error removing pump: " + ex.Message);
     }
 }