internal static List <IUIData> GetData(UserInfo userInfo, string identifier, Dictionary <string, string> parameters)
        {
            Dictionary <string, IUIData> Settings = new Dictionary <string, IUIData>();
            RoleGroupController          rg       = new RoleGroupController();

            switch (identifier)
            {
            case "setting_addgroup":
            {
                Settings.Add("Roles", new UIData {
                        Name = "Roles", Value = "", Options = RoleManager.GetRoles(userInfo.PortalID)
                    });
                int gid = 0;
                if (parameters.Count > 0)
                {
                    gid = int.Parse(parameters["gid"]);
                }

                if (gid >= 0)
                {
                    Settings.Add("Working_RoleGroupDto", new UIData {
                            Name = "Working_RoleGroupDto", Value = "", Options = rg.GetGroup(gid)
                        });
                }

                break;
            }
            }
            return(Settings.Values.ToList());
        }
        public ActionResult DeleteRoleGroup(RoleGroupDto roleGroupDto)
        {
            ActionResult        actionResult = new ActionResult();
            RoleGroupController rg           = new RoleGroupController();
            RoleGroupDto        roleGroup    = rg.GetGroup(roleGroupDto.Id);

            if (roleGroup == null)
            {
                actionResult.AddError("RoleGroupNotFound", Constants.LocalResourcesFile);
            }
            if (actionResult.IsSuccess)
            {
                DotNetNuke.Security.Roles.RoleController.DeleteRoleGroup(PortalSettings.PortalId, roleGroup.Id);
                actionResult.Data = new { AllRoleGroup = RoleGroupManager.GetRoleGroup(PortalSettings.PortalId) };
            }
            return(actionResult);
        }
예제 #3
0
        public override List <IUIData> GetData(string Identifier, Dictionary <string, string> Parameters)
        {
            switch ((AppFactory.Identifier)Enum.Parse(typeof(AppFactory.Identifier), Identifier))
            {
            case AppFactory.Identifier.setting_roles:
                return(RoleController.GetData(UserInfo, Identifier, Parameters));

            case AppFactory.Identifier.setting_add:
                return(RoleController.GetData(UserInfo, Identifier, Parameters));

            case AppFactory.Identifier.setting_addgroup:
                return(RoleGroupController.GetData(UserInfo, Identifier, Parameters));

            case AppFactory.Identifier.setting_adduser:
                return(RoleController.GetData(UserInfo, Identifier, Parameters));

            default:
                break;
            }
            return(base.GetData(Identifier, Parameters));
        }