Example #1
0
        ///<summary>
        /// Изменяет доступные типы задач для переданного типа компонентов
        ///</summary>
        ///<param name="goodsClass">Тип компонента, для которого нужно определить типы задач</param>
        public void UpdateWorkTypes(GoodsClass goodsClass)
        {
            comboBoxWorkType.Items.Clear();
            var directiveTypes = new CommonDictionaryCollection <ComponentRecordType>(ComponentRecordType.Items);

            if (goodsClass.IsNodeOrSubNodeOf(GoodsClass.ControlTestEquipment))
            {
                directiveTypes.Remove(ComponentRecordType.Calibration);
            }

            comboBoxWorkType.Items.AddRange(directiveTypes.OrderBy(x => x.FullName).ToArray());

            if (comboBoxWorkType.SelectedItem == null)
            {
                comboBoxWorkType.SelectedIndex = 0;
            }
        }
        private void UpdateInformation()
        {
            _effDate = _currentDirective.Threshold.EffectiveDate;

            GlobalObjects.PerformanceCalculator.GetNextPerformance(_currentDirective);

            comboBoxWorkType.Items.Clear();
            CommonDictionaryCollection <ProcedureType> directiveTypes =
                ProcedureType.Items;

            foreach (ProcedureType t in directiveTypes)
            {
                comboBoxWorkType.Items.Add(t);
                if (_currentDirective.ProcedureType == t)
                {
                    comboBoxWorkType.SelectedItem = t;
                }
            }
            if (comboBoxWorkType.SelectedItem == null)
            {
                comboBoxWorkType.SelectedIndex = 0;
            }

            if (_currentDirective.Condition == ConditionState.Overdue)
            {
                imageLinkLabelStatus.Status = Statuses.NotSatisfactory;
            }
            if (_currentDirective.Condition == ConditionState.Notify)
            {
                imageLinkLabelStatus.Status = Statuses.Notify;
            }
            if (_currentDirective.Condition == ConditionState.Satisfactory)
            {
                imageLinkLabelStatus.Status = Statuses.Satisfactory;
            }
            if (Math.Abs(_currentDirective.ManHours) > 0.000001)
            {
                textBoxManHours.Text = _currentDirective.ManHours.ToString();
            }
            if (Math.Abs(_currentDirective.Elapsed) > 0.000001)
            {
                textBoxElapsed.Text = _currentDirective.Elapsed.ToString();
            }
            if (Math.Abs(_currentDirective.Cost) > 0.000001)
            {
                textBoxCost.Text = _currentDirective.Cost.ToString();
            }
            textBoxKitRequired.Text = _currentDirective.Kits.Count + " kits";
            checkBoxClose.Checked   = _currentDirective.IsClosed;

            ////MPD Item может иметь привязку либо на MaintenanceCheck либо на Компоненты
            //if (_currentDirective.MaintenanceCheck != null)
            //{
            //    linkLabelEditComponents.Enabled = false;
            //    lookupComboboxMaintenanceCheck.Enabled = true;

            //    _currentDirective.BindDetailDirectives.Clear();
            //}
            //else if(_currentDirective.BindDetailDirectives.Count > 0)
            //{
            //    linkLabelEditComponents.Enabled = true;
            //    lookupComboboxMaintenanceCheck.Enabled = false;
            //}

            SetTextBoxComponentsString();

            #region MaintenanceCheck

            //lookupComboboxMaintenanceCheck.SelectedIndexChanged -= LookupComboboxMaintenanceCheckSelectedIndexChanged;

            //if (_currentDirective.ParentBaseDetail.BaseDetailType == BaseDetailType.Frame)
            //{
            //    string maintenanceScreenDisplayerText =
            //        _currentDirective.ParentBaseDetail.ParentAircraft.RegistrationNumber + " Maintenance Program";
            //    Aircraft pareAircraft = _currentDirective.ParentBaseDetail.ParentAircraft;
            //    lookupComboboxMaintenanceCheck.SetItemsScreenControl<MaintenanceScreen>(new[] { _currentDirective.ParentBaseDetail.ParentAircraft },
            //                                                                               maintenanceScreenDisplayerText);
            //    lookupComboboxMaintenanceCheck.LoadObjectsFunc = GlobalObjects.CasEnvironment.Loader.GetMaintenanceCheck;
            //    lookupComboboxMaintenanceCheck.FilterParam1 = pareAircraft;
            //    lookupComboboxMaintenanceCheck.SelectedItemId = _currentDirective.MaintenanceCheck != null
            //        ? _currentDirective.MaintenanceCheck.ItemId
            //        : -1;
            //    lookupComboboxMaintenanceCheck.UpdateInformation();
            //}

            //lookupComboboxMaintenanceCheck.SelectedIndexChanged += LookupComboboxMaintenanceCheckSelectedIndexChanged;

            #endregion

            if (_currentDirective.Threshold != null)
            {
                lifelengthViewer_SinceNew.Lifelength     = _currentDirective.Threshold.FirstPerformanceSinceNew;
                lifelengthViewer_SinceEffDate.Lifelength = _currentDirective.Threshold.FirstPerformanceSinceEffectiveDate;
                lifelengthViewer_FirstNotify.Lifelength  = _currentDirective.Threshold.FirstNotification;
                lifelengthViewer_Repeat.Lifelength       = _currentDirective.Threshold.RepeatInterval;
                lifelengthViewer_RepeatNotify.Lifelength = _currentDirective.Threshold.RepeatNotification;
                if (_currentDirective.Threshold.FirstPerformanceConditionType == ThresholdConditionType.WhicheverFirst)
                {
                    radio_FirstWhicheverFirst.Checked = true;
                }
                else
                {
                    radio_FirstWhicheverLast.Checked = true;
                }
                if (_currentDirective.Threshold.RepeatPerformanceConditionType == ThresholdConditionType.WhicheverFirst)
                {
                    radio_RepeatWhicheverFirst.Checked = true;
                }
                else
                {
                    radio_RepeatWhicheverLast.Checked = true;
                }
            }
        }
