Subversion Repositories SmartDukaan

Rev

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

Rev 2252 Rev 2359
Line 49... Line 49...
49
        initHeader();
49
        initHeader();
50
        initItemList();
50
        initItemList();
51
    }
51
    }
52
    
52
    
53
    private void initItemList() {
53
    private void initItemList() {
54
        loadBestSellers();
54
        loadAllRiskyItems();
55
        
55
        
56
        //loadDummyItems();
56
        //loadDummyItems();
57
        //updateItemDescriptionTable(items);
57
        //updateItemDescriptionTable(items);
58
    }
58
    }
59
    
59
    
Line 132... Line 132...
132
    }
132
    }
133
    
133
    
134
    private void loadDummyItems() {
134
    private void loadDummyItems() {
135
        
135
        
136
        Item i = new Item(1, "Handset", "Spice", "mi310", "phone", "White", "Business Phone",1, "comments", 1, 1, 
136
        Item i = new Item(1, "Handset", "Spice", "mi310", "phone", "White", "Business Phone",1, "comments", 1, 1, 
137
                "", 3000.50, 3000.00, 3000, 3000, 12, 12345, 12345, 12345, 12345, "status", 1,  null, "best", 2990, 1, true, true, null, null, null);
137
                "", 3000.50, 3000.00, 3000, 3000, 12, 12345, 12345, 12345, 12345, "ACTIVE", 1, "This item is active",
-
 
138
                null, "best", 2990, 1, true, true, null, null, null);
138
        List<Item> items = new ArrayList<Item>();
139
        List<Item> items = new ArrayList<Item>();
139
        items.add(i);
140
        items.add(i);
140
        this.items = items;
141
        this.items = items;
141
        //itemsMap.put(i.getId(), i);
142
        //itemsMap.put(i.getId(), i);
142
        
143
        
Line 148... Line 149...
148
                caught.printStackTrace();
149
                caught.printStackTrace();
149
                Window.alert("Could not get all items...");
150
                Window.alert("Could not get all items...");
150
            }
151
            }
151
            public void onSuccess(List<Item> result) {
152
            public void onSuccess(List<Item> result) {
152
                updateItemDescriptionTable(result);
153
                updateItemDescriptionTable(result);
153
                //setItems(result);
-
 
154
            }
154
            }
155
        });
155
        });
156
    }
156
    }
157
    
157
    
158
    public void loadAllActiveItems() {
158
    public void loadAllActiveItems() {
Line 161... Line 161...
161
                caught.printStackTrace();
161
                caught.printStackTrace();
162
                Window.alert("Could not get all active items...");
162
                Window.alert("Could not get all active items...");
163
            }
163
            }
164
            public void onSuccess(List<Item> result) {
164
            public void onSuccess(List<Item> result) {
165
                updateItemDescriptionTable(result);
165
                updateItemDescriptionTable(result);
166
                //setItems(result);
-
 
167
            }
166
            }
168
        });
167
        });
169
    }
168
    }
170
    
169
    
171
    public void loadAllPhasedOutItems() {
170
    public void loadAllPhasedOutItems() {
Line 190... Line 189...
190
                updateItemDescriptionTable(result);
189
                updateItemDescriptionTable(result);
191
            }
190
            }
192
        });
191
        });
193
    }
192
    }
194
    
193
    
-
 
194
    public void loadAllInProcessItems() {
-
 
195
        catalogService.getAllInProcessItems(new AsyncCallback<List<Item>>() {
-
 
196
            public void onFailure(Throwable caught) {
-
 
197
                caught.printStackTrace();
-
 
198
                Window.alert("Could not load IN_PROCESS items...");
-
 
199
            }
-
 
200
            public void onSuccess(List<Item> result) {
-
 
201
                updateItemDescriptionTable(result);
-
 
202
            }
-
 
203
        });
-
 
204
    }
-
 
205
    
-
 
206
    public void loadAllContentCompleteItems() {
-
 
207
        catalogService.getAllContentCompleteItems(new AsyncCallback<List<Item>>() {
-
 
208
            public void onFailure(Throwable caught) {
-
 
209
                caught.printStackTrace();
-
 
210
                Window.alert("Could not load CONTENT_COMPLETE items...");
-
 
211
            }
-
 
212
            public void onSuccess(List<Item> result) {
-
 
213
                updateItemDescriptionTable(result);
-
 
214
            }
-
 
215
        });
-
 
216
    }
-
 
217
    
-
 
218
    public void loadAllRiskyItems() {
-
 
219
        catalogService.getRiskyItems(new AsyncCallback<List<Item>>() {
-
 
220
            public void onFailure(Throwable caught) {
-
 
221
                caught.printStackTrace();
-
 
222
                Window.alert("Could not load RISKY items...");
-
 
223
            }
-
 
224
            public void onSuccess(List<Item> result) {
-
 
225
                updateItemDescriptionTable(result);
-
 
226
            }
-
 
227
        });
-
 
228
    }
-
 
229
    
195
    public void loadBestDeals() {
230
    public void loadBestDeals() {
196
        catalogService.getBestDeals(new AsyncCallback<List<Item>>() {
231
        catalogService.getBestDeals(new AsyncCallback<List<Item>>() {
197
            public void onFailure(Throwable caught) {
232
            public void onFailure(Throwable caught) {
198
                caught.printStackTrace();
233
                caught.printStackTrace();
199
                Window.alert("Could not load best deals.");
234
                Window.alert("Could not load best deals.");
200
            }
235
            }
201
            public void onSuccess(List<Item> result) {
236
            public void onSuccess(List<Item> result) {
202
                updateItemDescriptionTable(result);
237
                updateItemDescriptionTable(result);
203
                //setItems(result);
-
 
204
            }
238
            }
205
        });
239
        });
206
    }
240
    }
207
    
241
    
208
    public void loadLatestArrivals() {
242
    public void loadLatestArrivals() {
Line 211... Line 245...
211
                caught.printStackTrace();
245
                caught.printStackTrace();
212
                Window.alert("Could not load latest arrivals.");
246
                Window.alert("Could not load latest arrivals.");
213
            }
247
            }
214
            public void onSuccess(List<Item> result) {
248
            public void onSuccess(List<Item> result) {
215
                updateItemDescriptionTable(result);
249
                updateItemDescriptionTable(result);
216
                //setItems(result);
-
 
217
            }
250
            }
218
        });
251
        });
219
    }
252
    }
220
    
253
    
221
    public void loadBestSellers() {
254
    public void loadBestSellers() {
Line 224... Line 257...
224
                caught.printStackTrace();
257
                caught.printStackTrace();
225
                Window.alert("Could not load best sellers.");
258
                Window.alert("Could not load best sellers.");
226
            }
259
            }
227
            public void onSuccess(List<Item> result) {
260
            public void onSuccess(List<Item> result) {
228
                updateItemDescriptionTable(result);
261
                updateItemDescriptionTable(result);
229
                //setItems(result);
-
 
230
            }
262
            }
231
        });
263
        });
232
    }
264
    }
233
 
265
 
234
    public void setItemDetails(ItemDetails itemDetails) {
266
    public void setItemDetails(ItemDetails itemDetails) {