public void AddStudentAnnouncement(StudentAnnouncement studentAnnouncement) { StudentAnnouncementStorage.Add(studentAnnouncement); var score = new Score(); MapperFactory.GetMapper <Score, StudentAnnouncement>().Map(score, studentAnnouncement); ActivityScoreStorage.Add(score); }
public void DeleteStudentAnnouncements(int announcementId, int sisActivityId) { var scores = ActivityScoreStorage.GetSores(sisActivityId); ActivityScoreStorage.Delete(scores); var studentAnnouncements = StudentAnnouncementStorage.GetAll() .Where(x => x.AnnouncementId == announcementId) .ToList(); StudentAnnouncementStorage.Delete(studentAnnouncements); }
public IList <StudentAnnouncementDetails> GetAll(int announcementId) { return(StudentAnnouncementStorage.GetAll().Where(x => x.AnnouncementId == announcementId).Select(x => { var ann = ServiceLocator.ClassAnnouncementService.GetClassAnnouncemenById(announcementId); var student = ServiceLocator.StudentService.GetById(x.StudentId, Context.SchoolYearId.Value); var details = new Student { BirthDate = student.BirthDate, FirstName = student.FirstName, Gender = student.Gender, HasMedicalAlert = student.HasMedicalAlert, Id = student.Id, IsAllowedInetAccess = student.IsAllowedInetAccess, IsWithdrawn = null, LastName = student.LastName, PhotoModifiedDate = null, SpecialInstructions = student.SpecialInstructions, SpEdStatus = student.SpEdStatus, UserId = student.UserId }; return new StudentAnnouncementDetails { AnnouncementId = x.AnnouncementId, AbsenceCategory = x.AbsenceCategory, Absent = x.Absent, ActivityId = x.ActivityId, AlphaGradeId = x.AlphaGradeId, AlternateScoreId = x.AlternateScoreId, Comment = x.Comment, ScoreDropped = x.ScoreDropped, Exempt = x.Exempt, ExtraCredit = x.ExtraCredit, Incomplete = x.Incomplete, ClassId = ann.ClassRef, Late = x.Late, NumericScore = x.NumericScore, OverMaxScore = x.OverMaxScore, ScoreValue = x.ScoreValue, Student = details, StudentId = x.StudentId, Withdrawn = x.Withdrawn }; }).ToList()); }
public void DropUndropAnnouncement(int announcementId, bool drop) { StudentAnnouncementStorage.Update(announcementId, drop); }