public static async Task <bool> CheckIntegrity(Context context) { CanSetUbicacion = true; if (Usuario == null) { ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(context); int UserID = prefs.GetInt("BossMandados_UserID", 0); if (UserID == 0) { return(false); } LoginData logindata = new LoginData(context); Usuario = await logindata.GetUser(UserID); } if (Usuario == null) { return(false); } if (Repartidor == null) { WelcomeData welcomedata = new WelcomeData(context); Repartidor = await welcomedata.Repartidor(Usuario.Id); nMandados = 0; } return(Repartidor != null); }
public static async Task <bool> UpdateLocation(Location location, Context context, int img) { try { CanSetUbicacion = false; WelcomeData data = new WelcomeData(context); int aux = await data.SetUbicacion(location.Latitude, location.Longitude, Repartidor.Id); await Task.Delay(20000); CanSetUbicacion = true; bool ans = aux > nMandados; nMandados = aux; return(ans); }catch { await Task.Delay(20000); CanSetUbicacion = true; return(false); } }
public ProfileCore(Context context) { this.context = context; data = new WelcomeData(context); }
public WelcomeCore(Context context) { this.context = context; this.data = new WelcomeData(context); }