Exemple #1
0
        // This calls the accessor method that sets a users status as active or inactive in the database.
        public bool SetUserActiveStatus(bool active, int personID)
        {
            bool result = false;

            try
            {
                if (active)
                {
                    result = 1 == _userAccessor.ActivatePerson(personID);
                }
                else
                {
                    result = 1 == _userAccessor.DeactivatePerson(personID);
                }
                if (result == false)
                {
                    throw new ApplicationException("Person record not updated.");
                }
            }
            catch (Exception ex)
            {
                throw new ApplicationException("Update failed!", ex);
            }
            return(result);
        }