Exemple #1
0
  // Insere um alerta existente para um paciente
  public String insereAlertaCombo(String codcli, String cod_alerta, String de, String ate) {
    String sql = "";

    de = "'" + Util.formataDataInvertida(de) + "'";

    if (Util.isNull(ate)) ate = "null";
    else ate = "'" + Util.formataDataInvertida(ate) + "'";

    String nextcod = new Banco().getNext("alerta_paciente", "cod_alerta_paci");

    sql = "INSERT INTO alerta_paciente(cod_alerta_paci, cod_alerta, cod_paci, de, ate) ";
    sql += "VALUES(" + nextcod + "," + cod_alerta + "," + codcli + ",";
    sql += de + "," + ate + ")";

    // Retorno o resultado da execução do script (OK para sucesso)
    return new Banco().executaSQL(sql);
  }
Exemple #2
0
  // Cria um alerta novo e insere para o paciente
  public String insereAlertaNovo(
      String codcli, String alertanovo, String de, String ate, String cod_empresa) {
    String sql = "";

    de = "'" + Util.formataDataInvertida(de) + "'";

    if (Util.isNull(ate)) ate = "null";
    else ate = "'" + Util.formataDataInvertida(ate) + "'";

    String nextcodalerta = new Banco().getNext("alertas", "cod_alerta");

    sql = "INSERT INTO alertas(cod_alerta, cod_empresa, alerta) ";
    sql += "VALUES(" + nextcodalerta + "," + cod_empresa + ",'" + alertanovo + "')";
    new Banco().executaSQL(sql);

    String nextcod = new Banco().getNext("alerta_paciente", "cod_alerta_paci");

    sql = "INSERT INTO alerta_paciente(cod_alerta_paci, cod_alerta, cod_paci, de, ate) ";
    sql += "VALUES(" + nextcod + "," + nextcodalerta + "," + codcli + ",";
    sql += de + "," + ate + ")";

    return new Banco().executaSQL(sql);
  }