예제 #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.InvoicesList);
            ActionBar.Hide();
            InitComponents();
            apiService = new ApiService();
            LoadAnimatedGif();

            database = new SqLiteHelper();
            dbpath   = System.IO.Path.Combine(
                System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "ormdemo.db3");

            GetInvoices();

            database.createDatabase(dbpath);
        }
예제 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            System.Threading.Thread.Sleep(2000); //Let's wait awhile...

            database = new SqLiteHelper();
            dbpath   = System.IO.Path.Combine(
                System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "ormdemo.db3");
            database.createDatabase(dbpath);
            user = database.FindUser(dbpath);

            if (user != null)
            {
                this.StartActivity(typeof(LoginVoice));
            }
            else
            {
                this.StartActivity(typeof(LoginActivity));
            }
        }
예제 #3
0
        async void GetUsers()
        {
            var strFilter = "?filter[where][username]=" + usernameInput.Text;

            usersResult = await apiService.Get <User>("https://api.us.apiconnect.ibmcloud.com/",
                                                      "/playgroundbluemix-dev/hackathon/api/", "users", strFilter);

            users = (List <User>)usersResult.Result;

            user          = users[0];
            user.PassUser = passwordInput.Text;

            database = new SqLiteHelper();
            dbpath   = System.IO.Path.Combine(
                System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "ormdemo.db3");
            database.createDatabase(dbpath);

            await database.insertUpdateData(user, dbpath);

            var intent = new Intent(this, typeof(VoiceActivity));

            intent.PutExtra("userName", user.Name);
            StartActivity(intent);

            //var intent = new Intent(this, typeof(ProtectedActivity));
            //StartActivity(intent);


            User user1 = new User();

            user1.Id         = "1";
            user1.Name       = "Yefry";
            user1.DocumentId = "123445";

            //await database.insertUpdateData(user, dbpath);
            //var response = database.FindUser(dbpath);
            //Toast.MakeText(this, response.Name, ToastLength.Long);
        }