Esempio n. 1
0
  public ArrayList<String> altaEvento(Evento evento, String username) {

    ArrayList<String> altaEvento = new ArrayList<String>();
    try {

      if (EventoDAO.guardarEvento(evento)) {

        Usuario u = UsuarioDAO.getUsuario(username);
        EventoDAO.asignarUsuario(u, evento);
        UsuarioDAO.asignarEvento(u, evento);
        return altaEvento;
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
    return null;
  }
Esempio n. 2
0
  public ArrayList<String> altaNoticia(Noticia noticia, String username) {

    try {

      if (NoticiaDAO.guardarNoticia(noticia)) {
        Usuario u = UsuarioDAO.getUsuario(username);
        NoticiaDAO.asignarUsuario(u, noticia);
        noticia.setEvento(u.getEvento());
        ;
        UsuarioDAO.asignarNoticia(u, noticia);
      }
    } catch (Exception e) {
      e.printStackTrace();
    }

    return null;
  }