public async void AddGebruiker(Gebruiker data)
 {
     await InitLocalStoreAsync();
     await GebruikerTable.InsertAsync(data);           
     await SyncAsync();
     await RefreshItems();
 }
Пример #2
0
        public async void TestingM()
        {
       
          


            //if(await AuthenticateAsync())
            if (!App.isAuthenticated)
            {
                try
                {
                  //  bool b = await AuthenticateAsync();
                    App.AccessToken = await Facebook();
                    var client = new FacebookClient(App.AccessToken);
                    dynamic me = await client.GetTaskAsync("me");
                   
                    App.FacebookId = "" + me.id;
                    App.isAuthenticated = true;
                    App.Fotourl = await GetPictureUrl(App.FacebookId);
                    Gebruiker gebruiker = await repoGebruiker.GetGebruiker(App.FacebookId);
                    
                    //await App.store.DeleteAsync();

                    if (gebruiker == null)
                    {
                        gebruiker = new Gebruiker();
                       gebruiker.Active = true;
                       gebruiker.Facebook = App.FacebookId;
                      
                       gebruiker.Naam = me.name.Split(" ".ToCharArray())[1];
                       gebruiker.Voornaam = me.name.Split(" ".ToCharArray())[0];

                                         
              
                      gebruiker.InstellingenID = "1";

                        repoGebruiker.AddGebruiker(gebruiker);
                    }
                    App.Gebruiker = gebruiker;
                    //1 malig om de catalogus te vullen met planten
                    // Opvuller temp = new Opvuller();
                    // temp.VulCatalog


                    await Windows.Storage.FileIO.WriteTextAsync(sampleFile, App.isAuthenticated +";"+App.FacebookId+";"+App.Fotourl);
                    App.dsdo();
                    
                }
                catch (Exception)
                {

                    App.isAuthenticated = false;
                }

            }
            /*
                 GoToPageMessage message = new GoToPageMessage() { PageNumber = 1 };
                 Messenger.Default.Send<GoToPageMessage>(message);*/
        }