Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 4 Jahren, 10 Monaten
Letzter Beitrag:
vor 4 Jahren, 10 Monaten
Beteiligte Autoren:
Alexandre Leclerc, Stefano Monterisi, Allard, Fabrice Harari

Help with Windev

Startbeitrag von Stefano Monterisi am 18.06.2013 14:10

Hi,
I'm using Windev 18 for a new project, and I have 25 years of Delphi development.
Now I'm porting an application to Windev, but I have some difficulties on "tranfer" advanced features that are in my Delphi world.
I have written to support several times for easy features that Windev don't have or I don't known how obtain in Windev. One is "cached updates" concept.
If I want to insert a master-detail, there is no a feature that permits me to retain edited records and permits to apply all updates all-in-one when user press "Save" (master records and all operations on details records) or "cancel", involving database operations only in "Save"?
Thanks in advance for help!
(Sorry for my english)
Stefano

Antworten:

Hi Stefano,

Indeed, this is not available as-is in WinDev. But we did it using 3-tiers and OOP programming with databinding.

What we do is that we have an class for every DB file and we have master classes that handle master / detail. The data is loaded as required in memory and at the end we save everything at once in DB in a transaction (or cancel). This will require you some work to start your framework.

The other approach we are looking now is the complete reverse, just like content editing on some websites. We try to figure a way to save on the go. So the user never has to think to save something. It's simply saved. This is a different concept but very good in many cases, especially for users who are not very knowledgeful with computers. "Just save what I'm typing in please... There are no save button on my paper sheet nor cancel button on my pencil." We already have some ideas to implement that efficiently, but has no time to implement it in the framework yet.

Another solution would be to use a memory table that is not connected to the database and then simply loop all the rows and add/update the changes when the user clicks on save. This is more simple to do.

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 18.06.2013 14:42
Hi everybody

TO Stefano:
If I understood correctly, what you want is to save both the "header" and the "lines" of an invoice (by example) at once in the save button...

There is no ready made systme for that, except of course that you can store your data in memory along your input process, either in arrays, classes objetcs, or even inside an empty query or view... So many way to code it, but none automatic.

TO Alexandre:
The concept you are talking about is what I called the SANDBOX system. My previous implementation of it was done this way:
- In every input form (and I'm using form here because it can be a windo or a page), an event would fire each time a field was exited (in some IMPORTANT cases each time it was modified)
- The content of the field would be saved in a standardized way inside my generic parameter file (inside a text memo field with an INI like structure in my case), along of course with all the identifying information (user, form, file, etc...)
- if the user exited the form normally, or cliked on save (in case the UI calls for a save button) then the information would be saved from the sandbox (generic param file) to the real files.
- if the work was interrupted for any reason, the system would of course keep the content of the sandbox, and the next time the user would log in, he would get a proposal to continue working where he was before, and the same form would open with all its content.

Of course, it's perfectly possible this way to have several forms open at the same time, either on the same or different files, and therefore have many sandbox record available at the same time...

Best regards

von Fabrice Harari - am 18.06.2013 14:54
Hi, thank you.
Saving "continuosly" is not the correct way for my scenario. Data must be validated, and, VERY Important, in a multiuser scenario, while input, another user see inconsistent data in summary, calculate, reports, etc....that after user can "delete" as a "cancel" operation...
Interesting is the empty query... Can I load master and details records in queries, update them without writing to db.... and after "commit" ? Any hint on this?
Thanks in advance (Alexander and Fabrice)!
Stefano

von Stefano Monterisi - am 18.06.2013 15:09
Hi Fabrice,

This is a nice implementation. And what you did is really based on the sandboxing principle - you can come back to it later and change many things in many places.

What we did was more a like a cached mechanism similar to transactions, but in memory, before saving to DB.

Thanks for sharing your sandboxing implementation concepts. This gives ideas and others ways to do things.

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 18.06.2013 15:37
Hi Stefano,

You can take a look at these pages:
- http://doc.pcsoft.fr/en-US/?3044234
- http://doc.pcsoft.fr/en-US/?3072023

And in a table control, you can link the source to a query which is modifieable. But this is not an easy task to implement either.

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 18.06.2013 15:50
Hi
Forgive me if I get the question wrong. But why not save master and detail records in the db and use a temporary check. So you save but with an additional field. ( witch states that it is temporary) When the user hits save, the files are modified for that field stating temporary is off.
For other users the master and detail records are ignored if they are in temporary modus. So no consistency problems.
You can even mimic what fabrice states in his sandbox. But way more simple.
Regards

Allard

von Allard - am 25.06.2013 11:13
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.