public override int DeleteProfiles(string[] usernames)
        {
            if (usernames == null)
            {
                throw new ArgumentNullException("usernames");
            }

            int count = 0;
            List <global::SoftFluent.Samples.GED.Security.User> users = new List <global::SoftFluent.Samples.GED.Security.User>(usernames.Length);

            foreach (string username in usernames)
            {
                if (username == null)
                {
                    continue;
                }

                global::SoftFluent.Samples.GED.Security.User user = global::SoftFluent.Samples.GED.Security.User.LoadByUserName(username);
                if (user == null)
                {
                    throw new ProviderException(SoftFluent.Samples.GED.Resources.Manager.GetStringWithDefault("UserNotFound", "User '{0}' was not found.", new object[] { username }));
                }

                if (user.Delete())
                {
                    count++;
                }
            }
            return(count);
        }
Esempio n. 2
0
        public override bool DeleteUser(string username, bool deleteAllRelatedData)
        {
            if (username == null)
            {
                throw new ArgumentNullException("username");
            }

            global::SoftFluent.Samples.GED.Security.User user = global::SoftFluent.Samples.GED.Security.User.LoadByUserName(username);
            if (user == null)
            {
                return(false);
            }

            return(user.Delete());
        }