GnuCashew ~ GnuCash Enabled Web
GCW
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 
8 const char * GCW::Dbo::Jobs::s_tableName = "jobs";
9 
10 const Wt::WFormModel::Field GCW::Dbo::Jobs::Field::guid = "guid" ; // text(32) PRIMARY KEY NOT NULL,
11 const Wt::WFormModel::Field GCW::Dbo::Jobs::Field::id = "id" ; // text(2048) NOT NULL,
12 const Wt::WFormModel::Field GCW::Dbo::Jobs::Field::name = "name" ; // text(2048) NOT NULL,
13 const Wt::WFormModel::Field GCW::Dbo::Jobs::Field::reference = "reference" ; // text(2048) NOT NULL,
14 const Wt::WFormModel::Field GCW::Dbo::Jobs::Field::active = "active" ; // integer NOT NULL,
15 const Wt::WFormModel::Field GCW::Dbo::Jobs::Field::owner_type = "owner_type" ; // integer,
16 const Wt::WFormModel::Field GCW::Dbo::Jobs::Field::owner_guid = "owner_guid" ; // text(32),
17 
18 auto
20 load( 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 
45 auto
47 byGuid( 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 
Wt::Dbo::ptr< Item > Ptr
Definition: BaseItem.h:39
Jobs Class.
Definition: Item.h:75
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:67