⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 _orders.vb

📁 EasyObjects 是ORM的典型应用的例子是学习研究的很好的范例
💻 VB
📖 第 1 页 / 共 3 页
字号:
		End Property

		Public ReadOnly Property Freight() As WhereParameter 
			Get
				If _Freight_W Is Nothing Then
					_Freight_W = TearOff.Freight
				End If
				Return _Freight_W
			End Get
		End Property

		Public ReadOnly Property ShipName() As WhereParameter 
			Get
				If _ShipName_W Is Nothing Then
					_ShipName_W = TearOff.ShipName
				End If
				Return _ShipName_W
			End Get
		End Property

		Public ReadOnly Property ShipAddress() As WhereParameter 
			Get
				If _ShipAddress_W Is Nothing Then
					_ShipAddress_W = TearOff.ShipAddress
				End If
				Return _ShipAddress_W
			End Get
		End Property

		Public ReadOnly Property ShipCity() As WhereParameter 
			Get
				If _ShipCity_W Is Nothing Then
					_ShipCity_W = TearOff.ShipCity
				End If
				Return _ShipCity_W
			End Get
		End Property

		Public ReadOnly Property ShipRegion() As WhereParameter 
			Get
				If _ShipRegion_W Is Nothing Then
					_ShipRegion_W = TearOff.ShipRegion
				End If
				Return _ShipRegion_W
			End Get
		End Property

		Public ReadOnly Property ShipPostalCode() As WhereParameter 
			Get
				If _ShipPostalCode_W Is Nothing Then
					_ShipPostalCode_W = TearOff.ShipPostalCode
				End If
				Return _ShipPostalCode_W
			End Get
		End Property

		Public ReadOnly Property ShipCountry() As WhereParameter 
			Get
				If _ShipCountry_W Is Nothing Then
					_ShipCountry_W = TearOff.ShipCountry
				End If
				Return _ShipCountry_W
			End Get
		End Property

		Private _OrderID_W As WhereParameter = Nothing
		Private _CustomerID_W As WhereParameter = Nothing
		Private _EmployeeID_W As WhereParameter = Nothing
		Private _OrderDate_W As WhereParameter = Nothing
		Private _RequiredDate_W As WhereParameter = Nothing
		Private _ShippedDate_W As WhereParameter = Nothing
		Private _ShipVia_W As WhereParameter = Nothing
		Private _Freight_W As WhereParameter = Nothing
		Private _ShipName_W As WhereParameter = Nothing
		Private _ShipAddress_W As WhereParameter = Nothing
		Private _ShipCity_W As WhereParameter = Nothing
		Private _ShipRegion_W As WhereParameter = Nothing
		Private _ShipPostalCode_W As WhereParameter = Nothing
		Private _ShipCountry_W As WhereParameter = Nothing

		Public Sub WhereClauseReset()

		_OrderID_W = Nothing
		_CustomerID_W = Nothing
		_EmployeeID_W = Nothing
		_OrderDate_W = Nothing
		_RequiredDate_W = Nothing
		_ShippedDate_W = Nothing
		_ShipVia_W = Nothing
		_Freight_W = Nothing
		_ShipName_W = Nothing
		_ShipAddress_W = Nothing
		_ShipCity_W = Nothing
		_ShipRegion_W = Nothing
		_ShipPostalCode_W = Nothing
		_ShipCountry_W = Nothing
			Me._entity.Query.FlushWhereParameters()

		End Sub
	
		Private _entity As EasyObject
		Private _tearOff As TearOffWhereParameter
    End Class	

	Public ReadOnly Property Where() As WhereClause
		Get
			If _whereClause Is Nothing Then
				_whereClause = New WhereClause(Me)
			End If
	
			Return _whereClause
		End Get
	End Property
	
	Private _whereClause As WhereClause = Nothing	
#End Region	

