/// <summary> /// Loads all of the needed elements /// </summary> /// <param name="savedInstanceState"></param> protected override void OnCreate(Bundle savedInstanceState) { try { base.OnCreate(savedInstanceState); Forms.Init(this, savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_main); finalOrder = new FinalOrder(); fusedLocationProviderClient = LocationServices.GetFusedLocationProviderClient(this); var location = fusedLocationProviderClient.GetLastLocationAsync(); MapFragment mapFragment = (MapFragment)FragmentManager.FindFragmentById(Resource.Id.map); mapFragment.GetMapAsync(this); } catch (Exception e) { Console.WriteLine(e.ToString()); } }
public Task <int> SaveOrderAsync(FinalOrder order) { if (order.ID != 0) { return(_database.UpdateAsync(order)); } else { return(_database.InsertAsync(order)); } }
public Task <int> DeleteOrderAsync(FinalOrder order) { return(_database.DeleteAsync(order)); }