Imports System
Imports System.Data
Imports DayPilot.Utils

''' <summary>
''' Summary description for DataGenerator
''' </summary>
Public Class DataGeneratorGantt
	Public Shared Function GetData() As DataTable
		Dim dt As DataTable
		dt = New DataTable()
		dt.Columns.Add("id", GetType(String))
		dt.Columns.Add("start", GetType(Date))
		dt.Columns.Add("end", GetType(Date))
		dt.Columns.Add("text", GetType(String))
		dt.Columns.Add("parent", GetType(String))
		dt.Columns.Add("info", GetType(String))
		dt.Columns.Add("milestone", GetType(Boolean))
		dt.Columns.Add("complete", GetType(Integer))

		Dim dr As DataRow

		dr = dt.NewRow()
		dr("id") = 101
		dr("start") = Convert.ToDateTime("15:00")
		dr("end") = Convert.ToDateTime("15:00").AddDays(1)
		dr("text") = "Group 1"
		dr("info") = "Additional info"
		dr("parent") = Nothing
		dt.Rows.Add(dr)

		dr = dt.NewRow()
		dr("id") = 1
		dr("start") = Convert.ToDateTime("15:00")
		dr("end") = Convert.ToDateTime("15:00").AddDays(1)
		dr("text") = "Task 1"
		dr("complete") = 50
		dr("parent") = 101
		dt.Rows.Add(dr)

		dr = dt.NewRow()
		dr("id") = 2
		dr("start") = Convert.ToDateTime("15:00").AddDays(1)
		dr("end") = Convert.ToDateTime("15:00").AddDays(2)
		dr("text") = "Task 2"
		dr("complete") = 25
		dr("parent") = 101
		dt.Rows.Add(dr)

		dr = dt.NewRow()
		dr("id") = 3
		dr("start") = Convert.ToDateTime("15:00").AddDays(1)
		dr("text") = "Milestone 1"
		dr("milestone") = True
		dr("parent") = 101
		dt.Rows.Add(dr)

		dt.PrimaryKey = New DataColumn() { dt.Columns("id") }

		Return dt

	End Function
	Public Shared Function GetDataLarge() As DataTable
		Dim dt As DataTable
		dt = New DataTable()
		dt.Columns.Add("id", GetType(String))
		dt.Columns.Add("start", GetType(Date))
		dt.Columns.Add("end", GetType(Date))
		dt.Columns.Add("text", GetType(String))
		dt.Columns.Add("parent", GetType(String))

		Dim dr As DataRow

		For i As Integer = 0 To 9999
			dr = dt.NewRow()
			dr("id") = i
			dr("start") = Convert.ToDateTime("15:00")
			dr("end") = Convert.ToDateTime("15:00").AddDays(1)
			dr("text") = "Task " & i
			dr("parent") = Nothing
			dt.Rows.Add(dr)
		Next i

		dt.PrimaryKey = New DataColumn() { dt.Columns("id") }

		Return dt

	End Function


End Class
