2017-11-18 12:54:48 +01:00
|
|
|
#include <platform.h>
|
|
|
|
#include "database.h"
|
|
|
|
|
|
|
|
#include <platform.h>
|
|
|
|
|
|
|
|
#include <kernel/config.h>
|
|
|
|
#include <kernel/database.h>
|
|
|
|
#include <kernel/orderdb.h>
|
|
|
|
|
|
|
|
#include <util/log.h>
|
|
|
|
|
2017-11-19 12:31:50 +01:00
|
|
|
#include "db/driver.h"
|
2017-11-18 12:54:48 +01:00
|
|
|
|
2017-11-19 12:31:50 +01:00
|
|
|
order_data *dblib_load_order(int id)
|
2017-11-18 12:54:48 +01:00
|
|
|
{
|
|
|
|
if (id > 0) {
|
2017-11-19 12:31:50 +01:00
|
|
|
return db_driver_order_load(id);
|
2017-11-18 12:54:48 +01:00
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2017-11-19 12:31:50 +01:00
|
|
|
int dblib_save_order(order_data *od)
|
2017-11-18 12:54:48 +01:00
|
|
|
{
|
|
|
|
if (od->_str) {
|
2017-11-19 12:31:50 +01:00
|
|
|
return db_driver_order_save(od);
|
2017-11-18 12:54:48 +01:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-11-19 12:31:50 +01:00
|
|
|
void dblib_open(void)
|
2017-11-18 12:54:48 +01:00
|
|
|
{
|
2017-11-19 12:31:50 +01:00
|
|
|
db_driver_open();
|
2017-11-18 12:54:48 +01:00
|
|
|
}
|
|
|
|
|
2017-11-19 12:31:50 +01:00
|
|
|
void dblib_close(void)
|
2017-11-18 12:54:48 +01:00
|
|
|
{
|
2017-11-19 12:31:50 +01:00
|
|
|
db_driver_close();
|
2017-11-18 12:54:48 +01:00
|
|
|
}
|