#include "scmwidget.h"
#include <QtSql>
#include "addresswidget.h"
+#include "alertdialog.h"
#include "contactwidget.h"
#include "notedialog.h"
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();
}
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();
}
}
+
+void SCMWidget::UpdateAlerts(void)
+{
+ // TODO: Implementation
+}
+