Exemple #1
0
        private void btDescdel_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                MessageBoxResult result;
                //prompt message box and hold result
                result = MessageBox.Show("Are you sure want to delete?", "confirm", MessageBoxButton.YesNo);

                if (dgDesc.SelectedItem != null && result == MessageBoxResult.Yes)
                {
                    int id = (dgDesc.SelectedItem as DescriptionDetail).DescId;

                    Sqlite.ExecuteNonQuery(Query.delDesc(id));

                    dgDesc.ItemsSource = dataTracker.makeDescriptionList();


                    dgDesc.Items.Refresh();
                }
            }
            catch (Exception ex)
            {
                //handle error method
                HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name,
                            MethodInfo.GetCurrentMethod().Name, ex.Message);
            }
        }
Exemple #2
0
        public wpfDescDetail()
        {
            InitializeComponent();

            Sqlite = new clsSQLite();

            Query       = new SQLquery();
            dataTracker = new clsDataTracker();

            dgDesc.ItemsSource = dataTracker.makeDescriptionList();
        }