public static Domain.Models.Organization CreateOrganization(splc.domain.Models.Organization organization)
 {
     var org = new Domain.Models.Organization()
     {
         Id = organization.Id,
         Name = organization.OrganizationName,
         DateCreated = organization.DateCreated,
         DateDisbanded = organization.DisbandDate,
         DateFormed = organization.FormedDate,
         DateUpdated = organization.DateModified,
         Description = organization.OrganizationDesc,
         SecurityLevel =
             organization.ConfidentialityTypeId == 1 ? SecurityLevel.EyesOnly : SecurityLevel.Open
     };
     org.LogEntries.Add(new OrganizationLogEntry() { Note = $"Added Organization {org.Name}" });
     return org;
 }
Ejemplo n.º 2
0
        public static Chapter CreateChapter(splc.domain.Models.Chapter beholderchapter, int? organizationId)
        {
            var c = beholderchapter;
            var chapter = new Domain.Models.Chapter()
            {
                Id = c.Id,
                Name = c.ChapterName,
                SecurityLevel = c.ConfidentialityTypeId == 1 ? SecurityLevel.EyesOnly : SecurityLevel.Open,
                Description = c.ChapterDesc,
                DateFormed = c.FormedDate,
                DateDisbanded = c.DisbandDate,
                Movement = Helpers.ConvertMovementId(c.MovementClassId),
                IsHeadquarters = c.IsHeadquarters,
                DateCreated = c.DateCreated,
                DateUpdated = c.DateModified,
                OrganizationId = organizationId == 0 ? null : organizationId,
            };
            chapter.LogEntries.Add(new ChapterLogEntry() { Note = $"Added chapter {chapter.Name}" });

            return chapter;
        }