async void OnButtonClicked(object sender, EventArgs args) { if (SelBibleName == "") { await App.Current.MainPage.DisplayAlert("", "You must choose a testament.", "OK"); } else { var CountText = ReadChapterCount.Text; if (CountText == null) { CountText = "3"; } if (Helper.IsNumber(CountText) == false) { await App.Current.MainPage.DisplayAlert("", "Please write number ", "OK"); return; } int Count = Convert.ToInt16(CountText); if (Count > 100 || 0 >= Count) { await App.Current.MainPage.DisplayAlert("", "Please write number.", "OK"); return; } bool answer = await App.Current.MainPage.DisplayAlert("info", SelBibleName + " from " + "each day " + CountText, "yes", "no"); if (answer == true) { SQLLiteDB.InsertBibleReadPlan(StartTime.Date, SelBibleName, Count); ShowInfomation(StartTime.Date, Count); } } }
async void OnButtonClicked(object sender, EventArgs args) { if (SelBibleName == "") { await DisplayAlert("", "시작할 권을 먼저 선택해야 합니다.", "OK"); } else { var CountText = ReadChapterCount.Text; if (CountText == null) { CountText = "3"; } if (Helper.IsNumber(CountText) == false) { await DisplayAlert("", "장수는 숫자로만 입력하세요 ", "OK"); return; } int Count = Convert.ToInt16(CountText); if (Count > 100 || 0 >= Count) { await DisplayAlert("", "권장 장수가 아닙니다.", "OK"); return; } bool answer = await DisplayAlert("안내", SelBibleName + "부터 " + "하루 " + CountText + "장씩 시작 하시겠 습니까?", "예", "아니요"); if (answer == true) { SQLLiteDB.InsertBibleReadPlan(StartTime.Date, SelBibleName, Count); ShowInfomation(StartTime.Date, Count); } } }
private void LoadCacheUserData() { try { SQLLiteDB.LoadCacheData(); //성경 읽기계획이 없는 경우 디폴트로 분당에서 하는 것으로 설정한다. var plan = SQLLiteDB.ReadBibleReadPlan(); if (plan == null) { DateTime StartTime = new DateTime(2020, 1, 13); SQLLiteDB.InsertBibleReadPlan(StartTime.Date, "마태복음", 1); } } catch (Exception e) { #if DEBUG CrossLocalNotifications.Current.Show("SQLLiteDB.LoadCacheData Failded", DateTime.Now.ToString(), 0, DateTime.Now); #endif } }