예제 #1
0
        public static ApplicationPersmissionsViewData Create(ApplicationPermission applicationPermission)
        {
            var res = new ApplicationPersmissionsViewData
            {
                Id   = applicationPermission.Id,
                Type = (int)applicationPermission.Permission,
                Name = persmissionNameMapper[applicationPermission.Permission]
            };

            return(res);
        }
예제 #2
0
 protected ApplicationViewData(Application application, IList <Category> categories, bool canGetSecretKey, IList <Guid> standards)
     : base(application)
 {
     Developer   = DeveloperViewData.Create(application.Developer);
     Permissions = ApplicationPersmissionsViewData.Create(application.Permissions);
     if (canGetSecretKey)
     {
         SecretKey = application.SecretKey;
     }
     categories  = categories.Where(x => application.Categories.Any(y => y.CategoryRef == x.Id)).ToList();
     Categories  = CategoryViewData.Create(categories);
     GradeLevels = application.GradeLevels.Select(x => x.GradeLevel).ToList();
     //if (application.ApplicationStandards != null && standards != null)
     //    Standards = CommonCoreStandardViewData.Create(
     //            standards.Where(x => application.ApplicationStandards.Any(y => y.StandardRef == x.Id))
     //                     .ToList());
 }