Subversion Repositories SmartDukaan

Rev

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

Rev 1981 Rev 2036
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
	
51
	
51
	private String pincode = "110001";
52
	private String pincode = "110001";
52
	
53
	
53
	private String couponCode = null;
54
	private String couponCode = null;
54
	
55
	
Line 104... Line 105...
104
				UserContextServiceClient userServiceClient = new UserContextServiceClient();
105
				UserContextServiceClient userServiceClient = new UserContextServiceClient();
105
				UserContextService.Client userClient = userServiceClient.getClient();
106
				UserContextService.Client userClient = userServiceClient.getClient();
106
				if (cartId == 0){
107
				if (cartId == 0){
107
					cartId = userClient.createCart(userId);
108
					cartId = userClient.createCart(userId);
108
				}
109
				}
-
 
110
				if(cartMsg==null){
-
 
111
				    cartMsg = userClient.addItemToCart(cartId, itemId, 1);
-
 
112
			    }else{
109
				userClient.addItemToCart(cartId, itemId, 1);
113
			        userClient.addItemToCart(cartId, itemId, 1);
-
 
114
			    }
110
				userinfo.setCartId(cartId);
115
				userinfo.setCartId(cartId);
111
				int totalItems = userClient.getCart(cartId).getLinesSize();
116
				int totalItems = userClient.getCart(cartId).getLinesSize();
112
				userinfo.setTotalItems(totalItems);
117
				userinfo.setTotalItems(totalItems);
113
			} catch (TException e) {
118
			} catch (TException e) {
114
				e.printStackTrace();
119
				e.printStackTrace();
Line 311... Line 316...
311
	
316
	
312
	public long getNumberOfItems(){
317
	public long getNumberOfItems(){
313
		return userinfo.getTotalItems();
318
		return userinfo.getTotalItems();
314
	}
319
	}
315
 
320
 
-
 
321
	public String getCartMsg(){
-
 
322
	    return this.cartMsg;
-
 
323
	}
-
 
324
	
316
	@Override
325
	@Override
317
	public void setParameters(Map<String, String[]> parameters) {
326
	public void setParameters(Map<String, String[]> parameters) {
318
		this.reqparams = parameters;	
327
		this.reqparams = parameters;	
319
	}
328
	}
320
}
329
}