Esempio n. 1
0
 ///<summary>
 /// Создает объект для отображения информации о директиве
 ///</summary>
 public DefferedGeneralInformationControl(Aircraft currentAircraft)
 {
     InitializeComponent();
     ataChapterComboBox.UpdateInformation();
     if (currentAircraft != null)
     {
         DefferedCategoriesCollection defferedCategories =
             GlobalObjects.CasEnvironment.Loader.
             GetObjectCollection <DeferredCategory, DefferedCategoriesCollection>
                 (new ICommonFilter[] { new CommonFilter <AircraftModel>(DeferredCategory.AircraftModelProperty, currentAircraft.Model) });
         comboBoxDefferedCategory.Items.Clear();
         comboBoxDefferedCategory.Items.AddRange(defferedCategories.ToArray());
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 3аполняет поля для редактирования директивы
        /// </summary>
        private void UpdateInformation()
        {
            if (_currentDefferedItem == null)
            {
                return;
            }

            dateTimePickerEffDate.ValueChanged -= DateTimePickerEffDateValueChanged;

            ATAChapter = _currentDefferedItem.ATAChapter;
            DefferedCategoriesCollection defferedCategories =
                GlobalObjects.CasEnvironment.Loader.
                GetObjectCollection <DeferredCategory, DefferedCategoriesCollection>
                    (new ICommonFilter[] { new CommonFilter <AircraftModel>(DeferredCategory.AircraftModelProperty, GlobalObjects.AircraftsCore.GetAircraftById(_currentDefferedItem.ParentBaseComponent.ParentAircraftId).Model) });//TODO:(Evgenii Babak) надо пересмореть т.к из Aircraft тут используется только Model

            comboBoxDefferedCategory.Items.Clear();
            comboBoxDefferedCategory.Items.AddRange(defferedCategories.ToArray());
            comboBoxDefferedCategory.SelectedItem = _currentDefferedItem.DeferredCategory;

            ADType            = _currentDefferedItem.ADType == 0 ? ADType.Airframe : ADType.Appliance;
            Title             = _currentDefferedItem.Title;
            EffectiveDate     = _currentDefferedItem.Threshold.EffectiveDate;
            ServiceBulletin   = _currentDefferedItem.ServiceBulletinNo;
            EngOrderNumber    = _currentDefferedItem.EngineeringOrders;
            Applicability     = _currentDefferedItem.Applicability;
            Subject           = _currentDefferedItem.Description;
            LogBookReferences = _currentDefferedItem.DeferredLogBookRef;
            MelCdlItem        = _currentDefferedItem.DeferredMelCdlItem;
            Extention         = _currentDefferedItem.DeferredExtention;
            Remarks           = _currentDefferedItem.Remarks;
            HiddenRemarks     = _currentDefferedItem.HiddenRemarks;


            const bool permission = true;

            ataChapterComboBox.Enabled    = permission;
            textboxTitle.ReadOnly         = !permission;
            dateTimePickerEffDate.Enabled = permission;
            textboxApplicability.ReadOnly = !permission;
            textboxSubject.ReadOnly       = !permission;
            textboxRemarks.ReadOnly       = !permission;
            textboxHiddenRemarks.ReadOnly = !permission;

            fileControlADNo.UpdateInfo(_currentDefferedItem.ADNoFile,
                                       "Adobe PDF Files|*.pdf",
                                       "This record does not contain a file proving the AD No. Enclose PDF file to prove the compliance.",
                                       "Attached file proves the AD No.");
            fileControlSB.UpdateInfo(_currentDefferedItem.ServiceBulletinFile,
                                     "Adobe PDF Files|*.pdf",
                                     "This record does not contain a file proving the Service bulletin. Enclose PDF file to prove the compliance.",
                                     "Attached file proves the Service bulletin.");
            fileControlEO.UpdateInfo(_currentDefferedItem.EngineeringOrderFile,
                                     "Adobe PDF Files|*.pdf",
                                     "This record does not contain a file proving the Engineering order. Enclose PDF file to prove the compliance.",
                                     "Attached file proves the Engineering order.");


            var parentAircraft = GlobalObjects.AircraftsCore.GetParentAircraft(_currentDefferedItem);
            var flight         = GlobalObjects.AircraftFlightsCore.LoadFullAircraftFlightById(_currentDefferedItem.AircraftFlightId, parentAircraft.ItemId);//TODO:(Evgenii Babak)пересмотреть использования метода LoadFullAircraftFlightById т.к. из полета используется только ATLBId и FlightNo

            if (flight != null)
            {
                //Если отклонение было создано во время полета
                //то необходимо заблокировать дату открытия
                dateTimePickerEffDate.Enabled = false;
                lookupComboboxFlight.SetEditScreenControl <FlightScreen>
                    (parentAircraft.RegistrationNumber + ". " + flight.FlightNumber);
                var parentAtlb = GlobalObjects.CasEnvironment.NewLoader.GetObject <ATLBDTO, ATLB>(new Filter("ItemId", flight.ATLBId));
                //Проверить на значение свойтсва ParentAircraft в parentAtlb
                lookupComboboxFlight.SetItemsScreenControl <FlightsListScreen>
                    (new object[] { parentAtlb },
                    parentAircraft.RegistrationNumber + ". ATLB No " + parentAtlb.ATLBNo);
                lookupComboboxFlight.LoadObjectsFunc = GlobalObjects.AircraftFlightsCore.GetFlightsByAtlb;
                lookupComboboxFlight.FilterParam1    = flight.AircraftId;
                lookupComboboxFlight.FilterParam2    = parentAtlb.ItemId;
                lookupComboboxFlight.UpdateInformation();
                lookupComboboxFlight.SelectedItemId = _currentDefferedItem.AircraftFlightId;
            }

            dateTimePickerEffDate.ValueChanged += DateTimePickerEffDateValueChanged;
        }