1) Let's assume you want an IsConvertible property. How expensive is that? In other words, can your ConvetOrder2Invoice (CO2I) object make the determination without having to get more info from the database?
If so, then CO2I can implement IsConvertible for use by the UI.
If not, then you need to decide whether disabling the button is worth the extra cost. If it is, you can just use CO2I and pay the price, otherwise just don't disable the button.
2) I suggest that CO2I uses Order, but Order is oblivious to what's going on. In other words, the UI fetches the order, then creates a CO2I object based on that Order. The UI then has references to both objects and can bind to both.
I'm not sure how you should display why conversion isn't possible, but you can probably do it by binding a size 0,0 label to a property of CO2I near your button - if CO2I is invalid, the tooltip of the errorprovider would should what's wrong.
3) It is your CO2I object that'll do the conversion right? I wonder if you can't just implement an internal/Friend interface in your business layer so the CO2I can, once conversion succeeds, tell the Order to change states. This would be done in the CO2I.Save() method after the save completes.
Rocky,
That was the general direction I was thinking in.. glad to know I wasn't far off the track.
I'll start implementing as advised.
Thanks and feel better!
Andy
Copyright (c) Marimer LLC