Exemplo n.º 1
0
        public async void MasterDownload(object sender, EventArgs s)
        {
            var connection = new ConnectionInformation();

            if (!connection.IsRegisted())
            {
                await DisplayAlert("Error", "接続情報が登録されていません。\n設定してください。", "OK");

                return;
            }

            MessagingCenter.Send(this, "dialog_progress", true);

            string test_result = await Link.TestConnect();

            if (test_result == "success")
            {
                await Link.DownloadAsync("api/fixed");

                await Link.DownloadAsync("api/spendmaster");

                await Link.DownloadAsync("api/incomemaster");
            }

            MessagingCenter.Send(this, "dialog_progress", false);

            if (test_result == "success")
            {
                await DisplayAlert("Info", "連携処理が終わりました", "OK");
            }
            else
            {
                await DisplayAlert("Error", "サーバとの接続に失敗しました", "OK");
            }
        }