WIP
This commit is contained in:
@@ -1,14 +1,5 @@
|
||||
Namespace Schemas
|
||||
Public Class Schema
|
||||
|
||||
Public Enum ColumnType As Integer
|
||||
[String]
|
||||
[Integer]
|
||||
[Date]
|
||||
[Boolean]
|
||||
[Decimal]
|
||||
End Enum
|
||||
|
||||
Public Property Tables As New List(Of Table)
|
||||
Public Property Name As String
|
||||
|
||||
@@ -20,9 +11,8 @@
|
||||
Class Column
|
||||
Public Property Name As String
|
||||
Public Property Required As String
|
||||
Public Property DataType As ColumnType
|
||||
Public Property DataType As Constants.ColumnType
|
||||
End Class
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
|
||||
@@ -41,8 +41,11 @@ Namespace Schemas
|
||||
|
||||
Public Function GetSchemaFromFile(pSchemaFilePath As String) As Schema
|
||||
Dim oSchema As New Schema
|
||||
Dim oFileInfo As New FileInfo(pSchemaFilePath)
|
||||
Dim oElements = GetSchemaElements(pSchemaFilePath)
|
||||
|
||||
oSchema.Name = oFileInfo.Name
|
||||
|
||||
For Each oElement In oElements
|
||||
Dim oColumns = GetElementColumns(oElement)
|
||||
Dim oSchemaColumns As New List(Of Schema.Column)
|
||||
@@ -76,7 +79,7 @@ Namespace Schemas
|
||||
Return oSchema
|
||||
End Function
|
||||
|
||||
Public Function GetElementType(pElement As XElement) As Schema.ColumnType
|
||||
Public Function GetElementType(pElement As XElement) As Constants.ColumnType
|
||||
Dim oTypeString = XmlData.GetElementAttribute(pElement, "type")
|
||||
|
||||
If oTypeString Is Nothing Then
|
||||
@@ -89,15 +92,15 @@ Namespace Schemas
|
||||
|
||||
Select Case oTypeString
|
||||
Case "xs:date"
|
||||
Return Schema.ColumnType.Date
|
||||
Return Constants.ColumnType.Date
|
||||
Case "xs:integer"
|
||||
Return Schema.ColumnType.Integer
|
||||
Return Constants.ColumnType.Integer
|
||||
Case "xs:decimal"
|
||||
Return Schema.ColumnType.Decimal
|
||||
Return Constants.ColumnType.Decimal
|
||||
Case "xs:boolean"
|
||||
Return Schema.ColumnType.Boolean
|
||||
Return Constants.ColumnType.Boolean
|
||||
Case Else
|
||||
Return Schema.ColumnType.String
|
||||
Return Constants.ColumnType.String
|
||||
End Select
|
||||
End Function
|
||||
|
||||
|
||||
Reference in New Issue
Block a user