private void ShowAll() { try { using (MyDBContext objectMyDBContext = new MyDBContext()) { clientGrid.ItemsSource = objectMyDBContext.Clients.ToList(); orderGrid.ItemsSource = GridsInfo.GetNewOrders(objectMyDBContext).ToList(); orderListGrid.ItemsSource = GridsInfo.GetNewOrderLists(objectMyDBContext).ToList(); orderTypeGrid.ItemsSource = objectMyDBContext.Order_Types.ToList(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "ОШИБКА", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void ShowAll() { try { using (MyDBContext objectMyDBContext = new MyDBContext()) { productsGrid.ItemsSource = GridsInfo.GetNewProducts(objectMyDBContext).ToList(); orderGrid.ItemsSource = GridsInfo.GetNewOrders(objectMyDBContext).ToList(); transportsGrid.ItemsSource = objectMyDBContext.Transports.ToList(); workersGrid.ItemsSource = GridsInfo.GetNewWorkers(objectMyDBContext).ToList(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "ОШИБКА", MessageBoxButton.OK, MessageBoxImage.Error); } }