Revision 111:3d396521ac37

View differences:

src/com/ib/ibss/enterprise/services/ss103_group/IBSSUserGroupDeleteConfirmServices.java
4 4

  
5 5
import net.penril.ibss.core.hibernate.AdminGroup;
6 6
import net.penril.ibss.core.hibernate.AdminUserProfile;
7
import net.penril.ibss.core.hibernate.IbUser;
7 8

  
8 9
import com.ib.ibss.enterprise.services.IBSSEnterpriseServicesWorkspace;
9 10
import com.ib.ibss.error.exception.IBSSBusinessException;
......
32 33
			}
33 34
			
34 35
			List <AdminUserProfile> groupAdminUsers = getAdminUserProfileDAO().getUsersByGroupID(Long.valueOf (groupID));
35
			
36 36
			if (groupAdminUsers.size() != 0){
37 37
				
38
				throw IBSSErrorHandler.createBusinessException ("admin.group.delete.", "2");
38
				IbUser user;
39
				for(AdminUserProfile profile : groupAdminUsers)
40
				{
41
					user = getUserDAO().getIbUserByUserId(profile.getUserId());
42
					if(user.getUserState() != 6l)//6l = deleted
43
					{
44
						throw IBSSErrorHandler.createBusinessException ("admin.group.delete.", "2");
45
					}
46
				}
39 47
			}
40 48
			
41 49
		} catch (Exception e) {
src/com/ib/ibss/enterprise/services/ss103_group/IBSSUserGroupDeleteResultServices.java
17 17
import net.penril.ibss.audit.log.USER_ACTIVITY_TYTPE;
18 18
import net.penril.ibss.core.hibernate.AdminGroup;
19 19
import net.penril.ibss.core.hibernate.AdminUserProfile;
20
import net.penril.ibss.core.hibernate.IbUser;
20 21

  
21 22
import org.hibernate.exception.ConstraintViolationException;
22 23

  
......
70 71
			{
71 72
				List<AdminUserProfile> m_oUsers = getAdminUserProfileDAO ().getUsersByGroupID (m_oGroup.getGroupId ());
72 73
				
73
//				AdminUserProfile m_oUser;
74
//				
75
//				for(Iterator<AdminUserProfile> it = m_oUsers.iterator ();it.hasNext ();)
76
//				{
77
//					m_oUser = it.next ();
78
//					m_oUser.setGroupId (new Long(0));
79
//					getAdminUserProfileDAO ().updateUser (m_oUser);
80
//				}
81
				
82 74
				if (m_oUsers.size() != 0){
83 75
					
84
					m_sLogReason = "Admin group deletion unsuccessful because the group still has active users";
85
					throw IBSSErrorHandler.createBusinessException ("admin.group.delete.", "2");
76
					IbUser user;
77
					for(AdminUserProfile profile : m_oUsers)
78
					{
79
						user = getUserDAO().getIbUserByUserId(profile.getUserId());
80
						if(user.getUserState() != 6l)//6l = deleted
81
						{
82
							m_sLogReason = "Admin group deletion unsuccessful because the group still has active users";
83
							throw IBSSErrorHandler.createBusinessException ("admin.group.delete.", "2");
84
						}
85
					}
86 86
				}
87 87
				
88 88
				try

Also available in: Unified diff