Subversion Repositories SmartDukaan

Rev

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

Rev 3381 Rev 3449
Line 32... Line 32...
32
    public String index(){
32
    public String index(){
33
        //Get a list of all the open purchase orders
33
        //Get a list of all the open purchase orders
34
        try {
34
        try {
35
            WarehouseClient warehouseClient = new WarehouseClient();
35
            WarehouseClient warehouseClient = new WarehouseClient();
36
            Client client = warehouseClient.getClient();
36
            Client client = warehouseClient.getClient();
37
            purchaseOrders = client.getAllPurchaseOrders(POStatus.INIT);
37
            purchaseOrders = client.getAllPurchaseOrders(POStatus.READY);
38
            purchaseOrders.addAll(client.getAllPurchaseOrders(POStatus.PARTIALLY_FULFILLED));
38
            purchaseOrders.addAll(client.getAllPurchaseOrders(POStatus.PARTIALLY_FULFILLED));
39
        } catch (TTransportException e) {
39
        } catch (TTransportException e) {
40
            e.printStackTrace();
40
            logger.error("Unable to get the list of all purchase orders.", e);
41
        } catch (WarehouseServiceException e) {
41
        } catch (WarehouseServiceException e) {
42
            e.printStackTrace();
42
            logger.error("Error while getting the list of all purchase orders.", e);
43
        } catch (TException e) {
43
        } catch (TException e) {
44
            e.printStackTrace();
44
            logger.error("Error while communicating to the warehouse server.", e);
45
        }
45
        }
46
        
46
        
47
        return "index";
47
        return "index";
48
    }
48
    }
49
    
49
    
Line 53... Line 53...
53
            WarehouseClient warehouseClient = new WarehouseClient();
53
            WarehouseClient warehouseClient = new WarehouseClient();
54
            Client client = warehouseClient.getClient();
54
            Client client = warehouseClient.getClient();
55
            purchaseOrder = client.getPurchaseOrder(Long.parseLong(id));
55
            purchaseOrder = client.getPurchaseOrder(Long.parseLong(id));
56
            purchases = client.getAllPurchases(purchaseOrder.getId(), true);
56
            purchases = client.getAllPurchases(purchaseOrder.getId(), true);
57
        } catch (TTransportException e) {
57
        } catch (TTransportException e) {
58
            e.printStackTrace();
58
            logger.error("Unable to get the list of all purchases.", e);
59
        } catch (WarehouseServiceException e) {
59
        } catch (WarehouseServiceException e) {
60
            e.printStackTrace();
60
            logger.error("Error while getting the list of all purchases.", e);
61
        } catch (TException e) {
61
        } catch (TException e) {
62
            e.printStackTrace();
62
            logger.error("Error while communicating to the warehouse server.", e);
63
        }
63
        }
64
        return "show";
64
        return "show";
65
    }
65
    }
66
    
66
    
67
    public void setId(String id){
67
    public void setId(String id){