Example #1
0
        public async void Save(salarymoney item)
        {
            //await App.Database.SaveItemAsync(item);
            await DisplayAlert("DATA", "登録しました", "OK");

            await App.Database3.SaveItemAsync(item);
        }
Example #2
0
        private async void tourokuClicked(object sender, EventArgs e)
        {
            try
            {
                base.OnAppearing();
                var result = await App.Database3.GetItemsAsync();

                int goukei = 0;
                foreach (var loc in result)
                {
                    await App.Database3.DeleteItemAsync(loc);
                }
                int kin = int.Parse(money.Text);

                goukei = kin - goukei;
                //DateTime dt1 = DateTime.Parse(dd);
                //DateTime dt1 = DateTime.Parse(dd);
                salarymoney item = new salarymoney()
                {
                    Spay = goukei,
                };
                Save(item);
            }
            catch (Exception)
            {
                DisplayAlert("Alert", "正しい値を入力してください。", "OK");
            }
        }
Example #3
0
        private async void tourokuClicked(object sender, EventArgs e)
        {
            base.OnAppearing();
            var result = await App.Database3.GetItemsAsync();

            var result2 = await App.Database4.GetItemsAsync();

            int goukei = 0;

            foreach (var loc in result)
            {
                await App.Database3.DeleteItemAsync(loc);
            }
            int kin = int.Parse(money.Text);

            foreach (var loc1 in result2)
            {
                goukei = loc1.Spay + goukei;
            }

            goukei = kin - goukei;
            //DateTime dt1 = DateTime.Parse(dd);
            //DateTime dt1 = DateTime.Parse(dd);
            salarymoney item = new salarymoney()
            {
                Spay = goukei,
            };

            Save(item);
        }
Example #4
0
 public Task <int> SaveItemAsync(salarymoney item)
 {
     if (item.ID != 0)
     {
         return(database.UpdateAsync(item));
     }
     else
     {
         return(database.InsertAsync(item));
     }
 }
Example #5
0
 public Task <int> DeleteItemAsync(salarymoney item)
 {
     return(database.DeleteAsync(item));
 }