Beispiel #1
0
 protected override void InnerMap(AnnouncementComplex ann, Activity activity)
 {
     MapperFactory.GetMapper <Announcement, Activity>().Map(ann, activity);
     if (ann.ClassAnnouncementData == null)
     {
         throw new ChalkableException("Only classAnnouncement can be mapped from activity");
     }
     MapperFactory.GetMapper <ClassAnnouncement, Activity>().Map(ann.ClassAnnouncementData, activity);
     ann.Complete = activity.Complete;
     if (activity.Score != null)
     {
         ann.CurrentStudentScore = ann.CurrentStudentScore ?? new StudentAnnouncementDetails
         {
             AnnouncementId    = ann.Id,
             AnnouncementTitle = ann.Title,
         };
         MapperFactory.GetMapper <StudentAnnouncementDetails, Score>().Map(ann.CurrentStudentScore, activity.Score);
     }
 }
        protected override void InnerMap(AnnouncementAssignedAttribute announcementAttribute, ActivityAssignedAttribute activityAttribute)
        {
            announcementAttribute.Name = activityAttribute.Name;
            announcementAttribute.VisibleForStudents = activityAttribute.VisibleInHomePortal;
            announcementAttribute.Text = activityAttribute.Text;
            announcementAttribute.SisActivityAssignedAttributeId = activityAttribute.Id;
            announcementAttribute.AttributeTypeId = activityAttribute.AttributeId;
            announcementAttribute.SisActivityId   = activityAttribute.ActivityId;

            if (activityAttribute.Attachment != null)
            {
                if (announcementAttribute.Attachment == null)
                {
                    announcementAttribute.Attachment = new Attachment();
                }
                MapperFactory.GetMapper <Attachment, StiAttachment>().Map(announcementAttribute.Attachment, activityAttribute.Attachment);
            }
            else
            {
                announcementAttribute.Attachment    = null;
                announcementAttribute.AttachmentRef = null;
            }
        }