コード例 #1
0
        /// <summary>
        /// Corrige l'état de la propriété de navigation DocumentationActionDraft.
        /// </summary>
        private void FixupDocumentationActionDraft(DocumentationActionDraft previousValue, bool skipKeys = false)
        {
            if (IsDeserializing)
            {
                return;
            }

            if (previousValue != null && previousValue.DocumentationActionDraftWBS.Contains(this))
            {
                previousValue.DocumentationActionDraftWBS.Remove(this);
            }

            if (DocumentationActionDraft != null)
            {
                if (!DocumentationActionDraft.DocumentationActionDraftWBS.Contains(this))
                {
                    DocumentationActionDraft.DocumentationActionDraftWBS.Add(this);
                }

                DocumentationActionDraftId = DocumentationActionDraft.DocumentationActionDraftId;
            }
            else if (!skipKeys)
            {
                DocumentationActionDraftId = null;
            }

            if (ChangeTracker.ChangeTrackingEnabled)
            {
                ChangeTracker.RecordValue("DocumentationActionDraft", previousValue, DocumentationActionDraft);
                if (DocumentationActionDraft != null && !DocumentationActionDraft.ChangeTracker.ChangeTrackingEnabled)
                {
                    DocumentationActionDraft.StartTracking();
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Corrige l'état de la propriété de navigation DocumentationActionDraft.
        /// </summary>
        private void FixupDocumentationActionDraft(DocumentationActionDraft previousValue)
        {
            if (IsDeserializing)
            {
                return;
            }

            if (previousValue != null && previousValue.ReferentialDocumentations.Contains(this))
            {
                previousValue.ReferentialDocumentations.Remove(this);
            }

            if (DocumentationActionDraft != null)
            {
                if (!DocumentationActionDraft.ReferentialDocumentations.Contains(this))
                {
                    DocumentationActionDraft.ReferentialDocumentations.Add(this);
                }

                DocumentationActionDraftId = DocumentationActionDraft.DocumentationActionDraftId;
            }
            if (ChangeTracker.ChangeTrackingEnabled)
            {
                ChangeTracker.RecordValue("DocumentationActionDraft", previousValue, DocumentationActionDraft);
                if (DocumentationActionDraft != null && !DocumentationActionDraft.ChangeTracker.ChangeTrackingEnabled)
                {
                    DocumentationActionDraft.StartTracking();
                }
            }
        }
コード例 #3
0
        public void Update(DocumentationActionDraftWBS reference)
        {
            ChangeTracker.ChangeTrackingEnabled = true;
            WBS = reference.WBS;

            if (DocumentationActionDraft != null)
            {
                DocumentationActionDraft.Update(reference.DocumentationActionDraft);
            }
        }
コード例 #4
0
        public void Update(DocumentationActionDraft reference)
        {
            ChangeTracker.ChangeTrackingEnabled = true;

            Label    = reference.Label;
            Duration = reference.Duration;
            if (Thumbnail?.Hash != reference.Thumbnail?.Hash)
            {
                Thumbnail = reference.Thumbnail;
            }
            IsKeyTask           = reference.IsKeyTask;
            SkillId             = reference.SkillId;
            CustomNumericValue  = reference.CustomNumericValue;
            CustomNumericValue2 = reference.CustomNumericValue2;
            CustomNumericValue3 = reference.CustomNumericValue3;
            CustomNumericValue4 = reference.CustomNumericValue4;
            CustomTextValue     = reference.CustomTextValue;
            CustomTextValue2    = reference.CustomTextValue2;
            CustomTextValue3    = reference.CustomTextValue3;
            CustomTextValue4    = reference.CustomTextValue4;
            ResourceId          = reference.ResourceId;
            ActionCategoryId    = reference.ActionCategoryId;

            ReferentialDocumentations.ToList().ForEach(docRef =>
            {
                if (!reference.ReferentialDocumentations.Any(_ => _.RefNumber == docRef.RefNumber && _.ReferentialId == docRef.ReferentialId))
                {
                    docRef.ChangeTracker.ChangeTrackingEnabled = true;
                    docRef.MarkAsDeleted();
                }
            });
            reference.ReferentialDocumentations.ForEach(docRef =>
            {
                var oldDocRef = ReferentialDocumentations.SingleOrDefault(_ => _.RefNumber == docRef.RefNumber && _.ReferentialId == docRef.ReferentialId);
                if (oldDocRef == null)
                {
                    ReferentialDocumentations.Add(new ReferentialDocumentationActionDraft
                    {
                        RefNumber     = docRef.RefNumber,
                        ReferentialId = docRef.ReferentialId,
                        Quantity      = docRef.Quantity
                    });
                }
                else
                {
                    oldDocRef.ChangeTracker.ChangeTrackingEnabled = true;
                    oldDocRef.Quantity = docRef.Quantity;
                }
            });
        }
コード例 #5
0
        public PublishedAction(DocumentationActionDraft action)
        {
            DocumentationAction = action;

            Label               = action.Label;
            IsKeyTask           = action.IsKeyTask;
            SkillId             = action.SkillId;
            Start               = 0;
            Finish              = action.Duration;
            BuildStart          = 0;
            BuildFinish         = 0;
            IsRandom            = false;
            ThumbnailHash       = action.ThumbnailHash;
            CustomTextValue     = action.CustomTextValue;
            CustomTextValue2    = action.CustomTextValue2;
            CustomTextValue3    = action.CustomTextValue3;
            CustomTextValue4    = action.CustomTextValue4;
            CustomNumericValue  = action.CustomNumericValue;
            CustomNumericValue2 = action.CustomNumericValue2;
            CustomNumericValue3 = action.CustomNumericValue3;
            CustomNumericValue4 = action.CustomNumericValue4;
            DocumentationRefs1  = action.ReferentialDocumentations.Where(_ => _.RefNumber == 1).Select(_ => new Ref1Action {
                RefId = _.ReferentialId, Quantity = _.Quantity ?? 1
            }).ToList();
            DocumentationRefs2 = action.ReferentialDocumentations.Where(_ => _.RefNumber == 2).Select(_ => new Ref2Action {
                RefId = _.ReferentialId, Quantity = _.Quantity ?? 1
            }).ToList();
            DocumentationRefs3 = action.ReferentialDocumentations.Where(_ => _.RefNumber == 3).Select(_ => new Ref3Action {
                RefId = _.ReferentialId, Quantity = _.Quantity ?? 1
            }).ToList();
            DocumentationRefs4 = action.ReferentialDocumentations.Where(_ => _.RefNumber == 4).Select(_ => new Ref4Action {
                RefId = _.ReferentialId, Quantity = _.Quantity ?? 1
            }).ToList();
            DocumentationRefs5 = action.ReferentialDocumentations.Where(_ => _.RefNumber == 5).Select(_ => new Ref5Action {
                RefId = _.ReferentialId, Quantity = _.Quantity ?? 1
            }).ToList();
            DocumentationRefs6 = action.ReferentialDocumentations.Where(_ => _.RefNumber == 6).Select(_ => new Ref6Action {
                RefId = _.ReferentialId, Quantity = _.Quantity ?? 1
            }).ToList();
            DocumentationRefs7 = action.ReferentialDocumentations.Where(_ => _.RefNumber == 7).Select(_ => new Ref7Action {
                RefId = _.ReferentialId, Quantity = _.Quantity ?? 1
            }).ToList();
        }
コード例 #6
0
        public DocumentationActionDraft(DocumentationActionDraft reference)
        {
            Label               = reference.Label;
            Duration            = reference.Duration;
            ThumbnailHash       = reference.ThumbnailHash;
            IsKeyTask           = reference.IsKeyTask;
            SkillId             = reference.SkillId;
            CustomNumericValue  = reference.CustomNumericValue;
            CustomNumericValue2 = reference.CustomNumericValue2;
            CustomNumericValue3 = reference.CustomNumericValue3;
            CustomNumericValue4 = reference.CustomNumericValue4;
            CustomTextValue     = reference.CustomTextValue;
            CustomTextValue2    = reference.CustomTextValue2;
            CustomTextValue3    = reference.CustomTextValue3;
            CustomTextValue4    = reference.CustomTextValue4;
            ResourceId          = reference.ResourceId;
            ActionCategoryId    = reference.ActionCategoryId;

            reference.ReferentialDocumentations.ForEach(docRef => ReferentialDocumentations.Add(new ReferentialDocumentationActionDraft(docRef)));
        }
コード例 #7
0
 public void Delete()
 {
     ChangeTracker.ChangeTrackingEnabled = true;
     DocumentationActionDraft?.Delete();
     this.MarkAsDeleted();
 }
コード例 #8
0
 public PublishedAction(DocumentationActionDraft action, string WBS) : this(action)
 {
     this.WBS = WBS;
 }