Home » U++ Library support » U++ SQL » SqlCtrls and IsModified()
Re: SqlCtrls and IsModified() [message #26997 is a reply to message #26988] |
Sat, 19 June 2010 20:01   |
 |
bushman
Messages: 134 Registered: February 2009
|
Experienced Member |
|
|
I guess I see what you mean.
In my app context, however, Iīm using push buttons on the main window to load table rows to a SqlCtrls set, so that users can navigate back and forth along the db table lines and alter them if desired. Thatīs why I must check whether changes occurred when moving from one row to the next and update them if thatīs been the case.
In my app thereīs no master SqlArr for users to pick a line from, for then editting the selected row in a SqlCtrls set in a pop-up dlg. Instead, it goes like,
SqlCtrls ctrls;
Value currendId; // -> pointer to table row key id
...
ctrls
(ID, idedit)
(FIELD1, field1edit)
...
(FIELDN, fieldnedit)
;
...
forwardbutton <<= THISBACK(MoveForward);
...
void MoveForward()
{
if(ctrls.IsModified())
SQL * ctrls.Update(TABLE).Where(ID == currentId);
SQL * Select(SqlMin(ID)).From(TABLE).Where(ID > currentId));
if(SQL.Fetch())
currentId = SQL[0];
ctrls.Load(SQL, TABLE, ID == currentId);
ctrls.ClearModify(); // <-- reset modify flag
}
Thanks!
[Updated on: Sat, 19 June 2010 20:57] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Jul 18 05:39:43 CEST 2025
Total time taken to generate the page: 0.03524 seconds
|