public void UpdateCalendarForContentItem( ContentItem item, EditCalendarPartViewModel model) { var calendarPart = item.As <CalendarPart>(); //calendarPart.Title = model.Title; calendarPart.Description = model.Description; calendarPart.ShortDescription = model.ShortDescription; calendarPart.FeedProxyUrl = model.FeedProxyUrl; _categoryService.UpdateCategoriesForCalendar(item, model.SelectedEventCategoryIds.Split(',')); }
public EditCalendarPartViewModel CreateEditViewModel(CalendarPart part) { //var settings = part.PartDefinition.Settings.GetModel<SharedEventCategorySettings>(); var data = new EditCalendarPartViewModel { Title = part.Title, Description = part.Description, ShortDescription = part.ShortDescription, FeedProxyUrl = part.FeedProxyUrl, Categories = GetCategoryEntries(part), SelectedEventCategoryIds = string.Join(",", _categoryService.GetEventCategoryIdentifiers(part.Categories.Select(x => x.Id))), }; return(data); }