Subversion Repositories SmartDukaan

Rev

Rev 22017 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22017 Rev 22033
Line 54... Line 54...
54
		return userAccount;
54
		return userAccount;
55
	}
55
	}
56
 
56
 
57
	@Override
57
	@Override
58
	public UserCart getUserCart(int userId) throws ProfitMandiBusinessException {
58
	public UserCart getUserCart(int userId) throws ProfitMandiBusinessException {
59
		UserCart uc = new UserCart();
59
			UserCart uc = new UserCart();
60
		List<UserAccounts> userAccounts = this.getUserAccountsForUser(userId);
60
		List<UserAccounts> userAccounts = this.getUserAccountsForUser(userId);
-
 
61
		if(userAccounts.isEmpty()){
-
 
62
			return null;
-
 
63
		}
61
		for (UserAccounts ua : userAccounts) {
64
		for (UserAccounts ua : userAccounts) {
62
			if(ua.getAccount_type().equals(AccountType.cartId)){
65
			if(ua.getAccount_type().equals(AccountType.cartId)){
63
				uc.setCartId(Integer.parseInt(ua.getAccount_key()));
66
				uc.setCartId(Integer.parseInt(ua.getAccount_key()));
64
			} else if(ua.getAccount_type().equals(AccountType.saholic)){
67
			} else if(ua.getAccount_type().equals(AccountType.saholic)){
65
				uc.setUserId(Integer.parseInt(ua.getAccount_key()));
68
				uc.setUserId(Integer.parseInt(ua.getAccount_key()));