Example #1
0
 protected BaseApplicationViewData(Application application)
 {
     Id                      = application.Id;
     Name                    = application.Name;
     VideoDemoUrl            = application.VideoUrl;
     Url                     = application.Url;
     State                   = (int)application.State;
     DeveloperId             = application.DeveloperRef;
     Description             = application.Description;
     ShortDescription        = StringTools.BuildShortText(application.ShortDescription, SHORT_LENGHT);
     SmallPictureId          = application.SmallPictureRef;
     BigPictureId            = application.BigPictureRef;
     ExternalAttachPictureId = application.ExternalAttachPictureRef;
     ApplicationAccess       = ApplicationAccessViewData.Create(application);
     LiveAppId               = application.OriginalRef;
     IsInternal              = application.IsInternal;
     IsAdvanced              = application.IsAdvanced;
     InternalScore           = application.InternalScore;
     InternalDescription     = application.InternalDescription;
     Picturesid              = application.Pictures.Select(x => x.Id).ToList();
     if (application.LiveApplication != null)
     {
         LiveApplication = Create(application.LiveApplication);
     }
     Ban = application.Ban;
     HasDistrictAdminSettings = application.HasDistrictAdminSettings;
     MyAppsUrl = AppTools.BuildAppUrl(application, null, AppMode.MyView);
     IsBannedForCurrentSchool = null;
     IsBannedForDistrict      = null;
     IsPartiallyBanned        = null;
     AccessToken = null;
 }
        public static AnnouncementApplicationViewData Create(AnnouncementApplication announcementApplication,
                                                             Application application, int?currentPersonId, AnnouncementTypeEnum announcementType)
        {
            var res = new AnnouncementApplicationViewData(application)
            {
                AnnouncementApplicationId = announcementApplication.Id,
                Active           = announcementApplication.Active,
                AnnouncementId   = announcementApplication.AnnouncementRef,
                AnnouncementType = (int)announcementType,
                EditUrl          = AppTools.BuildAppUrl(application, announcementApplication.Id, AppMode.Edit),
                ViewUrl          = AppTools.BuildAppUrl(application, announcementApplication.Id, AppMode.View),
                GradingViewUrl   = AppTools.BuildAppUrl(application, announcementApplication.Id, AppMode.GradingView),
                CurrentPersonId  = currentPersonId,
                Order            = announcementApplication.Order,
                Text             = announcementApplication.Text,
                LongDescription  = announcementApplication.Description,
                ImageUrl         = announcementApplication.ImageUrl
            };

            return(res);
        }