class.format

来自「客户关系管理系统ASP.NET+VB.NET编程完整程序!」· FORMAT 代码 · 共 57 行

FORMAT
57
字号
 
	Public MustInherit Class {0}OrmTemplate : Inherits Business
	
		Friend  Sub New(ByVal dataContext As DataManager, ByVal dr As DataRow)
			MyBase.New(dataContext)  
			MyBase.row = dr
		End Sub
 
 
		Default Public Property Item(ByVal propertyName As String) As Object
			Get
				Dim pi As System.Reflection.PropertyInfo = Me.GetType().GetProperty(propertyName)

				If (Not pi Is Nothing) And pi.CanRead Then
					Return pi.GetValue(Me, Nothing)
				End If

				Dim a As Type()
				Dim mi As System.Reflection.MethodInfo = Me.GetType().GetMethod("Get" + propertyName, a)

				If Not mi Is Nothing Then
					Return mi.Invoke(Me, Nothing)
				End If

				Return Nothing
			End Get
			Set(ByVal Value As Object)
				Dim pi As System.Reflection.PropertyInfo = Me.GetType().GetProperty(Value)

				If (Not pi Is Nothing) And pi.CanWrite Then
					pi.SetValue(Me, Value, Nothing)
					Return
				End If

				Dim mi As System.Reflection.MethodInfo = Value.GetType().GetMethod("Set" + propertyName)

				If Not mi Is Nothing Then
					mi.Invoke(Me, New Object() {Value})
				End If
			End Set
		End Property
	
			
		Public Function IsDeleted() As Boolean
			Return (row.RowState = DataRowState.Deleted)
		End Function


{1}
{2}
{3}
{4}


	End Class

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?