2 #include <Wtx/Dbo/QueryModel.h> 3 #include <Wtx/Core/Core.h> 8 Wtx::Sys::User::Item::Ptr Wtx::Sys::User::load(
int userid,
Wtx::Dbo::Session & session )
10 Wtx::Sys::User::Item::Ptr retVal;
12 Wt::Dbo::Transaction t(session);
21 Wtx::Sys::User::Item::Ptr Wtx::Sys::User::find(
const std::string & keyField,
Wtx::Dbo::Session & session )
23 Wtx::Sys::User::Item::Ptr retVal;
25 Wt::Dbo::Transaction t(session);
28 .where(
"UPPER(\"keyField\") = UPPER(?)")
37 Wtx::Sys::User::Item::Ptr Wtx::Sys::User::xfind(
const std::string & xid,
Wtx::Dbo::Session & session )
39 Wtx::Sys::User::Item::Ptr retVal;
43 Wt::Dbo::Transaction t(session);
46 .where(
"UPPER(xid) = UPPER(?)")
56 Wtx::Sys::User::Item::Ptr Wtx::Sys::User::add(
const std::string & keyField,
const std::string & cfyField,
Wtx::Dbo::Session & session )
58 Wtx::Sys::User::Item::Ptr retVal;
60 Wt::Dbo::Transaction t(session);
69 std::shared_ptr<Wt::WAbstractItemModel> Wtx::Sys::User::getComboBoxModel(
int tid,
const std::string & group,
Wtx::Dbo::Session & session )
71 auto retVal = std::make_shared< Wtx::Dbo::QueryModel< Wtx::Sys::User::Item::Ptr > >();
73 Wt::Dbo::Transaction t(session);
79 .where(
"\"isActive\" is true AND (UPPER(\"cfyField\") LIKE UPPER(?) OR \"cfyField\" LIKE '%%*%%')")
80 .bind( Wt::WString(
"%%{1}%%").arg(group) )
81 .orderBy(
"\"keyField\"")
84 retVal-> setQuery( query );
95 retVal-> setQuery( query );
98 retVal-> addColumn(
"id");
99 retVal-> addColumn(
"keyField");