This repository has been archived by the owner on Oct 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
HomeController.vb
44 lines (35 loc) · 1.78 KB
/
HomeController.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.Mvc
Imports DevExpress.Web.Mvc
Imports DevExpressMvcApplication1.Models
Namespace DevExpressMvcApplication1.Controllers
Public Class HomeController
Inherits Controller
'
' GET: /Home/
Public Function Index() As ActionResult
Return View(SchedulerDataHelper.DataObject)
End Function
Public Function SchedulerPartial() As ActionResult
Return PartialView("SchedulerPartial", SchedulerDataHelper.DataObject)
End Function
Public Function EditAppointment() As ActionResult
UpdateAppointment()
Return PartialView("SchedulerPartial", SchedulerDataHelper.DataObject)
End Function
Private Shared Sub UpdateAppointment()
Dim appointmnets As List(Of CustomAppointment) = TryCast(System.Web.HttpContext.Current.Session("AppointmentsList"), List(Of CustomAppointment))
Dim resources As List(Of CustomResource) = TryCast(System.Web.HttpContext.Current.Session("ResourcesList"), List(Of CustomResource))
Dim insertedAppts() As CustomAppointment = SchedulerExtension.GetAppointmentsToInsert(Of CustomAppointment)(SchedulerDataHelper.GetSchedulerSettings(), appointmnets, resources)
SchedulerDataHelper.InsertAppointments(insertedAppts)
Dim updatedAppts() As CustomAppointment = SchedulerExtension.GetAppointmentsToUpdate(Of CustomAppointment)(SchedulerDataHelper.GetSchedulerSettings(), appointmnets, resources)
SchedulerDataHelper.UpdateAppointments(updatedAppts)
Dim removedAppts() As CustomAppointment = SchedulerExtension.GetAppointmentsToRemove(Of CustomAppointment)(SchedulerDataHelper.GetSchedulerSettings(), appointmnets, resources)
SchedulerDataHelper.RemoveAppointments(removedAppts)
End Sub
End Class
End Namespace