private void SetCombo() { var machineTypeSource = (new CollectionHelper()).GetUndeclaredCollection(false, _IsPartDeclaration); var enumerator = new List<UndeclaredCollection>(); var variable = new UndeclaredCollection { Collection_Batch_Name = "", Collection_Batch_No = -1, DisplayName = FindResource("PleaseSelectbatch") as string }; enumerator.Add(variable); variable = new UndeclaredCollection { Collection_Batch_Name = "", Collection_Batch_No = 0, DisplayName = FindResource("PartCollections") as string }; enumerator.Add(variable); foreach (var undeclaredCollection in machineTypeSource) enumerator.Add(undeclaredCollection); cboBatch.ItemsSource = enumerator; if (enumerator.Count > 2) cboBatch.SelectedIndex = 2; }
// private void SetCombo() { LogInfo("START SetCombo"); cboFilterBy.ItemsSource = _collectionHelper.GetDeclarationFilterColumns(this); List<UndeclaredCollection> machineTypeSource = new List<UndeclaredCollection>(); UndeclaredCollection variable = new UndeclaredCollection { Collection_Batch_Name = "", Collection_Batch_No = -1, DisplayName = FindResource("PleaseSelectbatch") as string }; machineTypeSource.Add(variable); machineTypeSource.AddRange(_collectionHelper.GetUndeclaredCollectionList(false, IsPartCollectionDeclaration)); cboMachineType.ItemsSource = machineTypeSource; if (cboMachineType.Items.Count > 1) { cboMachineType.SelectedIndex = 1; if (!Settings.CentralizedDeclaration) { btnBillCounter.Visibility = Visibility.Visible; } else { btnBillCounter.Visibility = Visibility.Hidden; } } else { cboMachineType.SelectedIndex = 0; btnBillCounter.Visibility = Visibility.Hidden; } LogInfo("END SetCombo"); }
// private void SetDefaultCombo() { try { List<UndeclaredCollection> enumerator = new List<UndeclaredCollection>(); UndeclaredCollection variable = new UndeclaredCollection { Collection_Batch_Name = "", Collection_Batch_No = -1, DisplayName = FindResource("PleaseSelectbatch") as string }; enumerator.Add(variable); if (cboMachineType != null) { cboMachineType.ItemsSource = enumerator; } } catch (Exception Ex) { ExceptionManager.Publish(Ex); } }
// private void cboMachineType_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) { try { _selectedMachine = cboMachineType.SelectedItem as UndeclaredCollection; this.CheckAndFilterData(); } catch (Exception Ex) { ExceptionManager.Publish(Ex); } }