Subversion Repositories SmartDukaan

Rev

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

Rev 1275 Rev 1310
Line 703... Line 703...
703
		String htmlString = "";
703
		String htmlString = "";
704
		VelocityContext context = new VelocityContext();
704
		VelocityContext context = new VelocityContext();
705
		String templateFile = "templates/completedorders.vm";
705
		String templateFile = "templates/completedorders.vm";
706
		TransactionServiceClient transactionServiceClient = null;
706
		TransactionServiceClient transactionServiceClient = null;
707
		in.shop2020.model.v1.order.TransactionService.Client orderClient = null;
707
		in.shop2020.model.v1.order.TransactionService.Client orderClient = null;
-
 
708
		
708
		List<Order> orders = null;
709
		List<Order> orders = null;
-
 
710
		List<String> orderDate = new ArrayList<String>();
-
 
711
		
709
		try{
712
		try{
710
			transactionServiceClient = new TransactionServiceClient();
713
			transactionServiceClient = new TransactionServiceClient();
711
			orderClient = transactionServiceClient.getClient();
714
			orderClient = transactionServiceClient.getClient();
712
			orders = orderClient.getOrdersForCustomer(userId, 0, (new Date()).getTime(), OrderStatus.DELIVERY_SUCCESS);
715
			orders = orderClient.getOrdersForCustomer(userId, 0, (new Date()).getTime(), OrderStatus.DELIVERY_SUCCESS);
713
			
716
			
-
 
717
			SimpleDateFormat dateformat = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss aa");
-
 
718
			
-
 
719
			if(orders != null && !orders.isEmpty()){
-
 
720
				for(Order order: orders){
-
 
721
					Date orderedOn = new Date(order.getCreated_timestamp());
-
 
722
					orderDate.add(dateformat.format(orderedOn));
-
 
723
				}
-
 
724
			}
714
		}catch (Exception e){
725
		}catch (Exception e){
715
			
726
			
716
		}
727
		}
717
		context.put("orders", orders);
728
		context.put("orders", orders);
-
 
729
		context.put("orderDate", orderDate);
-
 
730
		
718
		htmlString = getHtmlFromVelocity(templateFile, context);
731
		htmlString = getHtmlFromVelocity(templateFile, context);
719
		return htmlString;
732
		return htmlString;
720
	}
733
	}
721
	public String getMyaccountHeaderHtml() {
734
	public String getMyaccountHeaderHtml() {
722
		String htmlString = "";
735
		String htmlString = "";