예제 #1
0
        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)));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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)));
        }