Exemple #1
0
        /// <summary>
        /// Deletes item from item list
        /// Deletes selected item in itemsDataGrid
        /// Updates database, removing deleted item
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void deleteButton_Click(object sender, RoutedEventArgs e)
        {
            itemDao.addItem(sql.deleteItem(currentItem.Item_Code));
            itemList.Remove(currentItem);

            // Refresh DataGrid to reflect changes
            itemsDataGrid.ItemsSource = itemList;
            itemsDataGrid.Items.Refresh();
        }