***********************
** FILE NAME : database.h
** SYSTEM NAME :
-** VERSION NUMBER : $Revision: 1.4 $
+** VERSION NUMBER : $Revision: 1.5 $
**
** DESCRIPTION : Classes to provide an abstract layer on the Gnucomo
** database.
********************************
** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
** CREATION DATE : Sep 10, 2002
-** LAST UPDATE : Jan 17, 2003
+** LAST UPDATE : Jan 31, 2003
** MODIFICATIONS :
**************************************************************************/
/*****************************
$Log: database.h,v $
- Revision 1.4 2003-01-18 08:52:18 arjen
+ Revision 1.5 2003-02-05 09:33:17 arjen
+ gnucomo_database::new_notification() retruns the id number of the
+ newly created notification record.
+
+ Revision 1.4 2003/01/18 08:52:18 arjen
New C++ function: gnucomo_database::new_notification()
Revision 1.3 2002/11/09 08:04:27 arjen
*****************************/
-/* static const char *RCSID = "$Id: database.h,v 1.4 2003-01-18 08:52:18 arjen Exp $"; */
+/* static const char *RCSID = "$Id: database.h,v 1.5 2003-02-05 09:33:17 arjen Exp $"; */
#include <libpq++/pgdatabase.h>
#include "gnucomo_config.h"
// Create a new notification.
- void new_notification(String objectid, String issue, String remark);
+ String new_notification(String objectid, String issue, String remark);
};
***********************
** FILE NAME : database.cpp
** SYSTEM NAME : Gnucomo - Gnu Computer Monitoring
-** VERSION NUMBER : $Revision: 1.5 $
+** VERSION NUMBER : $Revision: 1.6 $
**
** DESCRIPTION : Implementation of the gnucomo database classes
**
********************************
** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
** CREATION DATE : Sep 10, 2002
-** LAST UPDATE : Jan 17, 2003
+** LAST UPDATE : Jan 31, 2003
** MODIFICATIONS :
**************************************************************************/
/*****************************
$Log: database.cpp,v $
- Revision 1.5 2003-01-20 07:31:42 arjen
+ Revision 1.6 2003-02-05 09:33:42 arjen
+ gnucomo_database::new_notification() retruns the id number of the
+ newly created notification record.
+
+ Revision 1.5 2003/01/20 07:31:42 arjen
Removed some debug output.
Revision 1.4 2003/01/18 08:52:32 arjen
*****************************/
-static const char *RCSID = "$Id: database.cpp,v 1.5 2003-01-20 07:31:42 arjen Exp $";
+static const char *RCSID = "$Id: database.cpp,v 1.6 2003-02-05 09:33:42 arjen Exp $";
#include <AXE/date.h>
return objectid;
}
-void gnucomo_database::new_notification(String objectid, String issue, String remark)
+/*
+ * Create a new notification with an action_user and return the notification id
+ */
+
+String gnucomo_database::new_notification(String objectid, String issue, String remark)
{
String qry;
UTC now = Now();
String insertion;
- String notif_id;
+ String notif_id("");
String issueid("");
else
{
std::cerr << "Error inserting notification.\n";
- exit(1);
}
}
+
+ return notif_id;
}