/// <summary> /// Возвращает CorrectiveAction в зависимоти от условия существоваяния в базе данных /// </summary> /// <returns></returns> private CertificateOfReleaseToService GetReleaseToService() { if (_releaseToServiceCollection == null) { _releaseToServiceCollection = new BaseRecordCollection <CertificateOfReleaseToService>(); } if (_certificateOfReleaseToService == null) { if (_releaseToServiceCollection.Count == 0) { _certificateOfReleaseToService = new CertificateOfReleaseToService { RecordDate = DateTimeExtend.GetCASMinDateTime() }; _releaseToServiceCollection.Add(_certificateOfReleaseToService); } else { _certificateOfReleaseToService = _releaseToServiceCollection[0]; } } return(_certificateOfReleaseToService); }
/// <summary> /// Создает воздушное судно без дополнительной информации /// </summary> public ComponentDirective(ComponentDirective toCopy) : this() { if (toCopy == null) { return; } Cost = toCopy.Cost; ComponentId = toCopy.ComponentId; DirectiveTypeId = toCopy.DirectiveTypeId; FaaFormFileId = toCopy.FaaFormFileId; HiddenRemarks = toCopy.HiddenRemarks; Highlight = toCopy.Highlight; IsClosed = toCopy.IsClosed; KitRequired = toCopy.KitRequired; ManHours = toCopy.ManHours; MPDTaskType = toCopy.MPDTaskType; ParentComponent = toCopy.ParentComponent; Remarks = toCopy.Remarks; _threshold = toCopy.Threshold; FaaFormFile = toCopy.FaaFormFile; if (_performanceRecords == null) { _performanceRecords = new BaseRecordCollection <DirectiveRecord>(); } _performanceRecords.Clear(); foreach (DirectiveRecord directiveRecord in toCopy.PerformanceRecords) { _performanceRecords.Add(new DirectiveRecord(directiveRecord) { Parent = this, ParentId = ItemId }); } if (Kits == null) { Kits = new CommonCollection <AccessoryRequired>(); } Kits.Clear(); foreach (AccessoryRequired kit in toCopy.Kits) { Kits.Add(new AccessoryRequired(kit) { ParentObject = this, ParentId = ItemId }); } }
/// <summary> /// Записывает ReleaseToService в базу данных /// </summary> private void AddReleaseToService(CertificateOfReleaseToService releaseToService) { _releaseToServiceCollection.Add(releaseToService); // ((ICRSContains)this).CRSID = _releaseToService.ID; }