C
charlie
Hi there,
I am looking at an ASP.Net example where the programmer creates a class
in this code behind source, sets it's properties, and then passes it to
other class methods as a parameter. See the example below. Is this an OK
practice?
Dim s As String
Dim rtn As Integer
Dim rtnMsg As String
Dim dbfunction As New myClassDB
Dim bugid As Integer
Dim bugReport As New bugReportRecord
Dim userName As String
bugid = viewstate("bugId")
bugReport.b_assignto = Me.txtAssigned.Text
bugReport.b_desc = Me.txtDes.Text
bugReport.b_note = Me.txtNote.Text
bugReport.b_release = Me.txtRelease.Text
bugReport.b_submitby = Me.txtSubmitBy.Text
bugReport.b_priority = Me.cboPriority.SelectedValue
bugReport.b_status = Me.cboStat.SelectedValue
bugReport.b_type = Me.cboType.SelectedValue
If bugid > 0 Then
bugReport.b_Id = bugid
rtn = dbfunction.updateBugRecord(bugReport)
Else
bugReport = dbfunction.writeBugRecord(bugReport)
End If
I am looking at an ASP.Net example where the programmer creates a class
in this code behind source, sets it's properties, and then passes it to
other class methods as a parameter. See the example below. Is this an OK
practice?
Dim s As String
Dim rtn As Integer
Dim rtnMsg As String
Dim dbfunction As New myClassDB
Dim bugid As Integer
Dim bugReport As New bugReportRecord
Dim userName As String
bugid = viewstate("bugId")
bugReport.b_assignto = Me.txtAssigned.Text
bugReport.b_desc = Me.txtDes.Text
bugReport.b_note = Me.txtNote.Text
bugReport.b_release = Me.txtRelease.Text
bugReport.b_submitby = Me.txtSubmitBy.Text
bugReport.b_priority = Me.cboPriority.SelectedValue
bugReport.b_status = Me.cboStat.SelectedValue
bugReport.b_type = Me.cboType.SelectedValue
If bugid > 0 Then
bugReport.b_Id = bugid
rtn = dbfunction.updateBugRecord(bugReport)
Else
bugReport = dbfunction.writeBugRecord(bugReport)
End If