Hi all,
I’m using the scheduler in a day with with events assigned to multiple of them.
When I reschedule and event (with drag and drop) I dont’ receive the units lists as parameters of the callback:
Here the demo for JS and HTML: docs.dhtmlx.com/scheduler/snippet/6a24cd1f
On the server this is the method. The changedEvent.unit = null;
[HttpPost]
public ContentResult Save(int? id, FormCollection actionValues)
{
var action = new DataAction(actionValues);
try
{
var changedEvent = (AreaBackend.Models.PlanningAppuntamentoItem)DHXEventsHelper.Bind(typeof(AreaBackend.Models.PlanningAppuntamentoItem), actionValues);
DateTime inizio;
if (!DateTime.TryParse(changedEvent.start_date, out inizio)) throw new Exception("Data Inizio non valida.");
DateTime fine;
if (!DateTime.TryParse(changedEvent.end_date, out fine)) throw new Exception("Data Fine non valida.");
switch (action.Type)
{
case DataActionTypes.Insert:
//do insert
// action.TargetId = changedEvent.id;//assign postoperational id
break;
case DataActionTypes.Delete:
//do delete
break;
default:// "update"
//do update
var appuntamento = AppSession.Abo.Appuntamenti.GetById(changedEvent.id_appuntamento);
appuntamento.Inizio = inizio;
appuntamento.Fine = fine;
//var ris = appuntamento.AppuntamentiRisorse.FirstOrDefault
AppSession.Abo.Appuntamenti.Save(appuntamento, null, true);
break;
}
}
catch (Exception e)
{
action.Type = DataActionTypes.Error;
throw e;
}
//return (ContentResult)new AjaxSaveResponse(action);
return Content("Ok");
}
Could you please check what I’m doing wrong ?
Thanks,
Fabio