Package com.pre.entity.base

Examples of com.pre.entity.base.Warehouse


    if(options.get(0).equals("create")){
      manageOption("create");
      return;
    }
    if(!ids.isEmpty()){
      final Warehouse warehouse=manager.find(new Long(ids.get(0)));

      nameBox.setText(warehouse.getName());
      groupsCombo.setText(warehouse.getGroup().getName());
      if(warehouse.getReplacingWarehouse() !=null){
        replacingBox.setText(warehouse.getReplacingWarehouse().getName());
      }
      shareableCheck.setChecked(warehouse.getShareable());
      sbox.setText(warehouse.getDescription().getShortDescription());
      dbox.setText(warehouse.getDescription().getLongDescription());
      cmbox.setText(warehouse.getDescription().getComment());
      if(options.get(0).equals("show")){
        nameBox.setDisabled(true);
        groupsCombo.setDisabled(true);
        replacingBox.setDisabled(true);
        shareableCheck.setDisabled(true);
        sbox.setDisabled(true);
        dbox.setDisabled(true);
        cmbox.setDisabled(true);
      }
      if(options.get(0).equals("edit")){
        nameBox.setDisabled(true);

        List<OrganizationGroup> groups=organizationGroupManager.findAll();
        for (OrganizationGroup group : groups) {
          Comboitem item=new Comboitem(group.getName());
          groupsCombo.appendChild(item);
        }
        List<Warehouse> replacements=manager.findAll();
        for (Warehouse replacement : replacements) {
          Comboitem item=new Comboitem(replacement.getName());
          replacingBox.appendChild(item);
        }


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

          public void onEvent(Event event) throws Exception {
            OrganizationGroup comp=organizationGroupManager.findByName(groupsCombo.getText()).get(0);
            if(nameBox.getText().equals("")){
              Messagebox.show("Name is empty!", "Error", Messagebox.YES , null);
              nameBox.focus();
              return;
            }
            warehouse.setGroup(comp);
            if(replacingBox.getText().equals(nameBox.getText())){
              Messagebox.show("Warehouse cannot replace itself!", "Error", Messagebox.YES , null);
              replacingBox.focus();
              return;
            }
            if(!replacingBox.getText().equals("")){
             
              Warehouse replacing=(Warehouse)((List<Warehouse>)manager.findByName(replacingBox.getText())).get(0);
              warehouse.setReplacingWarehouse(replacing);
            }
            warehouse.setShareable(shareableCheck.isChecked());
            warehouse.getDescription().setShortDescription(sbox.getText());
            warehouse.getDescription().setLongDescription(dbox.getText());
View Full Code Here


      replacingBox.appendChild(item);
    }
    Button okButton=new Button("OK");
    okButton.addEventListener("onClick", new EventListener(){
      public void onEvent(Event event) throws Exception {
        Warehouse w =new Warehouse();
        w.setName(nameBox.getText());
        BaseDescription odesc=new BaseDescription();
        w.setDescription(odesc);
        //Find  selected group
        OrganizationGroup comp=organizationGroupManager.findByName(groupsCombo.getText()).get(0);
        if(nameBox.getText().equals("")){
          Messagebox.show("Name is empty!", "Error", Messagebox.YES , null);
          nameBox.focus();
          return;
        }
        w.setGroup(comp);
        if(replacingBox.getText().equals(nameBox.getText())){
          Messagebox.show("Warehouse cannot replace itself!", "Error", Messagebox.YES , null);
          replacingBox.focus();
          return;
        }
        if(!replacingBox.getText().equals("")){
          Warehouse replacing=(Warehouse)((List<Warehouse>)manager.findByName(replacingBox.getText())).get(0);
          w.setReplacingWarehouse(replacing);
        }
        w.getDescription().setShortDescription(sbox.getText());
        w.getDescription().setLongDescription(dbox.getText());
        w.getDescription().setComment(cmbox.getText());
View Full Code Here

        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;
            }
View Full Code Here

        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);
View Full Code Here

      orderLineBPOperationResult = 3;
    }
    orderLine.setItem(findItem(itemCode));
    //TODO LINE numbering rules
    //Check warehouse
    Warehouse  warehouse=order.getCustomer().getWarehouse();
    if(warehouse==null){
      //TODO customer does not have preferred Warehouse
      orderLineBPOperationResult=1;
    }else{
     
View Full Code Here

import com.pre.entity.base.Warehouse;

public class WarehouseRowRenderer implements RowRenderer {

  public void render(Row row, Object data) throws Exception {
    Warehouse c=(Warehouse)data;
    row.appendChild(new Checkbox());
    row.appendChild(new Label(c.getId().toString()));
    row.appendChild(new Label(c.getName()));
    row.appendChild(new Label(c.getGroup().getName()));
    row.appendChild(new Label(c.getDescription().getShortDescription()));
  }
View Full Code Here

TOP

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

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.