private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            using (var logic = new NomenclaturesLogic())
            {
                this.department = logic.UN_Departments.GetById(this.id_selectedDepartment);

                if (this.id_structurePosition == 0)
                {
                    this.structurePosition               = new HR_StructurePositions();
                    this.structurePosition.IsActive      = true;
                    this.structurePosition.Code          = department.Code;
                    this.structurePosition.id_department = this.id_selectedDepartment;
                    this.structurePosition.ActiveFrom    = DateTime.Now;
                }
                else
                {
                    this.structurePosition = logic.HR_StructurePositions.GetById(this.id_structurePosition);
                }

                var comboBoxLogic = new ComboBoxLogic();
                this.cmbPosition.ItemsSource = comboBoxLogic.ReadGlobalPositions(this.structurePosition.id_globalPosition);
                if (this.structurePosition.id_globalPosition != 0)
                {
                    this.cmbPositionTypes.ItemsSource = comboBoxLogic.ReadPositionTypes(this.structurePosition.HR_GlobalPositions.id_positionType);
                }
                else
                {
                    this.cmbPositionTypes.ItemsSource = comboBoxLogic.ReadPositionTypes();
                }
            }
            this.DataContext = this.structurePosition;
        }
Exemplo n.º 2
0
 private void LoadCombos()
 {
     using (var clogic = new ComboBoxLogic())
     {
         var lstPostionTypes = clogic.ReadPositionTypes();
         this.cmbPositionTypes.ItemsSource = lstPostionTypes;
     }
 }
Exemplo n.º 3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            using (var logic = new NomenclaturesLogic())
            {
                if (this.id_globalPosition == 0)
                {
                    this.globalPosition            = new HR_GlobalPositions();
                    this.globalPosition.IsActive   = true;
                    this.globalPosition.ActiveFrom = DateTime.Now;
                }
                else
                {
                    this.globalPosition = logic.HR_GlobalPositions.GetById(this.id_globalPosition);
                }

                using (var comboBoxLogic = new ComboBoxLogic())
                {
                    this.cmbPositionTypes.ItemsSource = comboBoxLogic.ReadPositionTypes(this.globalPosition.id_globalPosition);
                }
                this.DataContext = this.globalPosition;
            }
        }