public DeleteUserResults DeleteUser(int departmentId, string authroizingUserId, string userIdToDelete) { if (!_authorizationService.CanUserDeleteUser(departmentId, authroizingUserId, userIdToDelete)) { return(DeleteUserResults.UnAuthroized); } var department = _departmentsService.GetDepartmentByUserId(userIdToDelete); if (department.ManagingUserId == userIdToDelete) { return(DeleteUserResults.UserIsManagingDepartmentAdmin); } var member = _departmentsService.GetDepartmentMember(userIdToDelete, departmentId); member.IsDeleted = true; _departmentsService.SaveDepartmentMember(member); //_certificationService.DeleteAllCertificationsForUser(userIdToDelete); //_distributionListsService.RemoveUserFromAllLists(userIdToDelete); //_personnelRolesService.RemoveUserFromAllRoles(userIdToDelete); //_userStateService.DeleteStatesForUser(userIdToDelete); //_workLogsService.ClearInvestigationByLogsForUser(userIdToDelete); //_workLogsService.DeleteLogsForUser(userIdToDelete, department.ManagingUserId); //_messageService.DeleteMessagesForUser(userIdToDelete); ////_userProfileService.DeletProfileForUser(userIdToDelete); //_pushUriService.DeletePushUrisForUser(userIdToDelete); //_actionLogsService.DeleteActionLogsForUser(userIdToDelete); //_callsService.DeleteDispatchesForUserAndRemapCalls(department.ManagingUserId, userIdToDelete); //_departmentGroupsService.DeleteUserFromGroups(userIdToDelete); //_usersService.DeleteUser(userIdToDelete); return(DeleteUserResults.NoFailure); }