Ejemplo n.º 1
0
  private void pushDataToProduct() {
    try {
      distributor.setName(txtName.getText());
      distributor.setColumnCount(Integer.valueOf(txtColumnCount.getText()));
      distributor.setColumnId(Integer.valueOf(txtColumnId.getText()));
      distributor.setColumnPrice(Integer.valueOf(txtColumnPrice.getText()));
      distributor.setColumnArtist(Integer.valueOf(txtArtist.getText()));
      distributor.setColumnTrack(Integer.valueOf(txtTrack.getText()));
      distributor.setColumnTrackType(Integer.valueOf(txtType.getText()));
      distributor.setColumnQuantity(Integer.valueOf(txtColumnquantity.getText()));

      Set<DistributorAlias> set = new HashSet<DistributorAlias>();
      set.addAll(model.getList());
      distributor.setAliasSet(set);
    } catch (Exception e) {

    }
  }
Ejemplo n.º 2
0
  private void populateForm() {
    txtName.setText(distributor.getName());
    if (distributor != null && distributor.getId() > 0) {
      lblProductname.setText(distributor.getName());
      txtColumnCount.setText(String.valueOf(distributor.getColumnCount()));
      txtColumnId.setText(String.valueOf(distributor.getColumnId()));
      txtColumnPrice.setText(String.valueOf(distributor.getColumnPrice()));
      txtArtist.setText(String.valueOf(distributor.getColumnArtist()));
      txtTrack.setText(String.valueOf(distributor.getColumnTrack()));
      txtType.setText(String.valueOf(distributor.getColumnTrackType()));
      txtColumnquantity.setText(String.valueOf(distributor.getColumnQuantity()));

      model = new GenericListModel<>(new ArrayList<>(distributor.getAliasSet()));
      aliasList.setModel(model);
      ;

    } else {
      lblProductname.setText("New Distributor");
    }
  }