Subversion Repositories SmartDukaan

Rev

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

Rev 4957 Rev 5118
Line 31... Line 31...
31
    // role column in helper.catalogdashboarduser table. role specifies 
31
    // role column in helper.catalogdashboarduser table. role specifies 
32
    // the username-pwd pair for staging or for production.
32
    // the username-pwd pair for staging or for production.
33
    // production password is needed while updating item on production server.
33
    // production password is needed while updating item on production server.
34
    public static final int ROLE_STAGING = 0, ROLE_PRODUCTION = 1;
34
    public static final int ROLE_STAGING = 0, ROLE_PRODUCTION = 1;
35
    
35
    
36
    private static Map<Long, String> vendors, warehouses, sources;
36
    private static Map<Long, String> vendors, warehouses, sources, shippingWarehouses;
37
    private static List<String> categories, brands;
37
    private static List<String> categories, brands;
38
    
38
    
39
    private static final CatalogServiceAsync catalogService = GWT.create(CatalogService.class);
39
    private static final CatalogServiceAsync catalogService = GWT.create(CatalogService.class);
40
    
40
    
41
    static {
41
    static {
Line 47... Line 47...
47
            @Override
47
            @Override
48
            public void onFailure(Throwable caught) {
48
            public void onFailure(Throwable caught) {
49
                caught.printStackTrace();
49
                caught.printStackTrace();
50
            }
50
            }
51
        });
51
        });
-
 
52
 
-
 
53
        catalogService.getShippingWarehouses(new AsyncCallback<Map<Long,String>>() {
-
 
54
            @Override
-
 
55
            public void onSuccess(Map<Long, String> result) {
-
 
56
                shippingWarehouses = result;
-
 
57
            }
-
 
58
            @Override
-
 
59
            public void onFailure(Throwable caught) {
-
 
60
                caught.printStackTrace();
-
 
61
            }
52
        
62
        });
-
 
63
 
53
        catalogService.getAllWarehouses(new AsyncCallback<Map<Long,String>>() {
64
        catalogService.getAllWarehouses(new AsyncCallback<Map<Long,String>>() {
54
            @Override
65
            @Override
55
            public void onSuccess(Map<Long, String> result) {
66
            public void onSuccess(Map<Long, String> result) {
56
                warehouses = result;
67
                warehouses = result;
57
            }
68
            }
Line 105... Line 116...
105
    }
116
    }
106
    
117
    
107
    public static Map<Long, String> getAllWarehouses() {
118
    public static Map<Long, String> getAllWarehouses() {
108
        return warehouses;
119
        return warehouses;
109
    }
120
    }
-
 
121
 
-
 
122
    public static Map<Long, String> getAllShippingWarehouses() {
-
 
123
        return shippingWarehouses;
-
 
124
    }
110
    
125
    
111
    public static List<String> getAllCategories() {
126
    public static List<String> getAllCategories() {
112
        return categories;
127
        return categories;
113
    }
128
    }
114
    
129
    
Line 134... Line 149...
134
        if(warehouses == null) {
149
        if(warehouses == null) {
135
            return null;
150
            return null;
136
        }
151
        }
137
        return warehouses.get(id);
152
        return warehouses.get(id);
138
    }
153
    }
139
    
154
 
140
    public static String getDisplayableDate(Long millis){
155
    public static String getDisplayableDate(Long millis){
141
        Date date = new Date();
156
        Date date = new Date();
142
        date.setTime(millis);
157
        date.setTime(millis);
143
        String dateString = date.toString();
158
        String dateString = date.toString();
144
        dateString = dateString.substring(0, dateString.lastIndexOf(" "));
159
        dateString = dateString.substring(0, dateString.lastIndexOf(" "));