Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RegisterPrimaryBizObj with mmBaseWindow
Message
De
12/11/2008 16:13:48
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01361384
Message ID:
01361483
Vues:
13
>>>>Joe,
>>>>
>>>>>I need to display some data on the MainWindow which is an mmBaseWindow. I cannot call RegisterPrimaryBizObj. So I create the bizobj and set it into the datacontext and it works ok. Is there any reason or way to use RegisterPrimaryBizObj on the MainWindow?
>>>>
>>>>By main window are you referring to the MDI Main Form? The benefits of registering a business object with a form are so you can use the form level methods such as Save() . These methods allow UI action to be taken like confiming a user wants to delete, etc. There is nothing wrong with using the business object the way you state.
>>>>Tim
>>>
>>>Yes the MDI Main Form. I don't need to save, only display. But anyway... how would I register the bo when RegisterPrimaryBizObj is only available on a mmBusinessWindow?
>>
>>Doesn't sound like you need to. What you did sounds fine for that and if it works you should be good. Are you experiencing a problem?
>>Tim
>
>No... It was just my first instinct from reading the docs. I suppose if I need to save from a mmBaseWindow I can use a different method to save.

You could always add your own Save method to the MainForm if you need to save and ultimately it would just call a save on the business object.

I access business objects from classess other than forms all the time and it is perfectly fine. If you do need to do a save there are save methods on the business object also. They just don't have UI stuff in them. When you call the Form level Save you get some UI stuff.

When you have a free moment or two, open the Mere Mortals Framework Windows Forms solution and look at the Save() methods of mmBusinessForm. Ultimately they just call a save method on the business object such as BizObj.SaveDataSet. If you don't have a form involved then you can just call these methods directly on the business object. Just remember you need to check business rules and deal with broken rules.

I hope that helps. Have fun
Tim
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform