public SubjectStaffAssignmentDTO(SubjectStaffAssignment subjectStaffAssignment) { StaffID = subjectStaffAssignment.StaffID; StaffFirstName = subjectStaffAssignment.StaffFirstName; StaffLastName = subjectStaffAssignment.StaffLastName; StaffSiteID = subjectStaffAssignment.StaffSiteID; StaffTitleCode = subjectStaffAssignment.StaffTitleCode; StaffTitle = subjectStaffAssignment.StaffTitle; AssignmentTypeCode = subjectStaffAssignment.AssignmentTypeCode; AssignmentType = subjectStaffAssignment.AssignmentType; AssignmentStartDate = subjectStaffAssignment.AssignmentStartDate; }
#pragma warning disable 1591 public SubjectDTO(Subject subject, PersonDetailsDTO person, SubjectStaffAssignment subjectStaffAssignment = null, SubjectSecurityThreatGroup subjectSecurityThreatGroup = null, List <SubjectISCSentences> listSubjectISCSentences = null, string facilityName = null) #pragma warning restore 1591 : base(subject) { /* * Sourced from VPT Accounts person data */ SourceOrganizationID = person.SourceOrganizationID; Auth0UserID = person.Auth0UserID; FirstName = person.FirstName; MiddleName = person.MiddleName; LastName = person.LastName; BirthDate = person.BirthDate; GenderID = person.GenderID; RaceID = person.RaceID; ImageURL = person.ImageURL; ImageSrc = person.ImageSrc; CaseManagerID = subject.CaseManagerID; personID = person.PersonID; SubjectPortalUsername = person.SubjectPortalUsername; PersonGUID = person.PersonGUID; //email if (person.Contacts.Any()) { var primaryEmail = person.Contacts.FirstOrDefault(c => c.Primary && c.TypeID == (int)ContactType.Email); PrimaryEmail = primaryEmail != null ? primaryEmail.Value : string.Empty; } else { PrimaryEmail = string.Empty; } //phone if (person.Contacts.Any()) { var primaryPhone = person.Contacts.FirstOrDefault(c => c.TypeID == (int)ContactType.Phone); PrimaryPhone = primaryPhone != null ? primaryPhone.Value : string.Empty; } else { PrimaryPhone = string.Empty; } //mobile if (person.Contacts.Any()) { var primaryMobile = person.Contacts.FirstOrDefault(c => c.TypeID == (int)ContactType.Mobile); PrimaryMobile = primaryMobile != null ? primaryMobile.Value : string.Empty; } else { PrimaryMobile = string.Empty; } //secondary email if (person.Contacts.Any()) { var secondaryEmail = person.Contacts.FirstOrDefault(c => c.TypeID == (int)ContactType.SecondaryEmail); SecondaryEmail = secondaryEmail != null ? secondaryEmail.Value : string.Empty; } else { PrimaryMobile = string.Empty; } if (person.ExternalIDs.Any()) { var sorExternalID = person.ExternalIDs.FirstOrDefault(e => e.Type == SystemControlledExternalIDType.SystemOfRecord); SORExternalID = sorExternalID != null ? sorExternalID.Value : string.Empty; var fbiID = person.ExternalIDs.FirstOrDefault(e => e.Type == SystemControlledExternalIDType.FbiID); FBIID = fbiID != null ? fbiID.Value : string.Empty; var sID = person.ExternalIDs.FirstOrDefault(e => e.Type == SystemControlledExternalIDType.SID); SID = sID != null ? sID.Value : string.Empty; } else { SORExternalID = string.Empty; FBIID = string.Empty; SID = string.Empty; } Groups = new List <string>(); foreach (var group in person.Groups) { Groups.Add(group.DisplayName); } /* * Sourced from VPT Case Mgmt subject data */ SubjectUserID = subject.SubjectUserID; FacilityID = subject.FacilityID; EstimatedReleaseDate = subject.EstimatedReleaseDate.HasValue ? subject.EstimatedReleaseDate.Value.ToShortDateString() : string.Empty; if (subjectStaffAssignment != null) { CaseManagerName = subjectStaffAssignment.StaffFirstName + " " + subjectStaffAssignment.StaffLastName; } CustodyLevel = string.IsNullOrWhiteSpace(subject.CustodyLevel) ? null : subject.CustodyLevel.Trim(); SupervisionLevel = string.IsNullOrWhiteSpace(subject.SupervisionLevel) ? null : subject.SupervisionLevel.Trim(); PendingCharges = subject.PendingCharges; SexOffenderType = subject.SexOffenderType; CaseType = subject.CaseType; FacilityCode = subject.FacilityCode; OffenderSiteType = string.IsNullOrWhiteSpace(subject.OffenderSiteType) ? null : subject.OffenderSiteType.Trim(); GTLSiteID = subject.GTLSiteID; if (subjectSecurityThreatGroup != null) { STG = subjectSecurityThreatGroup.SecurityThreatGroupName; SecurityThreatGroupId = subjectSecurityThreatGroup.SecurityThreatGroupId; SecurityThreatGroupAssessment = subjectSecurityThreatGroup.SecurityThreatGroupAssessment; SecurityThreatGroupRank = subjectSecurityThreatGroup.SecurityThreatGroupRank; SecurityThreatGroupStatus = subjectSecurityThreatGroup.SecurityThreatGroupStatus; SecurityThreatGroupStatusDate = subjectSecurityThreatGroup.SecurityThreatGroupStatusDate; } if (listSubjectISCSentences != null) { ISCSentences = listSubjectISCSentences.Count > 0 ? "Yes" : "No"; } //Full Address if (person.PersonAddress != null) { string address = string.Empty; if (!string.IsNullOrWhiteSpace(person.PersonAddress.Address1) && string.IsNullOrWhiteSpace(address)) { address = person.PersonAddress.Address1.Trim(); } if (!string.IsNullOrWhiteSpace(address) && !string.IsNullOrWhiteSpace(person.PersonAddress.Address2)) { address = address + "," + person.PersonAddress.Address2.Trim(); } if (!string.IsNullOrWhiteSpace(address) && !string.IsNullOrWhiteSpace(person.PersonAddress.City)) { address = address + "," + person.PersonAddress.City.Trim(); } if (!string.IsNullOrWhiteSpace(address) && !string.IsNullOrWhiteSpace(person.PersonAddress.State)) { address = address + "," + person.PersonAddress.State.Trim(); } if (!string.IsNullOrWhiteSpace(address) && !string.IsNullOrWhiteSpace(person.PersonAddress.ZipCode)) { address = address + "," + person.PersonAddress.ZipCode.Trim(); } if (!string.IsNullOrWhiteSpace(address) && !string.IsNullOrWhiteSpace(person.PersonAddress.Country)) { address = address + "," + person.PersonAddress.Country.Trim(); } FullAddress = address; } else { FullAddress = string.Empty; } //user custom property if (person.UserCustomProperties.Any()) { UserCustomProperty = new UserCustomPropertyShortDTO(person.UserCustomProperties); } FacilityName = facilityName; }