Subversion Repositories SmartDukaan

Rev

Rev 7996 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7996 Rev 8008
Line 58... Line 58...
58
    
58
    
59
    private static final int NAME_INDEX = 1;
59
    private static final int NAME_INDEX = 1;
60
    private static final int NUMBER_INDEX = 2;
60
    private static final int NUMBER_INDEX = 2;
61
    private static final int AMOUNT_INDEX = 4;
61
    private static final int AMOUNT_INDEX = 4;
62
    private static final int OPERATOR_INDEX = 5;
62
    private static final int OPERATOR_INDEX = 5;
-
 
63
    private static final int CLIENT_NAME_INDEX = 7;
63
    
64
    
64
    private File rechargefile;
65
    private File rechargefile;
65
    private String rechargefileContentType;
66
    private String rechargefileContentType;
66
    private String rechargefileFileName;
67
    private String rechargefileFileName;
67
    private enum messageType {
68
    private enum messageType {
Line 105... Line 106...
105
        for (Row row : sheet) {
106
        for (Row row : sheet) {
106
            if(row.equals(firstRow))
107
            if(row.equals(firstRow))
107
                continue;
108
                continue;
108
 
109
 
109
            BulkRechargeInfo rechargeInfo = new BulkRechargeInfo();
110
            BulkRechargeInfo rechargeInfo = new BulkRechargeInfo();
-
 
111
            try {
110
            rechargeInfo.setName(row.getCell(NAME_INDEX).getStringCellValue());
112
                String name = row.getCell(NAME_INDEX).getStringCellValue();
-
 
113
                String client = row.getCell(CLIENT_NAME_INDEX).getStringCellValue();
-
 
114
                rechargeInfo.setName(name + " - " + client);
-
 
115
            } catch(Exception e) {
-
 
116
                log.error("Unable to get name or client name", e);
-
 
117
                continue;
-
 
118
            }
-
 
119
            
111
            try {
120
            try {
112
                rechargeInfo.setAmount(Long.parseLong(row.getCell(AMOUNT_INDEX).getStringCellValue()));
121
                rechargeInfo.setAmount(Long.parseLong(row.getCell(AMOUNT_INDEX).getStringCellValue()));
113
            } catch (IllegalStateException e) { 
122
            } catch (IllegalStateException e) { 
114
                rechargeInfo.setAmount((long) row.getCell(AMOUNT_INDEX).getNumericCellValue());
123
                rechargeInfo.setAmount((long) row.getCell(AMOUNT_INDEX).getNumericCellValue());
115
            } catch(NumberFormatException e) {
124
            } catch(NumberFormatException e) {