Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Use Business Object Functions and Methods
Message
From
11/11/2004 09:43:28
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
How to Use Business Object Functions and Methods
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00960416
Message ID:
00960416
Views:
40
I have a MM.NET Business Object (Inherits ABusinessObject) that has many public functions dedicated to providing various data sets related to the primary object. How can these be used in order to return "related" information when creating WinForms applications?

Example Functions in Business Object:
' Returns a DataSet containing ALL Processing Batches Details
Public Function GetAllProcessingBatches() As DataSet
Return Me.GetDataSet("SELECT * FROM ProcessingBatches")
End Function

' Returns a DataSet containing the totals of the processing check detail records for a specified Batch Id
Public Function GetProcessingCheckTotalsForBatch(ByVal batchID As Integer) As DataSet
Return Me.GetDataSet(("SELECT " + _
"SUM(DeferralAmount) AS DeferralAmount," + _
"SUM(CatchUpAmount) AS CatchUpAmount," + _
"SUM(DeferralPlusCatchUpAmount) AS DeferralPlusCatchUpAmount," + _
"SUM(MatchCalculatedAmount) AS MatchCalculatedAmount," + _
"SUM(CheckAllocCompensation) AS CheckAllocCompensation," + _
"SUM(MaximumMatchAmount) AS MaximumMatchAmount," + _
"SUM(MatchAdjustedAmount) AS MatchAdjustedAmount," + _
" FROM ParticipantCheckDetail" + _
" WHERE BatchId = " + batchID.ToString() + _
"GROUP BY batchID"))
End Function

I am presently using the GetAllProcessingBatches in the Form Load event as follows:
Me.oProcessingBatch.GetAllProcessingBatches()
Me.dsProcessingBatch = Me.oProcessingBatch.GetAllProcessingBatches()

This combined with registering the business object with the form as follows:
#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'Instantiate and register business objects with the form
Me.oProcessingBatch = CType(Me.RegisterPrimaryBizObj(New ProcessingBatch), ProcessingBatch)

I'd like to place additional controls (labels or text boxes) on the form to display the information from the business objects GetProcessingCheckTotalsForBatch function.

Is this properly designed as a function of my business object or should this be designed as a separate related business object?

Using this as a function, can I (should I) use data binding to display the results of this function to form controls?

THANKS for any guideance and strategies!!!!
THANKS
Joe Salvatore, Programmer/Analyst - The Stellar Group
Next
Reply
Map
View

Click here to load this message in the networking platform