#Region " Aggregate Clause "
    Public Class AggregateClause

        Public Sub New(ByVal entity As EasyObject)
            Me._entity = entity
        End Sub
		
		Public ReadOnly Property TearOff As TearOffAggregateParameter
			Get
				If _tearOff Is Nothing Then
					_tearOff = new TearOffAggregateParameter(Me)
				End If

				Return _tearOff
			End Get
		End Property

		#Region " TearOff's "
		Public class TearOffAggregateParameter
		
			Private _clause as AggregateClause
			
			Public Sub New(ByVal clause As AggregateClause)
				Me._clause = clause
			End Sub

			Public ReadOnly Property OrderID() As AggregateParameter
				Get
					Dim ap As AggregateParameter = New AggregateParameter(OrdersSchema.OrderID)
                    Dim query As NCI.EasyObjects.DynamicQuery = Me._clause._entity.Query
                    query.AddAggregateParameter(ap)
					Return ap
				End Get
			End Property

			Public ReadOnly Property CustomerID() As AggregateParameter
				Get
					Dim ap As AggregateParameter = New AggregateParameter(OrdersSchema.CustomerID)
                    Dim query As NCI.EasyObjects.DynamicQuery = Me._clause._entity.Query
                    query.AddAggregateParameter(ap)
					Return ap
				End Get
			End Property

			Public ReadOnly Property EmployeeID() As AggregateParameter
				Get
					Dim ap As AggregateParameter = New AggregateParameter(OrdersSchema.EmployeeID)
                    Dim query As NCI.EasyObjects.DynamicQuery = Me._clause._entity.Query
                    query.AddAggregateParameter(ap)
					Return ap
				End Get
			End Property

			Public ReadOnly Property OrderDate() As AggregateParameter
				Get
					Dim ap As AggregateParameter = New AggregateParameter(OrdersSchema.OrderDate)
                    Dim query As NCI.EasyObjects.DynamicQuery = Me._clause._entity.Query
                    query.AddAggregateParameter(ap)
					Return ap
				End Get
			End Property

			Public ReadOnly Property RequiredDate() As AggregateParameter
				Get
					Dim ap As AggregateParameter = New AggregateParameter(OrdersSchema.RequiredDate)
                    Dim query As NCI.EasyObjects.DynamicQuery = Me._clause._entity.Query
                    query.AddAggregateParameter(ap)
					Return ap
				End Get
			End Property

			Public ReadOnly Property ShippedDate() As AggregateParameter
				Get
					Dim ap As AggregateParameter = New AggregateParameter(OrdersSchema.ShippedDate)
                    Dim query As NCI.EasyObjects.DynamicQuery = Me._clause._entity.Query
                    query.AddAggregateParameter(ap)
					Return ap
				End Get
			End Property

			Public ReadOnly Property ShipVia() As AggregateParameter
				Get
					Dim ap As AggregateParameter = New AggregateParameter(OrdersSchema.ShipVia)
                    Dim query As NCI.EasyObjects.DynamicQuery = Me._clause._entity.Query
                    query.AddAggregateParameter(ap)
					Return ap
				End Get
			End Property

			Public ReadOnly Property Freight() As AggregateParameter
				Get
					Dim ap As AggregateParameter = New AggregateParameter(OrdersSchema.Freight)
                    Dim query As NCI.EasyObjects.DynamicQuery = Me._clause._entity.Query
                    query.AddAggregateParameter(ap)
					Return ap
				End Get
			End Property

			Public ReadOnly Property ShipName() As AggregateParameter
				Get
					Dim ap As AggregateParameter = New AggregateParameter(OrdersSchema.ShipName)
                    Dim query As NCI.EasyObjects.DynamicQuery = Me._clause._entity.Query
                    query.AddAggregateParameter(ap)
					Return ap
				End Get
			End Property

			Public ReadOnly Property ShipAddress() As AggregateParameter
				Get
					Dim ap As AggregateParameter = New AggregateParameter(OrdersSchema.ShipAddress)
                    Dim query As NCI.EasyObjects.DynamicQuery = Me._clause._entity.Query
                    query.AddAggregateParameter(ap)
					Return ap
				End Get
			End Property

			Public ReadOnly Property ShipCity() As AggregateParameter
				Get
					Dim ap As AggregateParameter = New AggregateParameter(OrdersSchema.ShipCity)
                    Dim query As NCI.EasyObjects.DynamicQuery = Me._clause._entity.Query
                    query.AddAggregateParameter(ap)
					Return ap
				End Get
			End Property

			Public ReadOnly Property ShipRegion() As AggregateParameter
				Get
					Dim ap As AggregateParameter = New AggregateParameter(OrdersSchema.ShipRegion)
                    Dim query As NCI.EasyObjects.DynamicQuery = Me._clause._entity.Query
                    query.AddAggregateParameter(ap)
					Return ap
				End Get
			End Property

			Public ReadOnly Property ShipPostalCode() As AggregateParameter
				Get
					Dim ap As AggregateParameter = New AggregateParameter(OrdersSchema.ShipPostalCode)
                    Dim query As NCI.EasyObjects.DynamicQuery = Me._clause._entity.Query
                    query.AddAggregateParameter(ap)
					Return ap
				End Get
			End Property

			Public ReadOnly Property ShipCountry() As AggregateParameter
				Get
					Dim ap As AggregateParameter = New AggregateParameter(OrdersSchema.ShipCountry)
                    Dim query As NCI.EasyObjects.DynamicQuery = Me._clause._entity.Query
                    query.AddAggregateParameter(ap)
					Return ap
				End Get
			End Property

	End Class
	
	#End Region	

		Public ReadOnly Property OrderID() As AggregateParameter 
			Get
				If _OrderID_W Is Nothing Then
					_OrderID_W = TearOff.OrderID
				End If
				Return _OrderID_W
			End Get
		End Property

		Public ReadOnly Property CustomerID() As AggregateParameter 
			Get
				If _CustomerID_W Is Nothing Then
					_CustomerID_W = TearOff.CustomerID
				End If
				Return _CustomerID_W
			End Get
		End Property

		Public ReadOnly Property EmployeeID() As AggregateParameter 
			Get
				If _EmployeeID_W Is Nothing Then
					_EmployeeID_W = TearOff.EmployeeID
				End If
				Return _EmployeeID_W
			End Get
		End Property

		Public ReadOnly Property OrderDate() As AggregateParameter 
			Get
				If _OrderDate_W Is Nothing Then
					_OrderDate_W = TearOff.OrderDate
				End If
				Return _OrderDate_W
			End Get
		End Property

		Public ReadOnly Property RequiredDate() As AggregateParameter 
			Get
				If _RequiredDate_W Is Nothing Then
					_RequiredDate_W = TearOff.RequiredDate
				End If
				Return _RequiredDate_W
			End Get
		End Property

		Public ReadOnly Property ShippedDate() As AggregateParameter 
			Get
				If _ShippedDate_W Is Nothing Then
					_ShippedDate_W = TearOff.ShippedDate
				End If
				Return _ShippedDate_W
			End Get
		End Property

		Public ReadOnly Property ShipVia() As AggregateParameter 
			Get
				If _ShipVia_W Is Nothing Then
					_ShipVia_W = TearOff.ShipVia
				End If
				Return _ShipVia_W
			End Get
		End Property

		Public ReadOnly Property Freight() As AggregateParameter 
			Get
				If _Freight_W Is Nothing Then
					_Freight_W = TearOff.Freight
				End If
				Return _Freight_W
			End Get
		End Property

		Public ReadOnly Property ShipName() As AggregateParameter 
			Get
				If _ShipName_W Is Nothing Then
					_ShipName_W = TearOff.ShipName
				End If
				Return _ShipName_W
			End Get
		End Property

		Public ReadOnly Property ShipAddress() As AggregateParameter 
			Get
				If _ShipAddress_W Is Nothing Then
					_ShipAddress_W = TearOff.ShipAddress
				End If
				Return _ShipAddress_W
			End Get
		End Property

		Public ReadOnly Property ShipCity() As AggregateParameter 
			Get
				If _ShipCity_W Is Nothing Then
					_ShipCity_W = TearOff.ShipCity
				End If
				Return _ShipCity_W
			End Get
		End Property

		Public ReadOnly Property ShipRegion() As AggregateParameter 
			Get
				If _ShipRegion_W Is Nothing Then
					_ShipRegion_W = TearOff.ShipRegion
				End If
				Return _ShipRegion_W
			End Get
		End Property

		Public ReadOnly Property ShipPostalCode() As AggregateParameter 
			Get
				If _ShipPostalCode_W Is Nothing Then
					_ShipPostalCode_W = TearOff.ShipPostalCode
				End If
				Return _ShipPostalCode_W
			End Get
		End Property

		Public ReadOnly Property ShipCountry() As AggregateParameter 
			Get
				If _ShipCountry_W Is Nothing Then
					_ShipCountry_W = TearOff.ShipCountry
				End If
				Return _ShipCountry_W
			End Get
		End Property

		Private _OrderID_W As AggregateParameter = Nothing
		Private _CustomerID_W As AggregateParameter = Nothing
		Private _EmployeeID_W As AggregateParameter = Nothing
		Private _OrderDate_W As AggregateParameter = Nothing
		Private _RequiredDate_W As AggregateParameter = Nothing
		Private _ShippedDate_W As AggregateParameter = Nothing
		Private _ShipVia_W As AggregateParameter = Nothing
		Private _Freight_W As AggregateParameter = Nothing
		Private _ShipName_W As AggregateParameter = Nothing
		Private _ShipAddress_W As AggregateParameter = Nothing
		Private _ShipCity_W As AggregateParameter = Nothing
		Private _ShipRegion_W As AggregateParameter = Nothing
		Private _ShipPostalCode_W As AggregateParameter = Nothing
		Private _ShipCountry_W As AggregateParameter = Nothing

		Public Sub AggregateClauseReset()

		_OrderID_W = Nothing
		_CustomerID_W = Nothing
		_EmployeeID_W = Nothing
		_OrderDate_W = Nothing
		_RequiredDate_W = Nothing
		_ShippedDate_W = Nothing
		_ShipVia_W = Nothing
		_Freight_W = Nothing
		_ShipName_W = Nothing
		_ShipAddress_W = Nothing
		_ShipCity_W = Nothing
		_ShipRegion_W = Nothing
		_ShipPostalCode_W = Nothing
		_ShipCountry_W = Nothing
			Me._entity.Query.FlushAggregateParameters()

		End Sub
	
		Private _entity As EasyObject
		Private _tearOff As TearOffAggregateParameter
    End Class	

	Public ReadOnly Property Aggregate() As AggregateClause
		Get
			If _aggregateClause Is Nothing Then
				_aggregateClause = New AggregateClause(Me)
			End If
	
			Return _aggregateClause
		End Get
	End Property
	
	Private _aggregateClause As AggregateClause = Nothing	
#End Region	

End Class


⌨️ 快捷键说明

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