Пример #1
0
        public bool SetUserActiveState(bool active, int employeeID)
        {
            bool result = false;

            try
            {
                if (active)
                {
                    result = 1 == _userAccessor.ActivateEmployee(employeeID);
                }
                else
                {
                    result = 1 == _userAccessor.DeactivateEmployee(employeeID);
                }
                if (result == false)
                {
                    throw new ApplicationException("Employee record not updated.");
                }
            }
            catch (Exception ex)
            {
                throw new ApplicationException("Update failed!", ex);
            }
            return(result);
        }
Пример #2
0
        public bool DeactivateEmployee(Employee employee)
        {
            bool isDeactivated;
            try
            {
                isDeactivated = _userAccessor.DeactivateEmployee(employee.EmployeeId, employee.FirstName, employee.LastName);
            }
            catch (Exception ex )
            {

                throw new ApplicationException("Unable to deactivate Employee: " + employee.EmployeeId, ex);
            }
            return isDeactivated;
        }
Пример #3
0
        public bool SetEmployeeActiveState(bool active, int employeeID)
        {
            bool result = false;

            try
            {
                if (active)
                {
                    result = (1 == _userAccessor.ActivateEmployee(employeeID));
                }
                else
                {
                    result = (1 == _userAccessor.DeactivateEmployee(employeeID));
                }
            }
            catch (Exception ex)
            {
                throw new ApplicationException("Active Status Change Failed", ex);
            }

            return(result);
        }