Example #3
0
        /// <summary>
        /// Заполняет поля для редактирования директивы
        /// </summary>
        private void UpdateInformation()
        {
            if (_currentDirective == null)
            {
                return;
            }

            dateTimePickerEffDate.ValueChanged -= DateTimePickerEffDateValueChanged;

            textboxHiddenRemarks.Text = _currentDirective.HiddenRemarks;
            textboxTitle.Text         = _currentDirective.Title;
            textBoxDepartment.Text    = _currentDirective.AuditedObject;
            textboxDescription.Text   = _currentDirective.Description;
            textboxApplicability.Text = _currentDirective.Applicability;
            EffectiveDate             = _currentDirective.Threshold.EffectiveDate;
            textboxRemarks.Text       = _currentDirective.Remarks;
            numericUpDownLevel.Value  = _currentDirective.Level;

            procedureDocRefListControl.Procedure = _currentDirective;

            comboBoxRating.Items.Clear();
            CommonDictionaryCollection <ProcedureRating> directiveTypes =
                ProcedureRating.Items;

            foreach (ProcedureRating t in directiveTypes)
            {
                comboBoxRating.Items.Add(t);
                if (_currentDirective.ProcedureRating == t)
                {
                    comboBoxRating.SelectedItem = t;
                }
            }
            if (comboBoxRating.SelectedItem == null)
            {
                comboBoxRating.SelectedIndex = 0;
            }

            #region Job Card

            lookupComboboxCheckList.SelectedIndexChanged -= LookupComboboxMaintenanceCheckSelectedIndexChanged;

            if (_currentDirective.ParentOperator != null)
            {
                string maintenanceScreenDisplayerText =
                    _currentDirective.ParentOperator.Name + " Job Cards";
                lookupComboboxCheckList.SetItemsScreenControl <CommonListScreen>(new[] { _currentDirective.ParentOperator }, maintenanceScreenDisplayerText);
                lookupComboboxCheckList.SetEditScreenControl <JobCardScreen>(maintenanceScreenDisplayerText);
                lookupComboboxCheckList.SetAddScreenControl <JobCardScreen>(new object[] { _currentDirective }, _currentDirective + ". New Job Card");
                lookupComboboxCheckList.LoadObjectsFunc = GlobalObjects.CasEnvironment.GetJobCard;
                lookupComboboxCheckList.FilterParam1    = _currentDirective;
                lookupComboboxCheckList.SelectedItemId  = _currentDirective.JobCard != null
                    ? _currentDirective.JobCard.ItemId
                    : -1;
                lookupComboboxCheckList.UpdateInformation();
            }

            lookupComboboxCheckList.SelectedIndexChanged += LookupComboboxMaintenanceCheckSelectedIndexChanged;

            #endregion

            fileControlProcedure.UpdateInfo(_currentDirective.ProcedureFile,
                                            "Adobe PDF Files|*.pdf",
                                            "This record does not contain a file proving the Procedure File. Enclose PDF file to prove the compliance.",
                                            "Attached file proves the Procedure File.");
            fileControlCheckList.UpdateInfo(_currentDirective.CheckListFile,
                                            "Adobe PDF Files|*.pdf",
                                            "This record does not contain a file proving the Check List. Enclose PDF file to prove the compliance.",
                                            "Attached file proves the Check List.");

            dateTimePickerEffDate.ValueChanged += DateTimePickerEffDateValueChanged;
        }