Пример #1
0
        private void SaveForces(IEAElement element)
        {
            //see saveHistroy (clone)
            IEnumerable <string> removedForceEvaluations =
                element.TaggedValues.Where(tv => tv.Name.StartsWith(EATaggedValueKeys.ForceEvaluation))
                .Select(tv => tv.GUID)
                .Except(Forces.Select(f => f.TaggedValueGUID));

            foreach (string tagGUID in removedForceEvaluations)
            {
                element.RemoveTaggedValueByGUID(tagGUID);
            }

            foreach (IForceEvaluation forceEvaluation in Forces)
            {
                forceEvaluation.SaveChanges();
            }
        }
Пример #2
0
        private void SaveHistory(IEAElement element)
        {
            //first old history needs to be removed but if I do this, then I will delete existing.
            //I did not keep track of those that were deleted from the list.
            //first need to check which one were deleted, i.e. exist in EAelem but not in this list
            IEnumerable <string> removedHistroyEntries =
                element.GetTaggedValuesByName(EATaggedValueKeys.DecisionStateChange)
                .Select(tv => tv.GUID)
                .Except(History.Select(h => h.TaggedValueGUID));

            foreach (string tagGUID in removedHistroyEntries)
            {
                element.RemoveTaggedValueByGUID(tagGUID);
            }

            foreach (IHistoryEntry historyEntry in History)
            {
                historyEntry.SaveChanges();
            }
        }