class SqlCtrls : public IdCtrls
This class extends IdCtrls class with SQL related operations.
SqlCtrls& operator()(SqlId id, Ctrl& ctrl)
Calls IdCtrls::Add(id, ctrl).
void Table(Ctrl& dlg, SqlId table)
Adds such widgets of dlg whose layout id (that is the same as the id of theirs member variable) matches any column name in table, based on database schema file (.sch). Widgets are added with uppercased layout id. Label and Button widget are excluded (tested using dynamic_cast)
SqlCtrls& operator()(Ctrl& dlg, SqlId table)
Same as Table(dlg, table).
SqlSet Set() const
Returns SqlSet of all ids of SqlCtrls.
operator SqlSet() const
Same as Set().
void Read(Sql& sql)
Assigns values of sql (which is supposed to contain some fetched line from SQL database) into widgets, based on match of widget ids and column names.
bool Fetch(Sql& sql)
Does sql.Fetch(). If that is false, returns false, otherwise performs Read(sql) and returns true. In other words, fetches the line from SQL database and assigns corresponding values to SqlCtrls widgets.
bool Load(Sql& sql, SqlSelect select)
Executes select statement on sql and then calls Fetch(sql) and returns its return value.
bool Load(Sql& sql, SqlId table, SqlBool where)
Similar to Load, but select statement is constructed based on ids of widgets, given table and where expression.
bool Fetch()
Same as Fetch(SQL).
bool Load(SqlSelect select)
Same as Load(SQL, select).
bool Load(SqlId table, SqlBool set)
Same as Load(SQL, table, set).
void Insert(SqlInsert& insert) const
Adds all id - widget value pairs to insert.
void Update(SqlUpdate& update) const
Adds all id - widget value pairs to update.
void UpdateModified(SqlUpdate& update) const
Adds all id - widget value pairs, where widgets have 'modified' flag set, to update .
SqlInsert Insert(SqlId table) const
Constructs SqlInsert statement into table which contains all id - widget value pairs as inserted values.
SqlUpdate Update(SqlId table) const
Constructs SqlUpdate statement of table which contains all id - widget value pairs as updated values.
SqlUpdate UpdateModified(SqlId table) const
Constructs SqlUpdate statement of table which contains all id - widget value pairs, where widgets have 'modified' flag set, as updated values.
SqlId operator()(int i) const
SqlId GetKey(int i) const
Returns id of entry i.
|