bizobject.vb
来自「asp.net技术内幕的书配源码」· VB 代码 · 共 34 行
VB
34 行
Imports System
Namespace myComponents
Public Class BizObject
Sub CheckOrder( _
Customer As String, _
Product As String, _
UnitPrice As Double, _
Quantity As Integer, _
State As String )
If Quantity <= 0 Or quantity > 100 Then
Throw New ArgumentException( "Invalid Quantity!" )
End If
If State = "California" And Product="Hair Dryer" Then
Throw New ArgumentException( "Californians cannot own Hair Dryers!" )
End IF
If State = "Washington" Then
unitPrice += unitPrice * .06
End If
Dim myDataObject As New DataObject
myDataObject.SaveOrder( customer, product, unitPrice, quantity, state )
End Sub
End Class
End Namespace
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?