problems with class files

Joined
Jan 24, 2005
Messages
10
Programming Experience
Beginner
im still havin problems with class files i have this project n i wanna make a class file from it to separate the business logic of it in that class n to give properties to sales and shared read only properties for the summary information in the message box, like i know once i finish the class i have to delete this from the form n i think for my text boxes i have to instantiate them or somethin n i guess i have to add properties to the sales n ya im really confused could someone help me out heres the calculations i have from the form:

'Dimension the module level variables
Dim mdecTotalPayAmount As Decimal
Dim mdecCommissionAmount As Decimal

Private Sub mnuFilePay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFilePay.Click
'Dimension the procedure variables
Const decBasePay As Decimal = 250D

'Calculate the total pay
mdecTotalPayAmount = decBasePay + FindCommission()
lblTotalPayAmount.Text = FormatNumber(mdecTotalPayAmount.ToString, 2)

'Call the function
If FindCommission() > 0 Then
lblCommissionAmount.Text = FormatNumber(FindCommission().ToString, 2)
Else
lblCommissionAmount.Text = ""
End If
End Sub

Private Function FindCommission() As Decimal
'Dimension the procedure variables
Const decCommissionRate As Decimal = 0.15D
Const decQuota As Decimal = 1000D
Dim decWeeklySales As Decimal = CDec(txtWeeklySales.Text)

'Calculate the commission
If decWeeklySales >= decQuota Then
FindCommission = decWeeklySales * decCommissionRate
End If
End Function

Private Sub mnuFilePaySummary_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFilePaySummary.Click
'Display the total pay, sales and commission in a message box
Dim decWeeklySales As Decimal = CDec(txtWeeklySales.Text)
MessageBox.Show("Total Sales:" & FormatCurrency(decWeeklySales) _
& ControlChars.NewLine & ControlChars.NewLine _
& "Total Pay:" & FormatCurrency(mdecTotalPayAmount) _
& ControlChars.NewLine & ControlChars.NewLine _
& "Total Commission:" & FormatCurrency(FindCommission()))
End Sub
 

Eric_Mutta

Member
Joined
Mar 30, 2005
Messages
5
Location
UK
Programming Experience
5-10
That was a very long sentence! :)...what problem are you having exactly? what do you want to achieve?
 
Top Bottom