Subversion Repositories SmartDukaan

Rev

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

Rev 2427 Rev 2489
Line 235... Line 235...
235
                double mrpValue = Double.parseDouble(mrp.getText().trim());
235
                double mrpValue = Double.parseDouble(mrp.getText().trim());
236
                if(mrpValue <= 0) {
236
                if(mrpValue <= 0) {
237
                    throw new NumberFormatException("Negative value of MRP");
237
                    throw new NumberFormatException("Negative value of MRP");
238
                }
238
                }
239
                item.setMrp(mrpValue);
239
                item.setMrp(mrpValue);
240
            } else {
-
 
241
                item.setMrp(-1);
-
 
242
            }
240
            }
243
        } catch(NumberFormatException ex) {
241
        } catch(NumberFormatException ex) {
244
            Window.alert("Invalid MRP format/value. Value shoule be greater than zero");
242
            Window.alert("Invalid MRP format/value. Value shoule be greater than zero");
245
            return;
243
            return;
246
        }
244
        }
Line 249... Line 247...
249
                double spValue = Double.parseDouble(sellingPrice.getText().trim());
247
                double spValue = Double.parseDouble(sellingPrice.getText().trim());
250
                if(spValue <= 0) {
248
                if(spValue <= 0) {
251
                    throw new NumberFormatException("Negative value of Selling price");
249
                    throw new NumberFormatException("Negative value of Selling price");
252
                }
250
                }
253
                item.setSellingPrice(spValue);
251
                item.setSellingPrice(spValue);
254
            } else {
-
 
255
                item.setSellingPrice(-1);
-
 
256
            }
252
            }
257
        } catch(NumberFormatException ex) {
253
        } catch(NumberFormatException ex) {
258
            Window.alert("Invalid Selling Price format/value. Value shoule be greater than zero");
254
            Window.alert("Invalid Selling Price format/value. Value shoule be greater than zero");
259
            return;
255
            return;
260
        }
256
        }
Line 263... Line 259...
263
                double wtValue = Double.parseDouble(weight.getText().trim());
259
                double wtValue = Double.parseDouble(weight.getText().trim());
264
                if(wtValue <= 0) {
260
                if(wtValue <= 0) {
265
                    throw new NumberFormatException("Negative value of Weight");
261
                    throw new NumberFormatException("Negative value of Weight");
266
                }
262
                }
267
                item.setWeight(wtValue);
263
                item.setWeight(wtValue);
268
            } else {
-
 
269
                item.setWeight(-1);
-
 
270
            }
264
            }
271
        } catch(NumberFormatException ex) {
265
        } catch(NumberFormatException ex) {
272
            Window.alert("Invalid weight format/value. Value shoule be greater than zero");
266
            Window.alert("Invalid weight format/value. Value shoule be greater than zero");
273
            return;
267
            return;
274
        }
268
        }
Line 286... Line 280...
286
                double bdValue = Double.parseDouble(bestDealValue.getText().trim());
280
                double bdValue = Double.parseDouble(bestDealValue.getText().trim());
287
                if(bdValue < 0) {
281
                if(bdValue < 0) {
288
                    throw new NumberFormatException("Negative value of BestDealValue");
282
                    throw new NumberFormatException("Negative value of BestDealValue");
289
                }
283
                }
290
                item.setBestDealsValue(bdValue);
284
                item.setBestDealsValue(bdValue);
291
            } else {
-
 
292
                item.setBestDealsValue(-1);
-
 
293
            }
285
            }
294
        } catch(NumberFormatException ex) {
286
        } catch(NumberFormatException ex) {
295
            Window.alert("Invalid best deal value format");
287
            Window.alert("Invalid best deal value format");
296
            return;
288
            return;
297
        }
289
        }
Line 300... Line 292...
300
                long bsrValue = Long.parseLong(bestSellingRank.getText().trim());
292
                long bsrValue = Long.parseLong(bestSellingRank.getText().trim());
301
                if(bsrValue < 0) {
293
                if(bsrValue < 0) {
302
                    throw new NumberFormatException("Negative value of Best Selling Rank");
294
                    throw new NumberFormatException("Negative value of Best Selling Rank");
303
                }
295
                }
304
                item.setBestSellingRank(bsrValue);
296
                item.setBestSellingRank(bsrValue);
305
            } else {
-
 
306
                item.setBestSellingRank(-1);
-
 
307
            }
297
            }
308
            
-
 
309
        } catch(NumberFormatException ex) {
298
        } catch(NumberFormatException ex) {
310
            Window.alert("Invalid best selling rank format");
299
            Window.alert("Invalid best selling rank format");
311
            return;
300
            return;
312
        }
301
        }
313
        item.setDefaultForEntity(defaultForEntity.getValue());
302
        item.setDefaultForEntity(defaultForEntity.getValue());