dcsimg
June 20, 2018
Hot Topics:

Managing Nested GridView Controls

  • September 27, 2006
  • By Paul Kimmel
  • Send Email »
  • More Articles »

If you are new to .NET, Listings 7, 8, and 9 present the Customer, Order, and data-access classes, respectively.

Listing 7: The Customer Class

Imports Microsoft.VisualBasic
Imports System.Collections.Generic

' This code was coded using coderush
Public Class Customer
   Private _myOrders As List(Of _Order) = New List(Of _Order)
   Public Property MyOrders() As List(Of _Order)
      Get
         Return _myOrders
      End Get
      Set(ByVal Value As List(Of _Order))
         _myOrders = Value
      End Set
   End Property
   Private _customerID As String
   Public Property CustomerID() As String
      Get
         Return _customerID
      End Get
      Set(ByVal Value As String)
         _customerID = Value
      End Set
   End Property

   Private _companyName As String
   Public Property CompanyName() As String
      Get
         Return _companyName
      End Get
      Set(ByVal Value As String)
         _companyName = Value
      End Set
   End Property
   Private _contactName As String
   Public Property ContactName() As String
      Get
         Return _contactName
      End Get
      Set(ByVal Value As String)
         _contactName = Value
      End Set
   End Property
   Private _contactTitle As String
   Public Property ContactTitle() As String
      Get
         Return _contactTitle
      End Get
      Set(ByVal Value As String)
         _contactTitle = Value
      End Set
   End Property
   Private _address As String
   Public Property Address() As String
      Get
         Return _address
      End Get
      Set(ByVal Value As String)
         _address = Value
      End Set
   End Property
   Private _city As String
   Public Property City() As String
      Get
         Return _city
      End Get
      Set(ByVal Value As String)
         _city = Value
      End Set
   End Property
   Private _region As String
   Public Property Region() As String
      Get
         Return _region
      End Get
      Set(ByVal Value As String)
         _region = Value
      End Set
   End Property
   Private _postalCode As String
   Public Property PostalCode() As String
      Get
         Return _postalCode
      End Get
      Set(ByVal Value As String)
         _postalCode = Value
      End Set
   End Property
   Private _country As String
   Public Property Country() As String
      Get
         Return _country
      End Get
      Set(ByVal Value As String)
         _country = Value
      End Set
   End Property
   Private _phone As String
   Public Property Phone() As String
      Get
         Return _phone
      End Get
      Set(ByVal Value As String)
         _phone = Value
      End Set
   End Property
   Private _fax As String
   Public Property Fax() As String
      Get
         Return _fax
      End Get
      Set(ByVal Value As String)
         _fax = Value
      End Set
   End Property
End Class

Listing 8: The Implementation of the Order Class
Public Class _Order
   Private _orderID As Nullable(Of Integer)
   Public Property OrderID() As Nullable(Of Integer)
      Get
         Return _orderID
      End Get
      Set(ByVal Value As Nullable(Of Integer))
         _orderID = Value
      End Set
   End Property
   Private _customerID As String
   Public Property CustomerID() As String
      Get
         Return _customerID
      End Get
      Set(ByVal Value As String)
         _customerID = Value
      End Set
   End Property
   Private _employeeID As Nullable(Of Integer)
   Public Property EmployeeID() As Nullable(Of Integer)
      Get
         Return _employeeID
      End Get
      Set(ByVal Value As Nullable(Of Integer))
         _employeeID = Value
      End Set
   End Property
   Private _orderDate As Nullable(Of DateTime)
   Public Property OrderDate() As Nullable(Of DateTime)
      Get
         Return _orderDate
      End Get
      Set(ByVal Value As Nullable(Of DateTime))
         _orderDate = Value
      End Set
   End Property
   Private _requiredDate As Nullable(Of DateTime)
   Public Property RequiredDate() As Nullable(Of DateTime)
      Get
         Return _requiredDate
      End Get
      Set(ByVal Value As Nullable(Of DateTime))
         _requiredDate = Value
      End Set
   End Property
   Private _shippedDate As Nullable(Of DateTime)
   Public Property ShippedDate() As Nullable(Of DateTime)
      Get
         Return _shippedDate
      End Get
      Set(ByVal Value As Nullable(Of DateTime))
         _shippedDate = Value
      End Set
   End Property
   Private _shipVia As Nullable(Of Integer)
   Public Property ShipVia() As Nullable(Of Integer)
      Get
         Return _shipVia
      End Get
      Set(ByVal Value As Nullable(Of Integer))
         _shipVia = Value
      End Set
   End Property
   Private _freight As Nullable(Of Decimal)
   Public Property Freight() As Nullable(Of Decimal)
      Get
         Return _freight
      End Get
      Set(ByVal Value As Nullable(Of Decimal))
         _freight = Value
      End Set
   End Property
   Private _shipName As String
   Public Property ShipName() As String
      Get
         Return _shipName
      End Get
      Set(ByVal Value As String)
         _shipName = Value
      End Set
   End Property
   Private _shipAddress As String
   Public Property ShipAddress() As String
      Get
         Return _shipAddress
      End Get
      Set(ByVal Value As String)
         _shipAddress = Value
      End Set
   End Property
   Private _shipCity As String
   Public Property ShipCity() As String
      Get
         Return _shipCity
      End Get
      Set(ByVal Value As String)
         _shipCity = Value
      End Set
   End Property
   Private _shipRegion As String
   Public Property ShipRegion() As String
      Get
         Return _shipRegion
      End Get
      Set(ByVal Value As String)
         _shipRegion = Value
      End Set
   End Property
   Private _shipPostalCode As String
   Public Property ShipPostalCode() As String
      Get
         Return _shipPostalCode
      End Get
      Set(ByVal Value As String)
         _shipPostalCode = Value
      End Set
   End Property
   Private _shipCountry As String
   Public Property ShipCountry() As String
      Get
         Return _shipCountry
      End Get
      Set(ByVal Value As String)
         _shipCountry = Value
      End Set
   End Property
End Class




Page 2 of 3



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.

Sitemap

×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date