private void SearchButton_Click(object sender, RoutedEventArgs e) { ArrangementFilter filter = new ArrangementFilter(); MainWindow wnd = Application.Current.MainWindow as MainWindow; filter.Owner = wnd; List <InventoryTypeDTO> inventoryTypes = wnd.GetInventoryTypes(); filter.mainWnd = wnd; filter.shipmentParentWnd = this; ObservableCollection <KeyValuePair <long, string> > list1 = new ObservableCollection <KeyValuePair <long, string> >(); foreach (InventoryTypeDTO inventoryType in inventoryTypes) { if (inventoryType.InventoryTypeName != "Arrangements") { list1.Add(new KeyValuePair <long, string>(inventoryType.InventoryTypeId, inventoryType.InventoryTypeName)); } } filter.InventoryTypeCombo.ItemsSource = list1; filter.ShowDialog(); }
private void AddProductToWorkOrder_Click(object sender, RoutedEventArgs e) { //show the product screen - pass workOrderId //MainWindow wnd = Window.GetWindow(this) as MainWindow; //InventoryFilter inventoryFilter = new InventoryFilter(this); //wnd.NavigationStack.Push(inventoryFilter); //wnd.MainContent.Content = new Frame() { Content = inventoryFilter}; //couldn't get at the "Add" button that is in the list view header to disable it //if the work order has been paid if (currentWorkOrder.WorkOrder.Paid) { Button b = sender as Button; if (b != null) { b.IsEnabled = false; } return; } ArrangementFilter filter = new ArrangementFilter(this); MainWindow wnd = Application.Current.MainWindow as MainWindow; List <InventoryTypeDTO> inventoryTypes = wnd.GetInventoryTypes(); ObservableCollection <KeyValuePair <long, string> > list1 = new ObservableCollection <KeyValuePair <long, string> >(); foreach (InventoryTypeDTO inventoryType in inventoryTypes) { //if (inventoryType.InventoryTypeName != "Arrangements") { list1.Add(new KeyValuePair <long, string>(inventoryType.InventoryTypeId, inventoryType.InventoryTypeName)); } } filter.InventoryTypeCombo.ItemsSource = list1; filter.Owner = wnd; filter.ShowDialog(); }