Subversion Repositories SmartDukaan

Rev

Rev 9676 | Rev 9684 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9676 Rev 9680
Line 93... Line 93...
93
        }
93
        }
94
        return "index";
94
        return "index";
95
    }
95
    }
96
 
96
 
97
    public String create() {
97
    public String create() {
98
        long userId = userinfo.getUserId();
-
 
99
        
-
 
100
        try {
98
        try {
101
            UserClient userServiceClient = new UserClient();
99
            UserClient userServiceClient = new UserClient();
102
            UserContextService.Client userClient = userServiceClient.getClient();
100
            UserContextService.Client userClient = userServiceClient.getClient();
103
            if (cartId == 0){
-
 
104
                cartId = userClient.getUserById(userId).getActiveCartId();
-
 
105
            }
-
 
106
            cartMsg = userClient.addItemToCart(cartId, itemId, 1, -1);
101
            cartMsg = userClient.addItemToCart(cartId, itemId, 1, -1);
107
            if ("".equals(cartMsg)) {
102
            if (!("".equals(cartMsg))) {
108
                return "outofstock";
103
                return "outofstock";
109
            }
104
            }
110
        } catch (TException e) {
105
        } catch (TException e) {
111
            log.error("Unable to create or add to cart because of: ", e);
106
            log.error("Unable to create or add to cart because of: ", e);
112
        } catch (Exception e) {
107
        } catch (Exception e) {