MVC3 プロジェクトで DHTMLX Recurring イベントを実行する必要があります。定期的なイベントの場合、rec_type、event_pid などの追加の DB 値を格納および取得するようにコントローラー コードをセットアップする必要があります。
簡単なイベントの基本的なコーディングを行いました。しかし、定期的なイベントの書き方がわかりません。PHPでそれを示すデモサイト自体。これはチュートリアルのリンクです (ここ)。C#環境のロジックを教えてください。
シンプルイベントの作成・更新・削除
public ActionResult Save(Event changedEvent, FormCollection actionValues)
{
var a = "Z";
String action_type = actionValues["!nativeeditor_status"];
Int64 source_id = Int64.Parse(actionValues["id"]);
Int64 target_id = source_id;
string category = actionValues["category"];
string title = actionValues["title"];
string description = actionValues["text"];
if (actionValues["rec_type"] != "")
{
changedEvent.Rec_Type = actionValues["rec_type"];
}
else
changedEvent.Rec_Type = "";
if (actionValues["event_length"] != "")
{
changedEvent.Event_Length = Convert.ToInt32(actionValues["event_length"]);
}
else
changedEvent.Event_Length = 0;
if (actionValues["event_pid"] != "")
{
changedEvent.Event_Pid = Convert.ToInt16(actionValues["event_pid"]);
}
else
changedEvent.Event_Pid = 0;
String catg = category;
changedEvent.UserId = 1;
changedEvent.Category = catg;
changedEvent.Description = description;
changedEvent.Title = title;
try
{
switch (action_type)
{
case "inserted":
changedEvent.UserId = 1;
changedEvent.Category = catg;
db.Events.AddObject(changedEvent);
break;
case "deleted":
changedEvent = db.Events.SingleOrDefault(ev => ev.Id == source_id);
db.Events.DeleteObject(changedEvent);
break;
default: // "updated"
db.Events.Attach(changedEvent);
db.ObjectStateManager.ChangeObjectState(changedEvent, System.Data.EntityState.Modified);
db.SaveChanges();
break;
}
db.SaveChanges();
target_id = changedEvent.Id;
}
catch
{
action_type = "error";
}
return View(new CalendarActionResponseModel(action_type, source_id, target_id, catg));
}
ありがとう。