コード例 #1
0
        public void Verif_that_IsCategoryInChainOfRdls_returns_true_for_SiteLogEntry()
        {
            var category = new Category();

            var siteLogEntry = new SiteLogEntry();

            Assert.That(siteLogEntry.IsCategoryInChainOfRdls(category), Is.True);
        }
コード例 #2
0
        private List <SiteLogEntry> SiteLogEntryList()
        {
            SiteLogEntry siteLogEntry = new SiteLogEntry
            {
                ApplicationID     = this.ApplicationID,
                SiteLogTypeID     = this.SiteLogTypeID,
                SiteLogCategoryID = this.SiteLogCategoryID
            };

            List <SiteLogEntry> siteLog = SueetieCommon.GetSiteLogEntryList(siteLogEntry);

            return(siteLog);
        }
コード例 #3
0
        public void SetUp()
        {
            this.logEntryRuleChecker = new LogEntryRuleChecker();

            this.siteLogEntry = new SiteLogEntry();

            this.person = new Person
            {
                Iid       = Guid.Parse("c9e4beec-1b97-4c33-aaea-b8468610af3e"),
                ShortName = "JD"
            };

            this.siteLogEntry.Author = this.person;
        }
コード例 #4
0
        /// <summary>
        /// Serialize the <see cref="SiteLogEntry"/>
        /// </summary>
        /// <param name="siteLogEntry">The <see cref="SiteLogEntry"/> to serialize</param>
        /// <returns>The <see cref="JObject"/></returns>
        private JObject Serialize(SiteLogEntry siteLogEntry)
        {
            var jsonObject = new JObject();

            jsonObject.Add("affectedDomainIid", this.PropertySerializerMap["affectedDomainIid"](siteLogEntry.AffectedDomainIid.OrderBy(x => x, this.guidComparer)));
            jsonObject.Add("affectedItemIid", this.PropertySerializerMap["affectedItemIid"](siteLogEntry.AffectedItemIid.OrderBy(x => x, this.guidComparer)));
            jsonObject.Add("author", this.PropertySerializerMap["author"](siteLogEntry.Author));
            jsonObject.Add("category", this.PropertySerializerMap["category"](siteLogEntry.Category.OrderBy(x => x, this.guidComparer)));
            jsonObject.Add("classKind", this.PropertySerializerMap["classKind"](Enum.GetName(typeof(CDP4Common.CommonData.ClassKind), siteLogEntry.ClassKind)));
            jsonObject.Add("content", this.PropertySerializerMap["content"](siteLogEntry.Content));
            jsonObject.Add("createdOn", this.PropertySerializerMap["createdOn"](siteLogEntry.CreatedOn));
            jsonObject.Add("excludedDomain", this.PropertySerializerMap["excludedDomain"](siteLogEntry.ExcludedDomain.OrderBy(x => x, this.guidComparer)));
            jsonObject.Add("excludedPerson", this.PropertySerializerMap["excludedPerson"](siteLogEntry.ExcludedPerson.OrderBy(x => x, this.guidComparer)));
            jsonObject.Add("iid", this.PropertySerializerMap["iid"](siteLogEntry.Iid));
            jsonObject.Add("languageCode", this.PropertySerializerMap["languageCode"](siteLogEntry.LanguageCode));
            jsonObject.Add("level", this.PropertySerializerMap["level"](Enum.GetName(typeof(CDP4Common.CommonData.LogLevelKind), siteLogEntry.Level)));
            jsonObject.Add("logEntryChangelogItem", this.PropertySerializerMap["logEntryChangelogItem"](siteLogEntry.LogEntryChangelogItem.OrderBy(x => x, this.guidComparer)));
            jsonObject.Add("modifiedOn", this.PropertySerializerMap["modifiedOn"](siteLogEntry.ModifiedOn));
            jsonObject.Add("revisionNumber", this.PropertySerializerMap["revisionNumber"](siteLogEntry.RevisionNumber));
            jsonObject.Add("thingPreference", this.PropertySerializerMap["thingPreference"](siteLogEntry.ThingPreference));
            return(jsonObject);
        }
 /// <summary>
 /// Add an Log Entry row view model to the list of <see cref="LogEntry"/>
 /// </summary>
 /// <param name="logEntry">
 /// The <see cref="LogEntry"/> that is to be added
 /// </param>
 private SiteLogEntryRowViewModel AddLogEntryRowViewModel(SiteLogEntry logEntry)
 {
     return(new SiteLogEntryRowViewModel(logEntry, this.Session, this));
 }
        /// <summary>
        /// Persist the <see cref="SiteLogEntry"/> containment tree to the ORM layer. Update if it already exists.
        /// This is typically used during the import of existing data to the Database.
        /// </summary>
        /// <param name="transaction">
        /// The current <see cref="NpgsqlTransaction"/> to the database.
        /// </param>
        /// <param name="partition">
        /// The database partition (schema) where the requested resource will be stored.
        /// </param>
        /// <param name="siteLogEntry">
        /// The <see cref="SiteLogEntry"/> instance to persist.
        /// </param>
        /// <returns>
        /// True if the persistence was successful.
        /// </returns>
        private bool UpsertContainment(NpgsqlTransaction transaction, string partition, SiteLogEntry siteLogEntry)
        {
            var results = new List <bool>();

            foreach (var logEntryChangelogItem in this.ResolveFromRequestCache(siteLogEntry.LogEntryChangelogItem))
            {
                results.Add(this.LogEntryChangelogItemService.UpsertConcept(transaction, partition, logEntryChangelogItem, siteLogEntry));
            }

            return(results.All(x => x));
        }