コード例 #1
0
        private void BTN_DELETE_Click(object sender, RoutedEventArgs e)
        {
            string a = " Delete from Customer where Cus_ID = '" + CMB_UPDATE.Text + "'";

            int line = db.save_update_delete(a);

            if (line == 1)
            {
                MessageBox.Show("Data delete Successfully", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
            }

            else
            {
                MessageBox.Show("Data cannot delete", "error", MessageBoxButton.OK, MessageBoxImage.Error);
            }


            CMB_UPDATE.Items.Clear();
            TXT_FIRSTNAME.Clear();
            TXT_LASTNAME.Clear();
            TXT_ADDRESS.Clear();
            TXT_LICENNUM.Clear();
            TXT_NIC.Clear();
            IMG_UPDATECUS.Source = null;
        }
コード例 #2
0
 private void BTN_CLEAR_Click(object sender, RoutedEventArgs e)
 {
     CMB_UPDATE.ItemsSource = null;
     CMB_UPDATE.Items.Clear();
     TXT_FIRSTNAME.Clear();
     TXT_LASTNAME.Clear();
     TXT_ADDRESS.Clear();
     TXT_LICENNUM.Clear();
     TXT_NIC.Clear();
     IMG_UPDATECUS.Source = null;
 }