/// <summary> /// deletes the seleceted item from the database /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDelete_Click(object sender, RoutedEventArgs e) { try { if (itemsLogic.DeleteItem(sSelectedCode)) { itemsLogic.GetItems(); } } catch (Exception ex) { //This is the top level method so we want to handle the exception HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name, MethodInfo.GetCurrentMethod().Name, ex.Message); } }
/// <summary> /// costructor /// </summary> public wndItems() { try { InitializeComponent(); itemsLogic = new clsItemsLogic(this); cbItems.ItemsSource = itemsLogic.GetItems(); } catch (Exception ex) { //This is the top level method so we want to handle the exception HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name, MethodInfo.GetCurrentMethod().Name, ex.Message); } }