Package com.pre.entity.base

Examples of com.pre.entity.base.Location


    if(options.get(0).equals("create")){
      manageOption("create");
      return;
    }
    if(!ids.isEmpty()){
      final Location location=locationManager.find(new Long(ids.get(0)));

      nameBox.setText(location.getName());
      warehousesCombo.setText(location.getWarehouse().getName());
     
      sbox.setText(location.getDescription().getShortDescription());
      dbox.setText(location.getDescription().getLongDescription());
      cmbox.setText(location.getDescription().getComment());
      if(options.get(0).equals("show")){
        nameBox.setDisabled(true);
        warehousesCombo.setDisabled(true);
        sbox.setDisabled(true);
        dbox.setDisabled(true);
        cmbox.setDisabled(true);
      }
      if(options.get(0).equals("edit")){
        nameBox.setDisabled(true);

       
        List<Warehouse> replacements=manager.findAll();
        for (Warehouse replacement : replacements) {
          Comboitem item=new Comboitem(replacement.getName());
          warehousesCombo.appendChild(item);
        }


        Button okButton=new Button("OK");
        okButton.addEventListener("onClick", new EventListener(){

          public void onEvent(Event event) throws Exception {
            Warehouse comp=manager.findByName(warehousesCombo.getText()).get(0);
            if(nameBox.getText().equals("")){
              Messagebox.show("Name is empty!", "Error", Messagebox.YES , null);
              nameBox.focus();
              return;
            }
            location.setName(nameBox.getText());
            location.setWarehouse(comp);
            location.getDescription().setShortDescription(sbox.getText());
            location.getDescription().setLongDescription(dbox.getText());
            location.getDescription().setComment(cmbox.getText());
            locationManager.update(location);
            detach();           
          }

        });
View Full Code Here


        if(nameBox.getText().equals("")){
          Messagebox.show("Name is empty!", "Error", Messagebox.YES , null);
          nameBox.focus();
          return;
        }
        Location location =new Location();
        location.setName(nameBox.getText());
        //Setup description
        BaseDescription odesc=new BaseDescription();
        location.setDescription(odesc);
        //Find  selected warehouse
        Warehouse comp=manager.findByName(warehousesCombo.getText()).get(0);
        location.setWarehouse(comp);       
        location.getDescription().setShortDescription(sbox.getText());
        location.getDescription().setLongDescription(dbox.getText());
        location.getDescription().setComment(cmbox.getText());
        locationManager.create(location);
        detach();           
      }     
    });
    appendChild(okButton);
View Full Code Here

    LocationManager manager=(LocationManager)WebApplication.lookup(LocationManager.LocalJNDIName);
    List<Location> warehouses=manager.findByWarehouse(warehouseText.getText());
    Iterator<Location> it=warehouses.iterator();
    while(it.hasNext()){
      Row row=new Row();
      Location c=it.next();
      row.appendChild(new Checkbox());
      row.appendChild(new Label(c.getId().toString()));
      row.appendChild(new Label(c.getName()));
      row.appendChild(new Label(c.getWarehouse().getName()));
      row.appendChild(new Label(c.getDescription().getShortDescription()));
     
      gridRows.appendChild(row);
    }
   
  }
View Full Code Here

TOP

Related Classes of com.pre.entity.base.Location

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.