in the MVC example - a data processor is setup as:
var dp = new dataProcessor("/Calendar/Save");
dp.init(scheduler);
dp.setTransactionMode("POST", false);
and then there is a CalendarController file with:
public ActionResult Data()
{
PencilsDataContext data = new PencilsDataContext();
return View(data.Events);
}
public ActionResult Save(Event changedEvent, FormCollection actionValues)
{
String action_type = actionValues["!nativeeditor_status"];
Int64 source_id = Int64.Parse(actionValues["id"]);
Int64 target_id = source_id;
PencilsDataContext data = new PencilsDataContext();
try
{
switch (action_type)
{
case "inserted":
changedEvent.event_details = actionValues["event_details"];
changedEvent.section2_id = 1;
data.Events.InsertOnSubmit(changedEvent);
break;
case "deleted":
changedEvent = data.Events.SingleOrDefault(ev => ev.event_id == source_id);
data.Events.DeleteOnSubmit(changedEvent);
break;
default: // "updated"
changedEvent = data.Events.SingleOrDefault(ev => ev.event_id == source_id);
changedEvent.event_details = actionValues["event_details"];
UpdateModel(changedEvent);
break;
}
data.SubmitChanges();
target_id = changedEvent.event_id;
}
catch
{
action_type = "error";
}
return View(new CalendarActionResponseModel(action_type, source_id, target_id));
}
I would REALLY appreciate an exmple of this using just straight forward .NET (non-mvc) code:
I have spent hours on hours trying to use the PHP examples to figure this out but I don’t use (nor ever have) PHP so I cannot relate the two together…
thanks,