Subversion Repositories SmartDukaan

Rev

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

Rev 1498 Rev 1514
Line 368... Line 368...
368
	    addressHeaderRow.createCell(3).setCellValue("City");
368
	    addressHeaderRow.createCell(3).setCellValue("City");
369
	    addressHeaderRow.createCell(4).setCellValue("State");
369
	    addressHeaderRow.createCell(4).setCellValue("State");
370
	    addressHeaderRow.createCell(5).setCellValue("Pincode");
370
	    addressHeaderRow.createCell(5).setCellValue("Pincode");
371
	    addressHeaderRow.createCell(6).setCellValue("Phone");
371
	    addressHeaderRow.createCell(6).setCellValue("Phone");
372
 
372
 
-
 
373
		List<Address> user_addresses = user.getAddresses();
-
 
374
		if (user_addresses != null && !user_addresses.isEmpty()) {
373
    	for (Address address : user.getAddresses()) {
375
			for (Address address : user.getAddresses()) {
374
    		if (user.getDefaultAddressId() == address.getId()) {
376
				if (user.getDefaultAddressId() == address.getId()) {
375
    			userContentRow = userSheet.createRow(userSerialNo);
377
					userContentRow = userSheet.createRow(userSerialNo);
376
				userSheet.addMergedRegion(new CellRangeAddress(userSerialNo, userSerialNo, 0, 6));
378
					userSheet.addMergedRegion(new CellRangeAddress(
-
 
379
							userSerialNo, userSerialNo, 0, 6));
-
 
380
					userContentRow.createCell(0)
377
				userContentRow.createCell(0).setCellValue("Primary Address");
381
							.setCellValue("Primary Address");
378
				
382
 
379
				userSerialNo++;
383
					userSerialNo++;
380
				userContentRow = userSheet.createRow(userSerialNo);
384
					userContentRow = userSheet.createRow(userSerialNo);
-
 
385
					userContentRow.createCell(0)
381
				userContentRow.createCell(0).setCellValue(address.getName());
386
							.setCellValue(address.getName());
382
				userContentRow.createCell(1).setCellValue(address.getLine1());
387
					userContentRow.createCell(1).setCellValue(
-
 
388
							address.getLine1());
383
				userContentRow.createCell(2).setCellValue(address.getLine2());
389
					userContentRow.createCell(2).setCellValue(
-
 
390
							address.getLine2());
-
 
391
					userContentRow.createCell(3)
384
				userContentRow.createCell(3).setCellValue(address.getCity());
392
							.setCellValue(address.getCity());
385
				userContentRow.createCell(4).setCellValue(address.getState());
393
					userContentRow.createCell(4).setCellValue(
-
 
394
							address.getState());
386
				userContentRow.createCell(5).setCellValue(address.getPin());
395
					userContentRow.createCell(5).setCellValue(address.getPin());
387
				userContentRow.createCell(6).setCellValue(address.getPhone());
396
					userContentRow.createCell(6).setCellValue(
-
 
397
							address.getPhone());
388
		    	userSerialNo+=3;
398
					userSerialNo += 3;
-
 
399
				}
389
			}
400
			}
390
    	}
-
 
391
    	
401
 
392
    	userContentRow = userSheet.createRow(userSerialNo);
402
			userContentRow = userSheet.createRow(userSerialNo);
393
		userSheet.addMergedRegion(new CellRangeAddress(userSerialNo, userSerialNo, 0, 6));
403
			userSheet.addMergedRegion(new CellRangeAddress(userSerialNo,
-
 
404
					userSerialNo, 0, 6));
394
		userContentRow.createCell(0).setCellValue("Other Addresses");
405
			userContentRow.createCell(0).setCellValue("Other Addresses");
395
		
406
 
396
    	for (Address address : user.getAddresses()) {
407
			for (Address address : user.getAddresses()) {
397
			if (user.getDefaultAddressId() != address.getId()) {
408
				if (user.getDefaultAddressId() != address.getId()) {
398
				
409
 
399
				userSerialNo++;
410
					userSerialNo++;
400
				userContentRow = userSheet.createRow(userSerialNo);
411
					userContentRow = userSheet.createRow(userSerialNo);
-
 
412
					userContentRow.createCell(0)
401
				userContentRow.createCell(0).setCellValue(address.getName());
413
							.setCellValue(address.getName());
402
				userContentRow.createCell(1).setCellValue(address.getLine1());
414
					userContentRow.createCell(1).setCellValue(
-
 
415
							address.getLine1());
403
				userContentRow.createCell(2).setCellValue(address.getLine2());
416
					userContentRow.createCell(2).setCellValue(
-
 
417
							address.getLine2());
-
 
418
					userContentRow.createCell(3)
404
				userContentRow.createCell(3).setCellValue(address.getCity());
419
							.setCellValue(address.getCity());
405
				userContentRow.createCell(4).setCellValue(address.getState());
420
					userContentRow.createCell(4).setCellValue(
-
 
421
							address.getState());
406
				userContentRow.createCell(5).setCellValue(address.getPin());
422
					userContentRow.createCell(5).setCellValue(address.getPin());
407
				userContentRow.createCell(6).setCellValue(address.getPhone());
423
					userContentRow.createCell(6).setCellValue(
-
 
424
							address.getPhone());
-
 
425
				}
408
			}
426
			}
409
    	}
427
		}
410
	}
428
	}
411
	
429
	
412
	public static void main(String[] args){
430
	public static void main(String[] args){
413
		UserOrdersController usc = new UserOrdersController();
431
		UserOrdersController usc = new UserOrdersController();
414
		usc.request = new HttpServletRequest() {
432
		usc.request = new HttpServletRequest() {