Example #1
0
        public static tUser GetUserByID(string userID)
        {
            tUser user = null;

            try
            {
                user = SecurityAdminDataProvider.GetUserByID(userID);
            }
            catch (SqlException ex)
            {
                throw new BusinessApplicationException("Error in busines logic of GetUserByID", ex);
            }
            return(user);
        }
Example #2
0
        public static bool ChangePassword(string userId, string oldPassword, string newPassword)
        {
            var userInDb = GetUserByID(userId);

            if (userId == null)
            {
                throw new ArgumentException("Your provided user id does not exist ", "userId");
            }

            if (!userInDb.Password.Equals(oldPassword, StringComparison.CurrentCulture))
            {
                throw new ArgumentException("Your provided old password does not match ", "oldPassword");
            }


            SecurityAdminDataProvider.ChangePassword(userId, oldPassword, newPassword);

            return(true);
        }
Example #3
0
 public static bool AddUser(tUser userToAdd)
 {
     return(SecurityAdminDataProvider.InsertUser(userToAdd));
 }
Example #4
0
 public static IEnumerable <tUser> GetAll()
 {
     return(SecurityAdminDataProvider.GetAll());
 }