public static AnnouncementDetailedViewData Create(AnnouncementDetails announcementDetails, int currentSchoolPersonId, IList <AnnouncementAttachmentInfo> attachmentInfos, IList <AttachmentInfo> attrAttachmentInfos, IList <ClaimInfo> claims) { var res = Create(announcementDetails, currentSchoolPersonId, claims); res.AnnouncementAttachments = AnnouncementAttachmentViewData.Create(attachmentInfos, currentSchoolPersonId); if (announcementDetails.AnnouncementAttributes != null) { res.AnnouncementAttributes = AnnouncementAssignedAttributeViewData.Create(announcementDetails.AnnouncementAttributes, attrAttachmentInfos); } return(res); }
public static AnnouncementAssignedAttributeViewData Create(AnnouncementAssignedAttribute attr, AttachmentInfo attachmentInfo) { var result = new AnnouncementAssignedAttributeViewData { Id = attr.Id, Name = attr.Name, Text = attr.Text, AttributeTypeId = attr.AttributeTypeId, VisibleForStudents = attr.VisibleForStudents, AnnouncementRef = attr.AnnouncementRef, SisActivityAssignedAttributeId = attr.SisActivityAssignedAttributeId, AttributeAttachment = attachmentInfo != null?AttachmentViewData.Create(attachmentInfo) : null }; return(result); }