async void OnAddQuickVictoryClicked(object sender, System.EventArgs e)
        {
            string desc = await DisplayPromptAsync("Add Quick Victory", "Enter the Quick Victory here.");

            TextInfo textInfo = new CultureInfo("en-GB", false).TextInfo;

            if (string.IsNullOrWhiteSpace(desc))
            {
                await DisplayAlert("Error", "Please enter a value.", "Ok");
            }
            else
            {
                var quickVictory = new QuickVictories()
                {
                    Desc = textInfo.ToTitleCase(desc)
                };

                await App.Database.SaveQuickVictoryAsync(quickVictory);

                await Navigation.PushAsync(new PreferencesQuick()
                {
                });
            }
        }
示例#2
0
 public Task <int> DeleteQuickVictoryAsync(QuickVictories quickVictories)
 {
     return(_database.DeleteAsync(quickVictories));
 }
示例#3
0
 public Task <int> SaveQuickVictoryAsync(QuickVictories quickVictories)
 {
     return(quickVictories.Id != 0 ? _database.UpdateAsync(quickVictories) : _database.InsertAsync(quickVictories));
 }