GnuCashew ~ Web Application compatible with GnuCash sql data files.
GCW
Loading...
Searching...
No Matches
Eng
EmployeesModel.cpp
Go to the documentation of this file.
1
#line 2 "src/Eng/CustomersModel.cpp"
2
3
#include "../App.h"
4
#include "
EmployeesModel.h
"
5
6
GCW::Eng::EmployeesModel::
7
EmployeesModel
()
8
:
Wt
::Dbo::QueryModel<
GCW
::Dbo::Employees::Item::Ptr >()
9
{
10
refreshFromDisk
();
11
12
#ifdef NEVER
13
dataChanged
().connect( [=](
Wt::WModelIndex
_index1,
Wt::WModelIndex
_index2 )
14
{
15
// std::cout << __FILE__ << ":" << __LINE__
16
// << " r1:" << _index1.row() << " c1:" << _index1.column()
17
// << " r2:" << _index2.row() << " c2:" << _index2.column()
18
// << std::endl;
19
20
});
21
22
itemChanged().connect( [=](
Wt::WStandardItem
* _item )
23
{
24
// std::cout << __FILE__ << ":" << __LINE__ << " " << Wt::asString( _item-> data() ) << std::endl;
25
26
});
27
#endif
28
29
std::cout << __FILE__ <<
":"
<< __LINE__ <<
" "
<< std::endl;
30
31
}
// endEmployeesModel()
32
33
GCW::Eng::EmployeesModel::
34
EmployeesModel
(
const
std::vector< Wt::WFormModel::Field > & _fields )
35
//: Wt::WStandardItemModel(),
36
:
Wt
::Dbo::QueryModel<
GCW
::Dbo::Employees::Item::Ptr >(),
37
m_fields( _fields )
38
{
39
refreshFromDisk
();
40
41
}
42
43
/*!
44
** \brief Refresh From Disk
45
**
46
*/
47
auto
48
GCW::Eng::EmployeesModel::
49
refreshFromDisk
()->
void
50
{
51
52
if
(
GCW::app
()-> gnucashew_session().isOpen() )
53
{
54
Wt::Dbo::Transaction
t(
GCW::app
()-> gnucashew_session() );
55
56
auto
results =
57
GCW::app
()-> gnucashew_session().find<
GCW::Dbo::Employees::Item
>()
58
;
59
60
setQuery( results );
61
62
std::cout << __FILE__ <<
":"
<< __LINE__ <<
" "
<< rowCount() << std::endl;
63
64
}
// endif( GCW::app()-> gnucashew_session().isOpen() )
65
66
if
( m_fields.size() > 0 )
67
{
68
for
(
auto
field : m_fields )
69
addColumn( field );
70
}
71
72
else
73
{
74
addAllFieldsAsColumns();
75
}
76
77
}
// endrefreshFromDisk()-> void
78
79
80
EmployeesModel.h
GCW::Dbo::Employees::Item
Employee Item Class.
Definition
Dbo/Employees/Item.h:91
GCW::Eng::EmployeesModel::EmployeesModel
EmployeesModel()
Definition
EmployeesModel.cpp:7
GCW::Eng::EmployeesModel::refreshFromDisk
auto refreshFromDisk() -> void
Refresh From Disk.
Definition
EmployeesModel.cpp:49
Wt::Dbo::Transaction
Wt::WAbstractItemModel::dataChanged
virtual Signal< WModelIndex, WModelIndex > & dataChanged()
Wt::WModelIndex
Wt::WStandardItem
GCW
Definition
App.h:18
GCW::app
App * app()
Definition
App.cpp:75
Wt
Generated on Sat Sep 13 2025 08:48:27 for GnuCashew ~ Web Application compatible with GnuCash sql data files. by
1.9.8