Пример #1
0
 public String getPathTableContentPerfilturno(
     HttpServletRequest request, HttpServletResponse response)
     throws IOException, ServletException, TorqueException {
   Criteria c = new Criteria();
   String strPath = "";
   int claveId = -1;
   claveId = WebUtils.getintParam(request, "perfiles.IDPERFIL");
   if (claveId != -1) {
     strPath =
         PerfilesManager.getPerfiles(claveId).getPathPerfilesParsed(request.getQueryString());
   }
   claveId = WebUtils.getintParam(request, "turnos.IDTURNO");
   if (claveId != -1) {
     strPath = TurnosManager.getTurnos(claveId).getPathTurnosParsed(request.getQueryString());
   }
   return "<path>" + strPath + "</path>";
 }
Пример #2
0
 // Función para la eliminación de un registro
 // este método invoca al método public void deletePerfilturno(int idBorrar)
 // definido en el PerfilturnoManager
 public void serviceDeletePerfilturno(HttpServletRequest request, HttpServletResponse response)
     throws IOException, ServletException {
   int idBorrar = -1;
   idBorrar = WebUtils.getintParam(request, "borrarId");
   if (idBorrar != -1)
     if (PerfilturnoManager.borraPerfilturno(idBorrar))
       WebUtils.writeXmlResponse(response, XmlUtils.buildXmlOKResponse("ISO-8859-1"));
     else WebUtils.writeXmlResponse(response, XmlUtils.buildXmlNotOKResponse("ISO-8859-1"));
 }
  public static Trabajador getTrabajador(HttpServletRequest req) throws TorqueException {

    int id_Id = WebUtils.getintParam(req, getIdName(new Trabajador()));

    Trabajador o = new Trabajador();
    if ((id_Id >= 0)) // no es nuevo y lo fijamos en el objeto
    {
      o = TrabajadorManager.getTrabajador(id_Id);
    }
    return o;
  }
Пример #4
0
 public String getPathElementPerfilturno(HttpServletRequest request, HttpServletResponse response)
     throws IOException, ServletException, TorqueException {
   Criteria c = new Criteria();
   String strPath = "";
   int claveId = -1;
   int claveFkId = -1;
   claveId = WebUtils.getintParam(request, "perfilturno.IDTP");
   if (claveId != -1) {
     c.add(PerfilturnoPeer.IDTP, claveId);
     PerfilturnoGroupBean trgb = PerfilturnoManager.getPerfilturnos(c);
     strPath = trgb.getPerfilturno(0).getPathPerfilturnoParsed(request.getQueryString());
   }
   return "<path>" + strPath + "</path>";
 }
Пример #5
0
  private Criteria criteriaPerfilturnoTableContent(HttpServletRequest request, Criteria c)
      throws IOException, ServletException {
    String param = "";
    param = WebUtils.getStringParam(request, new PerfilesHelper().getIdperfilName());
    if (param != null) TorqueUtils.addEqualCriteria(c, PerfilturnoPeer.IDPERFIL, param);
    param = WebUtils.getStringParam(request, new TurnosHelper().getIdturnoName());
    if (param != null) TorqueUtils.addEqualCriteria(c, PerfilturnoPeer.IDTURNO, param);
    String paramSortCol = WebUtils.getStringParam(request, "sort_col");
    String paramSortDir = WebUtils.getStringParam(request, "sort_dir");
    int paramFiltro = WebUtils.getintParam(request, "filtro");
    c = ordenacion(c, paramSortCol, paramSortDir);
    c = filtro(c, paramFiltro);

    return c;
  }
  public static Trabajador createObj(HttpServletRequest req) throws TorqueException {
    Trabajador o = BaseTrabajadorHelper.getTrabajador(req);
    o.setId(WebUtils.getintParam(req, getIdName(o)));

    o.setNumero(WebUtils.getStringParam(req, getNumeroName(o)));

    o.setFechaAlta(WebUtils.getStringParam(req, getFechaAltaName(o)));

    o.setFechaBaja(WebUtils.getStringParam(req, getFechaBajaName(o)));

    o.setObs(WebUtils.getStringParam(req, getObsName(o)));

    o.setNombre(WebUtils.getStringParam(req, getNombreName(o)));

    o.setApellidos(WebUtils.getStringParam(req, getApellidosName(o)));

    o.setApellidosDos(WebUtils.getStringParam(req, getApellidosDosName(o)));

    o.setCif(WebUtils.getStringParam(req, getCifName(o)));

    o.setCosteHora(WebUtils.getdoubleParam(req, getCosteHoraName(o)));

    o.setDireccion(WebUtils.getStringParam(req, getDireccionName(o)));

    o.setLocalidadId(
        Integer.parseInt(
            FormatUtils.getFkIdFromString(WebUtils.getStringParam(req, getLocalidadIdName(o)))));

    o.setCp(WebUtils.getStringParam(req, getCpName(o)));

    o.setTlfno(WebUtils.getStringParam(req, getTlfnoName(o)));

    o.setMovil(WebUtils.getStringParam(req, getMovilName(o)));

    o.setEmail(WebUtils.getStringParam(req, getEmailName(o)));

    o.setCategoriaId(
        Integer.parseInt(
            FormatUtils.getFkIdFromString(WebUtils.getStringParam(req, getCategoriaIdName(o)))));

    return o;
  }
Пример #7
0
  public void servicePerfilturnoTurnos(HttpServletRequest request, HttpServletResponse response)
      throws IOException, TorqueException, ServletException {
    String cadena = null;
    Criteria c = new Criteria();
    int claveId = -1;
    claveId = WebUtils.getintParam(request, "turnos.IDTURNO");
    if (claveId != -1) {
      c.add(TurnosPeer.IDTURNO, claveId);
    }
    c.addAscendingOrderByColumn(TurnosPeer.IDTURNO);
    TurnosGroupBean trgb = TurnosManager.getTurnoss(c);

    if (trgb.getTotalSize() != 0) {
      cadena = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
      cadena =
          cadena
              + "<result><perfilturno.IDTURNO>"
              + trgb.getTurnos(0).getULContentTurnosParsed()
              + "</perfilturno.IDTURNO></result>";
    }

    xmlResponseService(response, new StringBuffer(cadena));
  }
Пример #8
0
  public void servicePerfilturnoElement(HttpServletRequest request, HttpServletResponse response)
      throws IOException, ServletException, TorqueException {
    StringBuffer cadena = null;
    Criteria c = new Criteria();
    int claveId = -1;
    claveId = WebUtils.getintParam(request, "perfilturno.IDTP");
    if (claveId != -1) {
      c.add(PerfilturnoPeer.IDTP, claveId);
    }
    c.addAscendingOrderByColumn(PerfilturnoPeer.IDTP);
    PerfilturnoGroupBean trgb = PerfilturnoManager.getPerfilturnos(c);

    if (trgb.getTotalSize() != 0) {
      String[] parametros = {
        PerfilturnoHelper.IDTP_GET_METHOD_NAME,
        PerfilturnoHelper.IDPERFIL_GET_METHOD_NAME + "PerfilturnoParsed",
        PerfilturnoHelper.IDTURNO_GET_METHOD_NAME + "PerfilturnoParsed",
        PerfilturnoHelper.VALORCOSTE_GET_METHOD_NAME + "PerfilturnoParsed"
      };
      cadena = trgb.buildXml(parametros, null, "ISO-8859-1");
      cadena.insert(cadena.indexOf("</result>"), getPathElementPerfilturno(request, response));
    }
    xmlResponseService(response, cadena);
  }