/// <summary>
        /// event is based on previous methods. if update will update description and or cost based on itemCode. if new will add new item with auto
        /// generated itemCode, inputed descritpion and cost. If delete will delete based on ItemCode
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            _item.ItemDesc = textBoxDescription.Text;
            _item.ItemCode = _logic.GetId();

            if (textBoxDescription.Text == string.Empty)
            {
                _item.ItemDesc = "NULL";
            }

            if (radioButtonAdd.IsChecked == true && ValidateAdd())
            {
                _logic.AddItem(_item);
                _items.Add(_item);
            }

            if (radioButtonDelete.IsChecked == true && ValidateDelete())
            {
                _logic.DeleteItem(_item);
                _items.Remove(_items.FirstOrDefault(x => x.ItemCode == int.Parse(textBoxCode.Text)));
            }

            if (radioButtonUpdate.IsChecked == true && ValidateUpdate())
            {
                _logic.UpdateItem(_item);
                _items = _logic.GetItems();
            }

            _item = new ItemDescription();

            UpdateTable();
        }
        /// <summary>
        ///     initilizes items logic and sql, then fills datagrid with feteched items
        /// </summary>
        public ItemsWindow()
        {
            _items = new List <ItemDescription>();
            _logic = new clsItemsLogic();
            _item  = new ItemDescription();

            InitializeComponent();

            _items = _logic.GetItems();
            DataGridItems.ItemsSource = _items;
        }