Ejemplo n.º 1
0
 public String create() {
   try {
     current
         .getProjectPK()
         .setClientDepartmentNumber(current.getClient().getClientPK().getClientDepartmentNumber());
     current.getProjectPK().setClientName(current.getClient().getClientPK().getClientName());
     getFacade().create(current);
     JsfUtil.addSuccessMessage(
         ResourceBundle.getBundle("/resources/Bundle").getString("ProjectCreated"));
     return prepareCreate();
   } catch (Exception e) {
     JsfUtil.addErrorMessage(
         e, ResourceBundle.getBundle("/resources/Bundle").getString("PersistenceErrorOccured"));
     return null;
   }
 }
Ejemplo n.º 2
0
 public Project getSelected() {
   if (current == null) {
     current = new Project();
     current.setProjectPK(new jpa.entities.ProjectPK());
     selectedItemIndex = -1;
   }
   return current;
 }
Ejemplo n.º 3
0
 @Override
 public String getAsString(FacesContext facesContext, UIComponent component, Object object) {
   if (object == null) {
     return null;
   }
   if (object instanceof Project) {
     Project o = (Project) object;
     return getStringKey(o.getProjectPK());
   } else {
     throw new IllegalArgumentException(
         "object "
             + object
             + " is of type "
             + object.getClass().getName()
             + "; expected type: "
             + Project.class.getName());
   }
 }
Ejemplo n.º 4
0
 public String prepareCreate() {
   current = new Project();
   current.setProjectPK(new jpa.entities.ProjectPK());
   selectedItemIndex = -1;
   return "Create";
 }