In a purchase, you have to collect many different types of addresses: billing, shipping and credit. Rather than have a separate class for each address, create a single class to hold address information and include an address type. You then can create a collection of the Address objects and assign it to a customer. Here is an example:
Public Enum OrderAddressType
Billing
Credit
Shipping
End Enum
Public Class OrderAddress
Public orderAddressType As OrderAddressType
Public strFirstName As String
Public strMI As String
Public strLastName As String
Public strStreet1 As String
Public strStreet2 As String
Public strCity As String
Public strStateProv As String
Public strPostalCode As String
Public strCountry As String
End Class
Public Class OrderAddressCollection
Inherits System.Collections.CollectionBase
Public Sub Add(ByVal oa As OrderAddress)
List.Add(oa)
End Sub
Public Sub Remove(ByVal index As Integer)
If index > Count - 1 Or index < 0 Then
'ignore request
Else
List.RemoveAt(index)
End If
End Sub
Default Public ReadOnly Property Item(ByVal index As Integer) As OrderAddress
Get
Return CType(list.Item(index), OrderAddress)
End Get
End Property
End Class
In the code above, CollectionBase was used as the base of the collection. In a simple Collection you only have the ability to identify the items in the collection by their location. If you need to identify the items in the collection by something other than the numeric index, then you have to use a DictionaryBase.
In my next post, I will give an examples of using DictionaryBase which I am working on now.
I'm looking forward to seeing your post on using the dictionarybase to do the same thing. I've been trying to figure it out all night but wasn't ablet to set the text and value fields on the dropdownlist. I switch to using an arraylist and it works fine. I know I must be missing something.
Posted by: jelling | Sunday, January 18, 2004 at 11:07 PM
I'll be posting a DictionaryBase example soon. I was delayed in writing my post since things have been so busy lately. I am working on it now.
Posted by: Jason | Monday, January 19, 2004 at 09:57 PM
bxFfIsUxyKrz http://www.toryburch2012outlet.com/>Tory Burch Shoes kPGEPWy
Posted by: woqjnjtk | Friday, April 13, 2012 at 04:20 AM
axjDBXmbyTSWhrmrY http://www.tory-burch-shoesoutlet.com>Tory Burch Outlet YkJfqUTDJ
Posted by: gxcvxfnpbe | Friday, April 13, 2012 at 04:24 AM
いや Raw String Literal全体に対して 逆変換がかかるようにするのです つまり d-char-sequenceに対しても 逆変換がかかります そもそも プリプロセッサは string ltareilを 認識できなければならないのです だから プリプロセスを始める前に raw string ltareilかどうかは 分かるのです そもそも 規格というのは 具体的な実装方法を定義しているのではなくて 意味を定義しているのです 規格と同じ結果になれば どんな実装方法でもいいのです
Posted by: Kudick | Saturday, April 28, 2012 at 09:16 AM
this is simplest way to do it but there are betetr ways too :BufferedReader in= new BufferedReader (new InputStreamReader (System.in)); String s = in.readLine(); for (int i=0; i
Posted by: Paloma | Monday, April 30, 2012 at 09:30 PM
as far as UK goes:most of UK's recent hiotrsy, 100 years or so, GDP to foreign debt ratio has been over 100%.(q) Fareed Zakharia, CNN, Global Public Square & Time magazine.
Posted by: Mark | Friday, July 13, 2012 at 02:41 AM