Subversion Repositories SmartDukaan

Rev

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

Rev 3362 Rev 3363
Line 522... Line 522...
522
            }
522
            }
523
        } catch(NumberFormatException ex) {
523
        } catch(NumberFormatException ex) {
524
            Window.alert("Invalid best deal value format");
524
            Window.alert("Invalid best deal value format");
525
            return false;
525
            return false;
526
        }
526
        }
-
 
527
        
527
        try {
528
        try {
528
            if(!bestSellingRank.getText().trim().equals("")) {
529
            if(!bestSellingRank.getText().trim().equals("")) {
529
                long bsrValue = Long.parseLong(bestSellingRank.getText().trim());
530
                long bsrValue = Long.parseLong(bestSellingRank.getText().trim());
530
                if(bsrValue < 0) {
531
                if(bsrValue < 0) {
531
                    throw new NumberFormatException("Negative value of Best Selling Rank");
532
                    throw new NumberFormatException("Negative value of Best Selling Rank");
Line 537... Line 538...
537
            return false;
538
            return false;
538
        }
539
        }
539
        newItem.setDefaultForEntity(defaultForEntity.getValue());
540
        newItem.setDefaultForEntity(defaultForEntity.getValue());
540
        newItem.setRisky(risky.getValue());
541
        newItem.setRisky(risky.getValue());
541
        
542
        
-
 
543
        try {
-
 
544
            String expectedDelayText = expectedDelay.getText().trim();
-
 
545
            if(!expectedDelayText.equals("")){
-
 
546
                newItem.setExpectedDelay(Integer.parseInt(expectedDelayText));
-
 
547
            }
-
 
548
        } catch(NumberFormatException nfe) {
-
 
549
            Window.alert("Invalid expected delay");
-
 
550
            return false;
-
 
551
        }
-
 
552
        
-
 
553
        try {
-
 
554
            String preferredWarehouseText = preferredWarehouse.getText().trim();
-
 
555
            if(!preferredWarehouseText.equals("")){
-
 
556
                newItem.setPreferredWarehouse(Long.parseLong(preferredWarehouseText) + "");
-
 
557
            }
-
 
558
        }catch(NumberFormatException nfe){
-
 
559
            Window.alert("Invalid Preferred Warehouse");
-
 
560
            return false;
-
 
561
        }
-
 
562
        
542
        /*Create an instance of VendorPricings for each row in vendor pricing table. Set the vendor prices to the instance.
563
        /*Create an instance of VendorPricings for each row in vendor pricing table. Set the vendor prices to the instance.
543
          Add the instance to map and set the map to the item instance created above.*/
564
          Add the instance to map and set the map to the item instance created above.*/
544
        Map<Long, VendorPricings> vendorPrices = new HashMap<Long, VendorPricings>();
565
        Map<Long, VendorPricings> vendorPrices = new HashMap<Long, VendorPricings>();
545
        VendorPricings v;
566
        VendorPricings v;
546
        for(int row = 0; row < tableVendorPrices.getRowCount(); row++) {
567
        for(int row = 0; row < tableVendorPrices.getRowCount(); row++) {