Kentico Xperience Event - 如何添加新活动

Kentico Xperience Event - how to add new event

Kentico 13 MVC 核心站点构建

成功安装:

正在 Intranet 场景中使用事件。寻找允许员工在不登录 Kentico CMS 的情况下向日历添加新事件的最佳方法。 (类似于Kentico 12 CMS门户引擎中的活动预订系统)

我在日历下方创建了一个带有事件字段的表单,但无法找到将填充以下所有内容的插入语句 table:

仅供参考:第一个 MVC 核心项目

提前致谢

查看 NuGet 包中包含的 page type classes and providers,您可以使用以下代码在事件日历页面下插入新页面。

        var parentPage = EventCalendarProvider.GetEventCalendars()
            .TopN(1)
            .Culture("en-GB")
            .Published()
            .LatestVersion()
            .FirstOrDefault();

        var newEvent = new Event
        {
            EventName = "Test Event",
            EventSummary = "Summary Text",
            EventDescription = "Test Description",
            EventLocation = "Somewhere",
            EventStart = DateTime.Now,
            EventIsAllDay = true,

            // ...etc for the rest of the properties coming from the Kentico Form you've created.
        };

        newEvent.Insert(parentPage);

如果你还没有探索过它,你可以使用BizFormItemEvents拦截表单提交并使用上面的代码插入一个页面。