-
Notifications
You must be signed in to change notification settings - Fork 1
/
HomeController.vb
48 lines (42 loc) · 2.29 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
45
46
47
48
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.Mvc
Imports DevExpress.Web.Mvc
Imports MVCSchedulerEditable.Models
Namespace MVCSchedulerEditable.Views
Public Class HomeController
Inherits Controller
'
' GET: /Home/
#Region "#commonactions"
Public Function Index() As ActionResult
Return View(SchedulerDataHelper.DataObject)
End Function
Public Function SchedulerPartial() As ActionResult
Return PartialView("SchedulerPartial", SchedulerDataHelper.DataObject)
End Function
#End Region ' #commonactions
#Region "#editactions"
Public Function EditAppointment() As ActionResult
UpdateAppointment()
Return PartialView("SchedulerPartial", SchedulerDataHelper.DataObject)
End Function
Private Shared Sub UpdateAppointment()
Dim insertedAppointments() As DBAppointment = SchedulerExtension.GetAppointmentsToInsert(Of DBAppointment)("scheduler", SchedulerDataHelper.GetAppointments(), SchedulerDataHelper.GetResources(), SchedulerStorageProvider.DefaultAppointmentStorage, SchedulerStorageProvider.DefaultResourceStorage)
For Each appt In insertedAppointments
AppointmentDataAccessor.InsertAppointment(appt)
Next appt
Dim updatedAppointments() As DBAppointment = SchedulerExtension.GetAppointmentsToUpdate(Of DBAppointment)("scheduler", SchedulerDataHelper.GetAppointments(), SchedulerDataHelper.GetResources(), SchedulerStorageProvider.DefaultAppointmentStorage, SchedulerStorageProvider.DefaultResourceStorage)
For Each appt In updatedAppointments
AppointmentDataAccessor.UpdateAppointment(appt)
Next appt
Dim removedAppointments() As DBAppointment = SchedulerExtension.GetAppointmentsToRemove(Of DBAppointment)("scheduler", SchedulerDataHelper.GetAppointments(), SchedulerDataHelper.GetResources(), SchedulerStorageProvider.DefaultAppointmentStorage, SchedulerStorageProvider.DefaultResourceStorage)
For Each appt In removedAppointments
AppointmentDataAccessor.RemoveAppointment(appt)
Next appt
End Sub
#End Region ' #editactions
End Class
End Namespace