Ejemplo n.º 1
0
 private async void delete_Click(object sender, RoutedEventArgs e)
 {
     create_update.Content = "Create";
     Cancle_Click(null, null);
     ViewModel.RemoveItem();
     Common.selectName = "";
     await new MessageDialog("Delete successfully!").ShowAsync();
 }
Ejemplo n.º 2
0
 private async void delete_Click(object sender, RoutedEventArgs e)
 {
     Common.selectName = "";
     ViewModel.RemoveItem();
     await new MessageDialog("Delete successfully!").ShowAsync();
     Frame.Navigate(typeof(MainPage));
 }
Ejemplo n.º 3
0
        private async void delete_Click(object sender, RoutedEventArgs e)
        {
            string sql = @"DELETE FROM Todo WHERE ID = ?";

            try {
                using (var res = conn.Prepare(sql)) {
                    res.Bind(1, ViewModel.SelectedItem.ID);
                    res.Step();
                    ViewModel.RemoveItem();
                    Common.selectName = "";
                    await new MessageDialog("Delete successfully!").ShowAsync();
                    Frame.Navigate(typeof(MainPage));
                }
            } catch (Exception ex) {
                Debug.WriteLine(ex.Message);
                throw;
            }
        }