TaskFlow/app/DD_PM_WINDREAM/ClassControls.vb
2018-03-01 15:47:25 +01:00

53 lines
1.4 KiB
VB.net

Public Class ClassControls
Private controls As List(Of ClassControl)
Public Sub New()
controls = New List(Of ClassControl)
End Sub
Public Sub Load(datatable As DataTable)
For Each row As DataRow In datatable.Rows
Dim type As String = row.Item("CTRL_TYPE")
Dim guid As Integer = row.Item("GUID")
Dim name As String = row.Item("NAME")
Dim location As New Point(row.Item("X_LOC"), row.Item("Y_LOC"))
Dim width As Integer = row.Item("WIDTH")
Dim height As Integer = row.Item("HEIGHT")
Dim text As String = row.Item("CTRL_TEXT")
Dim control As ClassControl
Select Case type
Case "TXT"
Dim textbox = AddTextbox(guid, name, height, width, location)
control = New ClassControl(textbox)
End Select
Next
End Sub
Public Function GetAll() As List(Of ClassControl)
Return controls
End Function
Public Function GetById() As ClassControl
End Function
Private Function AddTextbox(id As Integer, name As String, height As Integer, width As Integer, location As Point)
Dim textbox As New TextBox()
textbox.Tag = id
textbox.Name = name
textbox.Height = height
textbox.Width = width
textbox.Location = location
End Function
End Class