Advertisement
richcoleman

Auto-Incremented ID

Nov 15th, 2011
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.70 KB | None | 0 0
  1.     Public Class Process
  2.  
  3.         'every time a Person is added to the Processes PersonCollection, I need to set an id that is incremented.
  4.  
  5.         Public Sub AddPerson(ByVal person As Person)
  6.             'add person
  7.         End Sub
  8.  
  9.         Public Class Person
  10.             Private incrementedID As Integer = 0
  11.             'get set
  12.  
  13.         End Class
  14.  
  15.         Private NotInheritable Class PersonCollection
  16.             Inherits CollectionBase
  17.  
  18.             Public Sub Add(ByVal person As Person)
  19.                 List.Add(person)
  20.             End Sub
  21.  
  22.         End Class
  23.  
  24.  
  25.         Public Sub AddWorkFlow(ByVal workflow As WorkFlow)
  26.             'add workflow
  27.         End Sub
  28.  
  29.         Public Class WorkFlow
  30.  
  31.             Public Sub AddTask(ByVal task As Task)
  32.                 'add task
  33.             End Sub
  34.  
  35.             'whenever there is a task added to the workflow, I need to set the incrementedID of the person that is going to do the task
  36.             'this is important because each person can be apart of many different workflows and many different tasks in each workflow
  37.  
  38.             Public Class Task
  39.                 Private personID As Integer
  40.                 'get set
  41.             End Class
  42.  
  43.             Private NotInheritable Class TaskCollection
  44.                 Inherits CollectionBase
  45.  
  46.                 Public Sub Add(ByVal task As Task)
  47.                     List.Add(task)
  48.                 End Sub
  49.  
  50.             End Class
  51.  
  52.         End Class
  53.  
  54.         Private NotInheritable Class WorkFlowCollection
  55.             Inherits CollectionBase
  56.  
  57.             Public Sub Add(ByVal workflow As WorkFlow)
  58.                 List.Add(workflow)
  59.             End Sub
  60.  
  61.         End Class
  62.  
  63.     End Class
  64.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement