private EffectiveRolesEditModel BuildViewModel(EffectiveRolesPart part)
        {
            var hasRoles = part.ListEffectiveRoles();
            var allRoles = _roleService.GetRoles().OrderBy(r => r.Name).Select(r => new SelectListItem()
            {
                Selected = hasRoles.Contains(r.Name), Text = r.Name, Value = r.Name
            });
            var model = new EffectiveRolesEditModel()
            {
                AllRoles = allRoles
            };

            return(model);
        }
예제 #2
0
 private DriverResult EditorShape(EffectiveRolesEditModel model, dynamic shapeHelper)
 {
     return(ContentShape("Parts_EffectiveRoles_Edit",
                         () => shapeHelper.EditorTemplate(TemplateName: TemplateName + ".Edit", Model: model, Prefix: Prefix)));
 }