当前位置: 首页>>代码示例>>C#>>正文


C# RoleController.DeleteUserRole方法代码示例

本文整理汇总了C#中DotNetNuke.Security.Roles.RoleController.DeleteUserRole方法的典型用法代码示例。如果您正苦于以下问题:C# RoleController.DeleteUserRole方法的具体用法?C# RoleController.DeleteUserRole怎么用?C# RoleController.DeleteUserRole使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DotNetNuke.Security.Roles.RoleController的用法示例。


在下文中一共展示了RoleController.DeleteUserRole方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: grdUserRoles_Delete

        /// <summary>
        /// grdUserRoles_Delete runs when one of the Delete Buttons in the UserRoles Grid
        /// is clicked
        /// </summary>
        /// <history>
        /// 	[cnurse]	9/10/2004	Updated to reflect design changes for Help, 508 support
        ///                       and localisation
        /// </history>
        public void grdUserRoles_Delete( object sender, DataGridCommandEventArgs e )
        {
            try
            {
                RoleController objUser = new RoleController();
                string strMessage = "";

                if( _roleId != - 1 )
                {
                    if( objUser.DeleteUserRole( PortalId, int.Parse( Convert.ToString( grdUserRoles.DataKeys[e.Item.ItemIndex] ) ), _roleId ) == false )
                    {
                        strMessage = Localization.GetString( "RoleRemoveError", this.LocalResourceFile );
                    }
                    else
                    {
                        if( chkNotify.Checked )
                        {
                            SendNotification( int.Parse( Convert.ToString( grdUserRoles.DataKeys[e.Item.ItemIndex] ) ), _roleId, "remove" );
                        }
                    }
                }
                if( _userId != - 1 )
                {
                    if( objUser.DeleteUserRole( PortalId, _userId, int.Parse( Convert.ToString( grdUserRoles.DataKeys[e.Item.ItemIndex] ) ) ) == false )
                    {
                        strMessage = Localization.GetString( "RoleRemoveError", this.LocalResourceFile );
                    }
                    else
                    {
                        if( chkNotify.Checked )
                        {
                            SendNotification( _userId, int.Parse( Convert.ToString( grdUserRoles.DataKeys[e.Item.ItemIndex] ) ), "remove" );
                        }
                    }
                }

                grdUserRoles.EditItemIndex = - 1;
                BindGrid();

                if( !String.IsNullOrEmpty(strMessage) )
                {
                    UI.Skins.Skin.AddModuleMessage( this, strMessage, ModuleMessageType.RedError );
                }
            }
            catch( Exception exc ) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException( this, exc );
            }
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:57,代码来源:SecurityRoles.ascx.cs

示例2: RejectMember

        public ActionResult RejectMember(int notificationId)
        {
            try
            {
                var recipient = InternalMessagingController.Instance.GetMessageRecipient(notificationId, UserInfo.UserID);
                if (recipient == null) return Json(new { Result = "error" });

                var notification = NotificationsController.Instance.GetNotification(notificationId);
                ParseKey(notification.Context);
                if (MemberId <= 0) return Json(new { Result = "error" });

                if (roleInfo == null) return Json(new { Result = "error" });

                var member = UserController.GetUserById(PortalSettings.PortalId, MemberId);



                if (member != null)
                {
                    var roleController = new RoleController();
                    roleController.DeleteUserRole(PortalSettings.PortalId, MemberId, roleInfo.RoleID);
                    var notifications = new Notifications();
                    var groupOwner = UserController.GetUserById(PortalSettings.PortalId, roleInfo.CreatedByUserID);
                    notifications.AddMemberNotification(Constants.MemberRejectedNotification, TabId, ModuleId, roleInfo, groupOwner, member);
                    NotificationsController.Instance.DeleteAllNotificationRecipients(notificationId);

                    return Json(new { Result = "success" });
                }
            } catch (Exception exc)
            {
                DnnLog.Error(exc);
            }

            return Json(new { Result = "error" });
        }
开发者ID:biganth,项目名称:Curt,代码行数:35,代码来源:GroupServices.cs


注:本文中的DotNetNuke.Security.Roles.RoleController.DeleteUserRole方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。