X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fscmwidget.cpp;h=4c531ad756c58e80967cad14d155021d0fbae1c0;hb=83b9c871148f01ee15671b08dc807bd8901c8b22;hp=a04e8947050a424dcc4ba53e844b8ef8187796a3;hpb=c5836ee59baed29944b224faa61904b005affe60;p=schematic diff --git a/src/scmwidget.cpp b/src/scmwidget.cpp index a04e894..4c531ad 100644 --- a/src/scmwidget.cpp +++ b/src/scmwidget.cpp @@ -14,6 +14,7 @@ #include "scmwidget.h" #include #include "addresswidget.h" +#include "alertdialog.h" #include "contactwidget.h" #include "notedialog.h" @@ -250,28 +251,24 @@ void SCMWidget::GetPreviousVendor(void) void SCMWidget::CreateNote(void) { - NoteDialog dlg; - - if (dlg.exec() == true) - { - // Add note to DB for this user - QString note = dlg.note->document()->toPlainText(); + NoteDialog dlg(currentUID); - QSqlQuery query; - query.prepare("INSERT INTO Notes VALUES ('', ?, NULL, ?)"); - query.addBindValue(currentUID); -// query.addBindValue(NULL); - query.addBindValue(note.toAscii()); - query.exec(); + if (dlg.exec() == false) + return; - UpdateNotes(); - } + UpdateNotes(); } void SCMWidget::CreateAlert(void) { + AlertDialog dlg(currentUID); + + if (dlg.exec() == false) + return; + QMessageBox::warning(this, "Approaching Singularity!", "TODO: Implementation"); +// UpdateAlerts(); } @@ -392,10 +389,6 @@ void SCMWidget::UpdateNotes(void) QSqlQuery query; query.prepare("SELECT note FROM Notes WHERE uid = ?"); -// "c.name, email, c.address, phone1, phone2, fax, description, v.vlid FROM " -// "Vendor AS v LEFT OUTER JOIN Location AS l ON v.vid = l.vid " -// "LEFT OUTER JOIN (Contact AS c JOIN ContactType AS ct ON c.ctid = ct.ctid) " -// "ON v.vid = c.vid WHERE v.vid = ?"); query.addBindValue(currentUID); query.exec(); @@ -408,3 +401,9 @@ void SCMWidget::UpdateNotes(void) } } + +void SCMWidget::UpdateAlerts(void) +{ + // TODO: Implementation +} +