Hi
I'm actually working on the remake of an old vb6 application module into C# using Xafml and XPO linked to Oracle 11g DB; it’s for us the ultimate test of whether DevExpress functionalities and extendabilitywill fulfill our needs.
My problem:
There is no way to modify database table’s structure since there are too many VB6 projects depending on the actual schema.Many tables have composite primary keys and these are associated. Since we can’t add a unique primary key to these tables, I have to figure out how to work using these associations with DevExpress.
Here’s a basic example of what we’re facing :
See schema_table.png
Yet, we know we can add a new EMPRUNT to the database using the NEW button; LIVRES and HUMAIN belonging to the same Unit of Work (or session) as the main saving window.
See image1.png
The problem occurs when we are in a HUMAIN window, and try to add an EMPRUNT from that point.
See image2.png and image3.png
When we click on the save button, nothing special happens that let me know a problem occurred.So when I get back to the HUMAIN detail view window, the save button gets activated, and to have the application to be coherent, I should see the new EMPRUNT in the bottom grid, which does not appear at this time.
Since the save button gets enabled, we click on it and this error is triggered:
See image4.png
The same problem occurs in HUMAIN when we go through the LIVRES detail view window.
See image5.png
Yet, I have a partial solution, which consists in removing the NEW EMPRUNT button in the EMPRUNT collection displayed in a LIVRE or HUMAIN detail view and allow the user to add new EMPRUNT using the NewItemRowPosition property so the user does not leave the window and, therefore, does not face a UnitOfWork change (or session).
See image6.png
We also imagined to overload the save button event, but since we cannot see what happens in the base OnSave method, there is no way to change any behavior in it…
At last, you have to understand we started to use DevExpress in early 2012 to fasten our new modules and applications developments as well as our UI conception. After so many days (multiplied by hours…) of testing, reading, searching and discouraging efforts on such a simple thing, we turn to you and your expertise to give us a guideline, some encouraging hints or some code samples to achieve our goal.Or a sound advice like "Simply drop DevExpress and get back at doing things in plain C#"…
Thanks
Michael