Package org.jallinone.variants.client

Examples of org.jallinone.variants.client.ProductVariantsPanel


  }


  private void reloadVariantsPrices(int rowNumber) {
    DetailItemVO vo = (DetailItemVO)frame.getFormPanel().getVOModel().getValueObject();
    final ProductVariantsPanel variantsPricesPanel = frame.getVariantsPricesPanel();
    final PriceVO priceVO = (PriceVO)frame.getPricesGrid().getVOListTableModel().getObjectForRow(rowNumber);

    if(!Boolean.TRUE.equals(vo.getUseVariant1ITM01()) &&
       !Boolean.TRUE.equals(vo.getUseVariant2ITM01()) &&
       !Boolean.TRUE.equals(vo.getUseVariant3ITM01()) &&
       !Boolean.TRUE.equals(vo.getUseVariant4ITM01()) &&
       !Boolean.TRUE.equals(vo.getUseVariant5ITM01()))
      variantsPricesPanel.removeAll();
    else {
      variantsPricesPanel.removeAll();
      variantsPricesPanel.getOtherGridParams().put(ApplicationConsts.ITEM,new ItemPK(vo.getCompanyCodeSys01(),vo.getItemCodeITM01()));
      variantsPricesPanel.getOtherGridParams().put(ApplicationConsts.PRICELIST,priceVO.getPricelistCodeSal01SAL02());
      variantsPricesPanel.initGrid(vo);
      variantsPricesPanel.revalidate();
      variantsPricesPanel.repaint();

      SaveButton saveButton = new SaveButton();
      saveButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          Response res = ClientUtils.getData("updateVariantsPrices",new Object[]{
             variantsPricesPanel.getVariantsMatrixVO(),
             variantsPricesPanel.getCells(),
             priceVO.getPricelistCodeSal01SAL02(),
             priceVO.getStartDateSAL02(),
             priceVO.getEndDateSAL02()
          });
          if (res.isError()) {
            JOptionPane.showMessageDialog(
              ClientUtils.getParentFrame(frame),
              res.getErrorMessage(),
              ClientSettings.getInstance().getResources().getResource("Error while saving"),
              JOptionPane.ERROR_MESSAGE
            );
          }
          else
            JOptionPane.showMessageDialog(
              ClientUtils.getParentFrame(frame),
              ClientSettings.getInstance().getResources().getResource("prices saved"),
              ClientSettings.getInstance().getResources().getResource("Attention"),
              JOptionPane.INFORMATION_MESSAGE
            );

        }
      });
      variantsPricesPanel.getButtonsPanel().add(saveButton);
    }
    variantsPricesPanel.revalidate();
    variantsPricesPanel.repaint();
  }
