Imports System
Imports System.Data

Partial Public Class Resizing
	Inherits System.Web.UI.Page

	Private table As DataTable

	Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
'		#Region "Data loading initialization"
		If Session("EventResizing") Is Nothing Then
			Session("EventResizing") = DataGeneratorCalendar.GetData()
		End If
		table = DirectCast(Session("EventResizing"), DataTable)
		DayPilotCalendar1.DataSource = Session("EventResizing")
'		#End Region

		If Not IsPostBack Then
			DataBind()
		End If
	End Sub

	Protected Sub DayPilotCalendar1_EventResize(ByVal sender As Object, ByVal e As DayPilot.Web.Ui.Events.EventResizeEventArgs)
'		#Region "Simulation of database update"

		Dim dr As DataRow = table.Rows.Find(e.Id)
		If dr IsNot Nothing Then
			dr("start") = e.NewStart
			dr("end") = e.NewEnd
			table.AcceptChanges()

		End If

'		#End Region

		DayPilotCalendar1.DataBind()
		DayPilotCalendar1.Update()

	End Sub
End Class
