GnuCashew ~ Web Application compatible with GnuCash sql data files.
GCW
Loading...
Searching...
No Matches
Books.cpp
Go to the documentation of this file.
1#line 2 "src/Dbo/Books/Books.cpp"
2
3#include "../App.h"
4#include "../Glb/Core.h"
5
6#include "Books.h"
7
8const char * GCW::Dbo::Books::s_tableName = "books";
9
10const Wt::WFormModel::Field GCW::Dbo::Books::Field::guid = "guid" ; // text(32) PRIMARY KEY NOT NULL,
11const Wt::WFormModel::Field GCW::Dbo::Books::Field::root_account_guid = "root_account_guid" ; // text(32) NOT NULL,
12const Wt::WFormModel::Field GCW::Dbo::Books::Field::root_template_guid = "root_template_guid" ; // text(32) NOT NULL
13
14auto
16load( const std::string & _guid )-> GCW::Dbo::Books::Item::Ptr
17{
19
20 if( _guid != "" )
21 {
22
23 Wt::Dbo::Transaction t( GCW::app()-> gnucashew_session() );
24
25 try
26 {
27 retVal =
28 GCW::app()-> gnucashew_session().load< GCW::Dbo::Books::Item >( _guid )
29 ;
30 }
31 catch( std::exception & e )
32 {
33 std::cout << __FILE__ << ":" << __LINE__ << " " << e.what() << std::endl;
34 }
35 }
36
37 return retVal;
38
39} // endload( const std::string & _guid )-> GCW::Dbo::Books::Item::Ptr
40
41auto
43byGuid( const std::string & _guid )-> GCW::Dbo::Books::Item::Ptr
44{
45 return GCW::Dbo::Books::load( _guid );
46
47} // endbyGuid( const std::string & _guid )-> GCW::Dbo::Books::Item::Ptr
48
49
const char * Field
const Wt::WFormModel::Field guid
Definition Books.cpp:10
const Wt::WFormModel::Field root_template_guid
Definition Books.cpp:12
const Wt::WFormModel::Field root_account_guid
Definition Books.cpp:11
auto byGuid(const std::string &_guid) -> Item::Ptr
Load Books by Guid.
Definition Books.cpp:43
const char * s_tableName
Definition Books.cpp:8
auto load(const std::string &_guid) -> Item::Ptr
Load Books by Guid.
Definition Books.cpp:16
App * app()
Definition App.cpp:75