View Full Code Here


  }


  private void reloadVariantsPrices(int rowNumber) {
    final SupplierPriceVO priceVO = (SupplierPriceVO)panel.getPricesGrid().getVOListTableModel().getObjectForRow(rowNumber);
    final ProductVariantsPanel variantsPricesPanel = panel.getVariantsPricesPanel();

    if(!Boolean.TRUE.equals(priceVO.getUseVariant1ITM01()) &&
       !Boolean.TRUE.equals(priceVO.getUseVariant2ITM01()) &&
       !Boolean.TRUE.equals(priceVO.getUseVariant3ITM01()) &&
       !Boolean.TRUE.equals(priceVO.getUseVariant4ITM01()) &&
       !Boolean.TRUE.equals(priceVO.getUseVariant5ITM01()))
      variantsPricesPanel.removeAll();
    else {
      variantsPricesPanel.removeAll();
      variantsPricesPanel.getOtherGridParams().put(ApplicationConsts.ITEM,new ItemPK(priceVO.getCompanyCodeSys01PUR04(),priceVO.getItemCodeItm01PUR04()));
      variantsPricesPanel.getOtherGridParams().put(ApplicationConsts.PRICELIST,priceVO.getPricelistCodePur03PUR04());
      variantsPricesPanel.getOtherGridParams().put(ApplicationConsts.PROGRESSIVE_REG04,priceVO.getProgressiveReg04PUR04());
      variantsPricesPanel.initGrid(priceVO);
      variantsPricesPanel.revalidate();
      variantsPricesPanel.repaint();

      SaveButton saveButton = new SaveButton();
      saveButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          Response res = ClientUtils.getData("updateSupplierVariantsPrices",new Object[]{
             variantsPricesPanel.getVariantsMatrixVO(),
             variantsPricesPanel.getCells(),
             priceVO.getPricelistCodePur03PUR04(),
             priceVO.getStartDatePUR04(),
             priceVO.getEndDatePUR04(),
             priceVO.getProgressiveReg04PUR04()
          });
          if (res.isError()) {
            JOptionPane.showMessageDialog(
              ClientUtils.getParentFrame(panel),
              res.getErrorMessage(),
              ClientSettings.getInstance().getResources().getResource("Error while saving"),
              JOptionPane.ERROR_MESSAGE
            );
          }
          else
            JOptionPane.showMessageDialog(
              ClientUtils.getParentFrame(panel),
              ClientSettings.getInstance().getResources().getResource("prices saved"),
              ClientSettings.getInstance().getResources().getResource("Attention"),
              JOptionPane.INFORMATION_MESSAGE
            );

        }
      });
      variantsPricesPanel.getButtonsPanel().add(saveButton);
    }
    variantsPricesPanel.revalidate();
    variantsPricesPanel.repaint();
  }
View Full Code Here

  }


  private void reloadVariantsPrices(int rowNumber) {
    final PriceVO priceVO = (PriceVO)frame.getPricesGrid().getVOListTableModel().getObjectForRow(rowNumber);
    final ProductVariantsPanel variantsPricesPanel = frame.getVariantsPricesPanel();

    if(!Boolean.TRUE.equals(priceVO.getUseVariant1ITM01()) &&
       !Boolean.TRUE.equals(priceVO.getUseVariant2ITM01()) &&
       !Boolean.TRUE.equals(priceVO.getUseVariant3ITM01()) &&
       !Boolean.TRUE.equals(priceVO.getUseVariant4ITM01()) &&
       !Boolean.TRUE.equals(priceVO.getUseVariant5ITM01()))
      variantsPricesPanel.removeAll();
    else {
      variantsPricesPanel.removeAll();
      variantsPricesPanel.getOtherGridParams().put(ApplicationConsts.ITEM,new ItemPK(priceVO.getCompanyCodeSys01SAL02(),priceVO.getItemCodeItm01SAL02()));
      variantsPricesPanel.getOtherGridParams().put(ApplicationConsts.PRICELIST,priceVO.getPricelistCodeSal01SAL02());
      variantsPricesPanel.initGrid(priceVO);
      variantsPricesPanel.revalidate();
      variantsPricesPanel.repaint();

      SaveButton saveButton = new SaveButton();
      saveButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          Response res = ClientUtils.getData("updateVariantsPrices",new Object[]{
             variantsPricesPanel.getVariantsMatrixVO(),
             variantsPricesPanel.getCells(),
             priceVO.getPricelistCodeSal01SAL02(),
             priceVO.getStartDateSAL02(),
             priceVO.getEndDateSAL02()
          });
          if (res.isError()) {
            JOptionPane.showMessageDialog(
              ClientUtils.getParentFrame(frame),
              res.getErrorMessage(),
              ClientSettings.getInstance().getResources().getResource("Error while saving"),
              JOptionPane.ERROR_MESSAGE
            );
          }
          else
            JOptionPane.showMessageDialog(
              ClientUtils.getParentFrame(frame),
              ClientSettings.getInstance().getResources().getResource("prices saved"),
              ClientSettings.getInstance().getResources().getResource("Attention"),
              JOptionPane.INFORMATION_MESSAGE
            );

        }
      });
      variantsPricesPanel.getButtonsPanel().add(saveButton);
    }
    variantsPricesPanel.revalidate();
    variantsPricesPanel.repaint();
  }
View Full Code Here

TOP

Related Classes of org.jallinone.variants.client.ProductVariantsPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.