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


C# SiteUser.DeleteUser方法代码示例

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


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

示例1: DeleteUser

        public override bool DeleteUser(string userName, bool deleteAllRelatedData)
        {
            /*
             * 	Takes, as input, a user name and deletes that user from the membership data source. DeleteUser returns
             * true if the user was successfully deleted. Otherwise, it returns false. DeleteUser takes a third parameter-a Boolean
             * named deleteAllRelatedData-that specifies whether related data for that user should be deleted also.
             * If deleteAllRelatedData is true, DeleteUser should delete role data, profile data, and all other data associated
             * with that user.
             */
            bool result = false;
            SiteSettings siteSettings = GetSiteSettings();
            // we are ignoring deleteAllRelatedData
            // on purpose because whether to really delete or just flag as deleted
            // is determined by the siteSettings.ReallyDeleteUsers setting

            if ((userName != null) && (siteSettings != null))
            {
                SiteUser siteUser = new SiteUser(siteSettings, userName);
                if (siteUser.UserId > -1)
                {
                    result = siteUser.DeleteUser();

                }
            }

            return result;
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:27,代码来源:mojoMembershipProvider.cs


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