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.cs
45 lines (36 loc) · 1.78 KB
/
HomeController.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DevExpress.Web.Mvc;
using DevExpressMvcApplication1.Models;
namespace DevExpressMvcApplication1.Controllers
{
public class HomeController : Controller
{
//
// GET: /Home/
public ActionResult Index()
{
return View(SchedulerDataHelper.DataObject);
}
public ActionResult SchedulerPartial() {
return PartialView("SchedulerPartial", SchedulerDataHelper.DataObject);
}
public ActionResult EditAppointment() {
UpdateAppointment();
return PartialView("SchedulerPartial", SchedulerDataHelper.DataObject);
}
static void UpdateAppointment() {
List<CustomAppointment> appointmnets = System.Web.HttpContext.Current.Session["AppointmentsList"] as List<CustomAppointment>;
List<CustomResource> resources = System.Web.HttpContext.Current.Session["ResourcesList"] as List<CustomResource>;
CustomAppointment[] insertedAppts = SchedulerExtension.GetAppointmentsToInsert<CustomAppointment>(SchedulerDataHelper.GetSchedulerSettings(), appointmnets, resources);
SchedulerDataHelper.InsertAppointments(insertedAppts);
CustomAppointment[] updatedAppts = SchedulerExtension.GetAppointmentsToUpdate<CustomAppointment>(SchedulerDataHelper.GetSchedulerSettings(), appointmnets, resources);
SchedulerDataHelper.UpdateAppointments(updatedAppts);
CustomAppointment[] removedAppts = SchedulerExtension.GetAppointmentsToRemove<CustomAppointment>(SchedulerDataHelper.GetSchedulerSettings(), appointmnets, resources);
SchedulerDataHelper.RemoveAppointments(removedAppts);
}
}
}