/// <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 в CorrectiveAction в завсимоти от существования данного(this) обекта в базе данных /// </summary> /// <param name="releaseToService"></param> private void SetReleaseToService(CertificateOfReleaseToService releaseToService) { if (_releaseToServiceCollection == null) { _releaseToServiceCollection = new BaseRecordCollection <CertificateOfReleaseToService>(); } if (releaseToService != null) { if (_certificateOfReleaseToService != null || _releaseToServiceCollection.Count > 0) { _releaseToServiceCollection.Clear(); _releaseToServiceCollection.Add(releaseToService); } else { _releaseToServiceCollection.Add(releaseToService); } } }