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