Subversion Repositories SmartDukaan

Rev

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

Rev 2036 Rev 2099
Line 45... Line 45...
45
	Map<String, String[]> reqparams = null;
45
	Map<String, String[]> reqparams = null;
46
 
46
 
47
    private double totalamount = 0.0;
47
    private double totalamount = 0.0;
48
	
48
	
49
	private String errorMsg = "";
49
	private String errorMsg = "";
50
	private String cartMsg = null; 
50
	private String cartMsg = ""; 
51
	
51
	
52
	private String pincode = "110001";
52
	private String pincode = "110001";
53
	
53
	
54
	private String couponCode = null;
54
	private String couponCode = null;
55
	
55
	
Line 105... Line 105...
105
				UserContextServiceClient userServiceClient = new UserContextServiceClient();
105
				UserContextServiceClient userServiceClient = new UserContextServiceClient();
106
				UserContextService.Client userClient = userServiceClient.getClient();
106
				UserContextService.Client userClient = userServiceClient.getClient();
107
				if (cartId == 0){
107
				if (cartId == 0){
108
					cartId = userClient.createCart(userId);
108
					cartId = userClient.createCart(userId);
109
				}
109
				}
110
				if(cartMsg==null){
110
				if(cartMsg.equals("")){
111
				    cartMsg = userClient.addItemToCart(cartId, itemId, 1);
111
				    cartMsg = userClient.addItemToCart(cartId, itemId, 1);
112
			    }else{
112
			    }else{
113
			        userClient.addItemToCart(cartId, itemId, 1);
113
			        userClient.addItemToCart(cartId, itemId, 1);
114
			    }
114
			    }
115
				userinfo.setCartId(cartId);
115
				userinfo.setCartId(cartId);
Line 317... Line 317...
317
	public long getNumberOfItems(){
317
	public long getNumberOfItems(){
318
		return userinfo.getTotalItems();
318
		return userinfo.getTotalItems();
319
	}
319
	}
320
 
320
 
321
	public String getCartMsg(){
321
	public String getCartMsg(){
-
 
322
	    if(cartMsg.equals("")){
-
 
323
	        return null;
-
 
324
	    }
322
	    return this.cartMsg;
325
	    return cartMsg;
323
	}
326
	}
324
	
327
	
325
	@Override
328
	@Override
326
	public void setParameters(Map<String, String[]> parameters) {
329
	public void setParameters(Map<String, String[]> parameters) {
327
		this.reqparams = parameters;	
330
		this.reqparams = parameters;