public void UpdateAnnouncementApplicationMeta(int announcementApplicationId, AnnouncementTypeEnum announcementType, string text, string imageUrl, string description)
        {
            Trace.Assert(Context.SchoolLocalId.HasValue);
            Trace.Assert(Context.PersonId.HasValue);
            using (var uow = Update())
            {
                var da  = new AnnouncementApplicationDataAccess(uow);
                var aa  = da.GetById(announcementApplicationId);
                var ann = ServiceLocator.GetAnnouncementService(announcementType).GetAnnouncementById(aa.AnnouncementRef);
                if (!ann.IsOwner && Context.Role != CoreRoles.DISTRICT_ADMIN_ROLE)
                {
                    throw new ChalkableSecurityException(ChlkResources.ERR_SECURITY_EXCEPTION);
                }
                aa.Text = text;

                if (string.IsNullOrWhiteSpace(imageUrl) || !Uri.IsWellFormedUriString(imageUrl, UriKind.Absolute))
                {
                    imageUrl = null;
                }

                aa.ImageUrl    = imageUrl;
                aa.Description = description;
                da.Update(aa);
                uow.Commit();
            }
        }
        public void AttachAppToAnnouncement(int announcementAppId, AnnouncementTypeEnum announcementType)
        {
            Trace.Assert(Context.SchoolLocalId.HasValue);
            Trace.Assert(Context.PersonId.HasValue);
            using (var uow = Update())
            {
                var da = new AnnouncementApplicationDataAccess(uow);
                var aa = da.GetById(announcementAppId);

                var ann = ServiceLocator.GetAnnouncementService(announcementType).GetAnnouncementById(aa.AnnouncementRef);
                if (!ann.IsOwner && Context.Role != CoreRoles.DISTRICT_ADMIN_ROLE)
                {
                    throw new ChalkableSecurityException(ChlkResources.ERR_SECURITY_EXCEPTION);
                }
                aa.Active = true;
                da.Update(aa);
                uow.Commit();
            }
        }