public ActionResult GetAnnouncementApplication(int announcementApplicationId) { var res = SchoolLocator.ApplicationSchoolService.GetAnnouncementApplication(announcementApplicationId); var announcementType = SchoolLocator.AnnouncementFetchService.GetAnnouncementType(res.AnnouncementRef); var app = MasterLocator.ApplicationService.GetApplicationById(res.ApplicationRef); return(Json(AnnouncementApplicationViewData.Create(res, app, null, announcementType))); }
public static IList <AnnouncementApplicationViewData> PrepareAnnouncementApplicationInfo(IServiceLocatorSchool schoolLocator, IServiceLocatorMaster masterLocator, int announcementId) { var annApps = schoolLocator.ApplicationSchoolService.GetAnnouncementApplicationsByAnnId(announcementId, true); var apps = masterLocator.ApplicationService.GetApplicationsByIds(annApps.Select(x => x.ApplicationRef).ToList()); var announcementType = schoolLocator.AnnouncementFetchService.GetAnnouncementType(announcementId); return(AnnouncementApplicationViewData.Create(annApps, apps, schoolLocator.Context.PersonId, announcementType)); }
public ActionResult AddToAnnouncement(int announcementId, int announcementType, Guid applicationId) { Trace.Assert(Context.PersonId.HasValue); Trace.Assert(Context.SchoolYearId.HasValue); var res = SchoolLocator.ApplicationSchoolService.AddToAnnouncement(announcementId, (AnnouncementTypeEnum)announcementType, applicationId); var app = MasterLocator.ApplicationService.GetApplicationById(applicationId); var assessmentApp = MasterLocator.ApplicationService.GetAssessmentApplication(); if (assessmentApp != null && applicationId == assessmentApp.Id) { MasterLocator.UserTrackingService.AttachedAssessment(Context.Login, announcementId); } return(Json(AnnouncementApplicationViewData.Create(res, app, Context.PersonId, (AnnouncementTypeEnum)announcementType))); }