This question is locked. New answers and comments are not allowed.
Hi,
On the WinForm I have placed number of common controls (mostly textBoxes, comboBoxes and checkBoxes).
I have also placed ObjectView and ObjectProvider controls and binded individual controls to an entity properties.
Important note: I had to set advanced databindings to update the data source on property changed type to be able to see changes to entity data when user fills values.
On form Load event I call the following code:
ObjectProvider1.SetObjectContext(DbContext.Scope);
var entity = new EntityCONTRACT(); // Domain Class instance
SetInitialEntityValues(entity); // populate some initial data
DbContext.Add(entity); // entity added to the context
DbContext.FlushChanges(); // make entity data immediatelly available to the binded controls
ObjectProvider1.Refresh(); // refresh data from underlying context
ObjectView1.MoveLast(); // go to the last added entity
Since according to internal application logic I need to copy values between the same entity's properties I always update the property as needed and subsequently call ObjectProvider1.Refresh() to see the changes in controls value.
While this has been working for me on my development box, testers have reported loss of data in all data-bound controls on occassion. Usually after tabbing away from control.
Is there generally something wrong with my approach? Can this be caused by ObjectProvider1.Refresh() method call?
I always try to search online documentation but in this case I have no clue.
Please help as the implementation of OA ORM has been time costly and if I can't provide working solution I will have to turn to other ORM provider and scrape what I have done so far.
Thank you very much,
Dusan
On the WinForm I have placed number of common controls (mostly textBoxes, comboBoxes and checkBoxes).
I have also placed ObjectView and ObjectProvider controls and binded individual controls to an entity properties.
Important note: I had to set advanced databindings to update the data source on property changed type to be able to see changes to entity data when user fills values.
On form Load event I call the following code:
ObjectProvider1.SetObjectContext(DbContext.Scope);
var entity = new EntityCONTRACT(); // Domain Class instance
SetInitialEntityValues(entity); // populate some initial data
DbContext.Add(entity); // entity added to the context
DbContext.FlushChanges(); // make entity data immediatelly available to the binded controls
ObjectProvider1.Refresh(); // refresh data from underlying context
ObjectView1.MoveLast(); // go to the last added entity
Since according to internal application logic I need to copy values between the same entity's properties I always update the property as needed and subsequently call ObjectProvider1.Refresh() to see the changes in controls value.
While this has been working for me on my development box, testers have reported loss of data in all data-bound controls on occassion. Usually after tabbing away from control.
Is there generally something wrong with my approach? Can this be caused by ObjectProvider1.Refresh() method call?
I always try to search online documentation but in this case I have no clue.
Please help as the implementation of OA ORM has been time costly and if I can't provide working solution I will have to turn to other ORM provider and scrape what I have done so far.
Thank you very much,
Dusan