コード例 #1
0
ファイル: MainActivity.cs プロジェクト: shubham980/Brew_Stash
        /// <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());
            }
        }
コード例 #2
0
 public Task <int> SaveOrderAsync(FinalOrder order)
 {
     if (order.ID != 0)
     {
         return(_database.UpdateAsync(order));
     }
     else
     {
         return(_database.InsertAsync(order));
     }
 }
コード例 #3
0
 public Task <int> DeleteOrderAsync(FinalOrder order)
 {
     return(_database.DeleteAsync(order));
 }