private void BindingData()
        {
            if (_workerRequest == null)
            {
                return;
            }

            var workerId     = Convert.ToInt32(_workerRequest["WorkerID"]);
            var mainWorkerId = Convert.ToInt32(_workerRequest["MainWorkerID"]);

            var workerProfessions = _staffClass.WorkerProfessionsDataTable.Select(string.Format("WorkerID = {0}", workerId));

            WorkerProfessionsListBox.ItemsSource = workerProfessions.Any()
                ? workerProfessions.CopyToDataTable().AsDataView()
                : null;

            var mainWorkerProfessions = _staffClass.WorkerProfessionsDataTable.Select(string.Format("WorkerID = {0}", mainWorkerId));

            MainWorkerProfessionsListBox.ItemsSource = mainWorkerProfessions.Any()
                ? mainWorkerProfessions.CopyToDataTable().AsDataView()
                : null;

            FactoryComboBox.ItemsSource = _catalogClass.GetFactories();
            if (FactoryComboBox.HasItems)
            {
                FactoryComboBox.SelectedIndex = 0;
            }
        }
Пример #2
0
        private void SetBindings()
        {
            WorkerGroupsComboBox.SelectionChanged -= WorkerGroupsComboBox_SelectionChanged;
            WorkerGroupsComboBox.ItemsSource       = _sc.GetWorkerGroups();
            WorkerGroupsComboBox.SelectionChanged += WorkerGroupsComboBox_SelectionChanged;


            FactoriesComboBox.SelectionChanged -= FactoriesComboBox_SelectionChanged;
            FactoriesComboBox.ItemsSource       = _cc.GetFactories();
            FactoriesComboBox.SelectionChanged += FactoriesComboBox_SelectionChanged;

            WorkUnitsListBox.SelectionChanged -= WorkUnitsListBox_SelectionChanged;
            WorkUnitsListBox.ItemsSource       = _cc.GetWorkUnits();
            WorkUnitsListBox.SelectionChanged += WorkUnitsListBox_SelectionChanged;


            WorkSectionsListBox.SelectionChanged -= WorkSectionsListBox_SelectionChanged;
            WorkSectionsListBox.ItemsSource       = _cc.GetWorkSections();
            WorkSectionsListBox.SelectionChanged += WorkSectionsListBox_SelectionChanged;


            WorkSubsectionsListBox.SelectionChanged -= WorkSubsectionsListBox_SelectionChanged;
            WorkSubsectionsListBox.ItemsSource       = _cc.GetWorkSubsections();
            WorkSubsectionsListBox.SelectionChanged += WorkSubsectionsListBox_SelectionChanged;


            WorkOperationsListBox.SelectionChanged -= WorkOperationsListBox_SelectionChanged;
            WorkOperationsListBox.ItemsSource       = _cc.GetWorkOperations();
            WorkOperationsListBox.SelectionChanged += WorkOperationsListBox_SelectionChanged;

            OperationGroupsComboBox.ItemsSource = _cc.GetOperationGroups();

            MeasureUnitsComboBox.ItemsSource   = _cc.GetMeasureUnits();
            MeasureUnitsComboBox.SelectedIndex = 0;

            WorkerGroupsProp1ComboBox.ItemsSource = _sc.GetWorkerGroups();

            FactoriesProp1ComboBox.ItemsSource = _cc.GetFactories();

            SubsectionsGroupsProp3ComboBox.ItemsSource = _cc.GetWorkSubsectionsGroups();

            WorkerGroupsComboBox.SelectedIndex = 0;

            FactoriesComboBox.SelectedIndex = 0;
            WorkUnitsListBox.SelectedIndex  = 0;
        }
Пример #3
0
        private void FillBindings()
        {
            FactoryComboBox.ItemsSource       = _cc.GetFactories();
            FactoryComboBox.DisplayMemberPath = "FactoryName";
            FactoryComboBox.SelectedValuePath = "FactoryID";

            WorkUnitsComboBox.DisplayMemberPath = "WorkUnitName";
            WorkUnitsComboBox.SelectedValuePath = "WorkUnitID";

            WorkSectionsComboBox.DisplayMemberPath = "WorkSectionName";
            WorkSectionsComboBox.SelectedValuePath = "WorkSectionID";
        }
Пример #4
0
 private void BindingFactoryComboBox()
 {
     FactoryComboBox.ItemsSource       = _cc.GetFactories();
     FactoryComboBox.DisplayMemberPath = "FactoryName";
     FactoryComboBox.SelectedValuePath = "FactoryID";
 }
Пример #5
0
 private void SetBindings()
 {
     FactoriesListBox.ItemsSource = _cc.GetFactories();
 }