Пример #1
0
 /// <summary>
 /// addButton_Click handles the addition of an item
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void addButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         addItemWindow = new wndAddItem(itemsLogic);
         addItemWindow.ShowDialog();
         itemsDataGrid.ItemsSource = itemsLogic.getItems();//populate the datagrid with the items returned from getItems()
     }
     catch (Exception ex)
     {
         HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name,
                     MethodInfo.GetCurrentMethod().Name, ex.Message);
     }
 }
Пример #2
0
 /// <summary>
 /// wndItems is our window for Items
 /// </summary>
 public wndItems()
 {
     try
     {
         InitializeComponent();
         itemsLogic = new clsItemsLogic();
         itemsDataGrid.ItemsSource = itemsLogic.getItems();//populate the datagrid with the items returned from getItems()
     }
     catch (Exception ex)
     {
         HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name,
                     MethodInfo.GetCurrentMethod().Name, ex.Message);
     }
 }
Пример #3
0
 /// <summary>
 /// Fills the dgItemList with all the items in the db
 /// </summary>
 private void FillBox()
 {
     try
     {
         //Fill the box with all the items
         Items = itemsLogic.getItems(itemsSQL.SelectAllItems());
         dgItemList.ItemsSource = Items;
         //Sorts the columns by ItemCode a-z
         dgItemList.Items.SortDescriptions.Add(new SortDescription("ItemCode", ListSortDirection.Ascending));
     }
     catch (Exception ex)
     {
         //Just throw the exception
         throw new Exception(MethodInfo.GetCurrentMethod().DeclaringType.Name + "." +
                             MethodInfo.GetCurrentMethod().Name + " -> " + ex.Message);
     }
 }