# Save

## public String save()

```java
 @Override
    public String save() {
        try {
            Optional<Bodega> optional = bodegaFacade.findById(bodega);
            if (optional.isPresent()) {
                JsfUtil.warningDialog(rf.getAppMessage("info.message"), rf.getAppMessage("warning.idexist"));
                return null;
            }

            //Lo datos del usuario
            bodega.setUserInfo(userInfoServices.generateListUserinfo(loginController.getUsername(), "create"));
            if (bodegaFacade.save(bodega)) {
                JsfUtil.successMessage(rf.getAppMessage("info.save"));
                reset();
            } else {
                JsfUtil.successMessage("save() " + bodegaFacade.getException().toString());
            }

        } catch (Exception e) {
            JsfUtil.errorMessage("save()" + e.getLocalizedMessage());
        }
        return "";
    }
```
