Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to show both Summary and Detail Business Object data?
Message
De
19/11/2004 09:16:08
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
How to show both Summary and Detail Business Object data?
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
00962958
Message ID:
00962958
Vues:
35
MM.NET List tab:
Text box fields show the summary of child business object field values
MM.NET Properties tab:
Grid fields show the detail of child business object field values

Both to be synchronized with the parent business object
When navigation occurs in the parent, the children would also change.

I have coded different Functions in the business object to retrieve Aggreaged summary information as well as detail information.
Can these be levereged even though they share the same underlying SQL table data source?
Should I create a different business objects (summary values and detail values)?

Presently my Winforms app is setup as follows:

I placed the text boxes on the List tab, bound to ParticipantCheckDetail business object.
The ParticipantCheckDetail business object is registered with the form as a child of ProcessingBatch BO.
The ParticipantCheckDetail BO is hydrated by a call to it's GetProcessingCheckTotalsForBatch function.
Code in Form_Load and ComboBox_ValueChanged procedures call the BO methods (functions) that hydrate the datasets used by bound fields.
If I drop a grid control on my Properties tab and bind it to the ParticipantCheckDetail object, it only shows summary values.

Added the following to my Form class:
  Declarations
    Private oParticipantCheckDetail As ParticipantCheckDetail
    Private dsParticipantCheckDetail As DataSet
    Private dsProcessingBatchTotals As DataSet

  Constructor Before InitializeComponent()
    ' Instantiate and register business objects with the form
      Me.oProcessingBatch = CType(Me.RegisterPrimaryBizObj(New ProcessingBatch), ProcessingBatch)
      Me.oParticipantCheckDetail = CType(Me.RegisterBizObj(New ParticipantCheckDetail), ParticipantCheckDetail)
    ' Register ParticipantCheckDetail as a child of ProcessingBatch
      oProcessingBatch.RegisterChildBizObj(oParticipantCheckDetail, "ParticipantCheckDetail")

  Form_Load Sub
    ' Set the data source of the selection combo box to the business objects selection listing method results
    ' This dataset is NOT automatically synchronized with the Form's data source (the business object)
      Me.cboProcessingBatchSelection.DataSource = Me.oProcessingBatch.GetProcessingBatchSelectionListing()
      Me.cboProcessingBatchSelection.Value = Me.oProcessingBatch.GetProcessingBatchMostRecentBatchId()
    ' Configure the combo box display and values memeber to match that of the business object
      Me.cboProcessingBatchSelection.DisplayMember = Me.oProcessingBatch.DescriptionField()
      Me.cboProcessingBatchSelection.ValueMember = Me.oProcessingBatch.PrimaryKey()

  Selection Combo Box ValueChanged Sub
    ' Fill the data source of the form with the data for the record selected in the combo box
      Me.dsProcessingBatch = Me.oProcessingBatch.GetProcessingBatchByBatchId(CInt(Me.cboProcessingBatchSelection.Value))
      Me.dsProcessingBatchTotals = Me.oParticipantCheckDetail.GetProcessingCheckTotalsForBatch(CInt(Me.cboProcessingBatchSelection.Value))
ANY thoughts or suggestions for this design are appreciated!
THANKS
Joe Salvatore, Programmer/Analyst - The Stellar Group
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform