Hello, I`m using Scheduler with the Database from our video confernce system, because we wanna make something like one unit calendar and show what room is free for video conferences.
For this a have to use the database from the system. There i can found 2 tables that save the video conference (ScheduledCall and ScheduledParticipant), the problem is that ScheduledCall where the events are saved, do not contain the participant Id (RoomID). I can’t use the ScheduledParticipant Id also, because this change when we restart the equipments I have to use the ParticipantName this I list in BasicController.
I don’t need that the users create event or change it, how could I switch off this?
I send my BasicController and one screenshot from my tables.
BasicController
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Script.Serialization;
using DHTMLX.Common;
using DHTMLX.Scheduler;
using DHTMLX.Scheduler.Data;
using DHTMLX.Scheduler.Authentication;
using DHTMLX.Scheduler.Settings;
using DHTMLX.Scheduler.Controls;
using MySchedulerApp.Models;
namespace MySchedulerApp.Controllers
{
public class BasicSchedulerController : Controller
{
// GET: /DifferentModes/
public ActionResult Index()
{
var scheduler = new DHXScheduler(this);
var rooms = new List<object>(){
new { key = "Bocar VC Coyoacan", label = " Coyoacan"},
new { key = "Bocar VC Fugra", label = "Fugra"},
new { key = "Bocar VC Presion", label = "Presion"},
new { key = "Bocar VC Plastitec", label = "Plastitec"},
new { key = "Bocar VC Queretaro", label = "Queretaro"},
new { key = "Bocar VC SLP", label = "SLP"},
new { key = "Bocar VC Saltillo", label = "Saltillo"},
new { key = "Bocar VC Chihuahua", label = "Chihuahua"},
new { key = "Bocar VC Detroit", label = "Detroit"}
};
// Zeigt Videokonferenzen Zimmern
var unit = new UnitsView("Room", "room_id");
unit.AddOptions(rooms);
unit.Label = "Room";
//'Data' action is added by default, you can manage data sources by scheduler.Data.Loader.GetUrls collection
//Videokonferenzen nur von 6 am bis 20 pm
scheduler.Config.first_hour = 6;
scheduler.Config.last_hour = 20;
//scheduler.Data.Loader.AddAction("OtherData");
scheduler.Data.Loader.PreventCache();
scheduler.LoadData = true;
scheduler.EnableDataprocessor = true;
//Add Rooms View
scheduler.Views.Add(unit);
//Add Agenda View
scheduler.Views.Add(new WeekAgendaView());
return View(scheduler);
}
public ActionResult Data()
{
var db = new EventDataContext();
// Get all meetings
var meetingTable = db.ScheduledCalls;
//http://docs.dhtmlx.com/doku.php?id=dhtmlxscheduler:units_view&s[]=units
var items = new List<object>();
foreach (var entry in meetingTable)
{
// Create a string which holds the descrition of a meeting
string meetingText = "Salas:\n";
// Get all participants of a meeting
var participantTable = from c in db.ScheduledParticipants
where c.ScheduledCallId == entry.Id
select c;
// List all particpiants
foreach (var particpant in participantTable)
{
meetingText = meetingText + "- " + particpant.ParticipantName + "\n";
}
// Append the participants list at the end of the meeting description
meetingText = entry.Title + "\n" + meetingText;
// Add meeting to meeting list
items.Add(new { id = entry.Id, text = meetingText, room_id = entry.Title, start_date = entry.StartTime, end_date = entry.EndTime });
}
return new SchedulerAjaxData(items);
}
}
}