|
|
@@ -165,14 +165,14 @@ void class_bdd::updategrid() |
|
|
|
grid->SetCellValue(nligne, 4, _itoW(sqlite3_column_int(stmt, 1))); //n_dossier |
|
|
|
for (int i=2; i<10; i++) //nom, prénom, responsable, consultant, theme, etablissement, travail, date |
|
|
|
{ |
|
|
|
wxString orig = _W(sqlite3_column_text(stmt, i)); |
|
|
|
wxString orig = sqlite3_column_text(stmt, i); |
|
|
|
// corrections |
|
|
|
rc = sqlite3_prepare_v2(db, "SELECT dest FROM Correc WHERE orig=\"" + orig + "\";", -1, &stmt_correc, NULL); |
|
|
|
if (sqlite3_step(stmt_correc) == SQLITE_DONE) |
|
|
|
grid->SetCellValue(nligne, i+3, orig); |
|
|
|
else |
|
|
|
{ |
|
|
|
grid->SetCellValue(nligne, i+3, _W(sqlite3_column_text(stmt_correc, 0))); |
|
|
|
grid->SetCellValue(nligne, i+3, sqlite3_column_text(stmt_correc, 0)); |
|
|
|
//grid->SetCellBackgroundColour(nligne, i+3, *wxYELLOW); |
|
|
|
} |
|
|
|
sqlite3_finalize(stmt_correc); |
|
|
@@ -257,7 +257,7 @@ wxString* class_bdd::getcorrecorig() |
|
|
|
wxString* retour = new wxString[nbcorrections()]; |
|
|
|
sqlite3_prepare_v2(db, "SELECT * FROM Correc;", -1, &stmt, NULL); |
|
|
|
for (int i=0; sqlite3_step(stmt) == SQLITE_ROW; i++) |
|
|
|
retour[i] = _W(sqlite3_column_text(stmt, 0)); |
|
|
|
retour[i] = sqlite3_column_text(stmt, 0); |
|
|
|
sqlite3_finalize(stmt); |
|
|
|
return retour; |
|
|
|
} |
|
|
@@ -267,7 +267,7 @@ wxString* class_bdd::getcorrecdest() |
|
|
|
wxString* retour = new wxString[nbcorrections()]; |
|
|
|
sqlite3_prepare_v2(db, "SELECT * FROM Correc;", -1, &stmt, NULL); |
|
|
|
for (int i=0; sqlite3_step(stmt) == SQLITE_ROW; i++) |
|
|
|
retour[i] = _W(sqlite3_column_text(stmt, 1)); |
|
|
|
retour[i] = sqlite3_column_text(stmt, 1); |
|
|
|
sqlite3_finalize(stmt); |
|
|
|
return retour; |
|
|
|
} |
|
|
@@ -278,7 +278,7 @@ void class_bdd::addcorrection(const wxString& id, int col, const wxString& dest) |
|
|
|
wxString requete = "SELECT * FROM Consult WHERE id=" + id + ";"; |
|
|
|
sqlite3_prepare_v2(db, requete, -1, &stmt, NULL); |
|
|
|
sqlite3_step(stmt); |
|
|
|
wxString orig = _W(sqlite3_column_text(stmt, col-3)); |
|
|
|
wxString orig = sqlite3_column_text(stmt, col-3); |
|
|
|
sqlite3_finalize(stmt); |
|
|
|
modcorrection(orig, dest); |
|
|
|
} |
|
|
@@ -296,7 +296,7 @@ void class_bdd::modcorrection(const wxString& orig, const wxString& dest) |
|
|
|
sqlite3_step(stmt); |
|
|
|
for (int j=5; j<11; j++) |
|
|
|
{ |
|
|
|
wxString table_orig = _W(sqlite3_column_text(stmt, j - 3)); |
|
|
|
wxString table_orig = sqlite3_column_text(stmt, j - 3); |
|
|
|
if (table_orig == orig) |
|
|
|
grid->SetCellValue(i, j, dest); |
|
|
|
} |
|
|
@@ -332,7 +332,7 @@ wxArrayString class_bdd::getidresult(const wxString& id, bool stripped) |
|
|
|
{ |
|
|
|
sqlite3_prepare_v2(db, "SELECT id_result FROM Result WHERE id=" + id + ";", -1, &stmt, NULL); |
|
|
|
sqlite3_step(stmt); |
|
|
|
wxString list = _W(sqlite3_column_text(stmt, 0)); |
|
|
|
wxString list = sqlite3_column_text(stmt, 0); |
|
|
|
sqlite3_finalize(stmt); |
|
|
|
|
|
|
|
wxArrayString out; |
|
|
@@ -352,7 +352,7 @@ void class_bdd::addidresult(const wxString& id, const wxString& idresult) |
|
|
|
{ |
|
|
|
sqlite3_prepare_v2(db, "SELECT id_result FROM Result WHERE id=" + id + ";", -1, &stmt, NULL); |
|
|
|
sqlite3_step(stmt); |
|
|
|
wxString list = _W(sqlite3_column_text(stmt, 0)); |
|
|
|
wxString list = sqlite3_column_text(stmt, 0); |
|
|
|
sqlite3_finalize(stmt); |
|
|
|
if (list.Length() > 0) |
|
|
|
list = idresult + "," + list; |
|
|
@@ -393,12 +393,12 @@ wxArrayString class_bdd::getpubli(wxString id) |
|
|
|
wxArrayString out; |
|
|
|
sqlite3_prepare_v2(db, "SELECT * FROM Publi WHERE id=" + id + ";", -1, &stmt, NULL); |
|
|
|
sqlite3_step(stmt); |
|
|
|
out.Add(_W(sqlite3_column_text(stmt, 1))); |
|
|
|
out.Add(_W(sqlite3_column_text(stmt, 2))); |
|
|
|
out.Add(_W(sqlite3_column_text(stmt, 3))); |
|
|
|
out.Add(_W(sqlite3_column_text(stmt, 4))); |
|
|
|
out.Add(_W(sqlite3_column_text(stmt, 5))); |
|
|
|
out.Add(_W(sqlite3_column_text(stmt, 6))); |
|
|
|
out.Add(wxString::FromUTF8((const char*)sqlite3_column_text(stmt, 1))); |
|
|
|
out.Add(wxString::FromUTF8((const char*)sqlite3_column_text(stmt, 2))); |
|
|
|
out.Add(wxString::FromUTF8((const char*)sqlite3_column_text(stmt, 3))); |
|
|
|
out.Add(wxString::FromUTF8((const char*)sqlite3_column_text(stmt, 4))); |
|
|
|
out.Add(wxString::FromUTF8((const char*)sqlite3_column_text(stmt, 5))); |
|
|
|
out.Add(wxString::FromUTF8((const char*)sqlite3_column_text(stmt, 6))); |
|
|
|
|
|
|
|
return out; |
|
|
|
} |