示例#1
0
        /// Creator: Mitchell Paul
        /// Created: 3/10/2021
        /// Approver:
        ///
        /// Manager method to Delete the User Account.
        ///
        /// Right now this is dependent upon if the account is active. Eventually this will depend on roles.
        /// </summary>
        /// <remarks>
        /// Updater:
        /// Updated:
        /// Update:
        /// </remarks>
        public bool DeleteUserAccount(UserAccount userAccount)
        {
            bool result = false;

            if (userAccount.Active == false)
            {
                try
                {
                    result = (1 == _userAccessor.DeleteUserAccount(userAccount.UserAccountID));
                }
                catch (Exception ex)
                {
                    throw new ApplicationException("User Account not deleted. No roles can be assigned.", ex);
                }
            }
            return(result);
        }