Last active
May 23, 2017 04:43
-
-
Save wilcorrea/e289a57b191a3d46c8a72347728ff722 to your computer and use it in GitHub Desktop.
Json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
atualizacao() { | |
//FAÇO O REQUEST PARA PEGAR AS OS | |
this.http.get("127.0.0.1/minhasos.php") | |
.map(res => res.json()).subscribe(dataAtualiza => { | |
if (!dataAtualiza) { | |
alert("ERRO AO ATUALIZAR O SISTEMA"); | |
return; | |
} | |
this.MinhasOS = dataAtualiza['DataOS'] | |
this.MinhasOS.map((data) => { | |
const sql = | |
"INSERT INTO ordermservico (os, cliente, descricao, solicitado, encerramento) " + | |
"VALUES " + | |
"('" + data.os + "','" + data.cliente + "','" + data.descricao + "','" + data.solicitado + "','" + data.encerramento + "')"; | |
return this.database.executeSql(sql, []).then((data) => { | |
console.log("INSERIDO COM SUCESSO: " + JSON.stringify(data)); | |
}, (error) => { | |
console.log("SQL Error: " + sql); | |
}); | |
}) | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment