protected void DeleteGroupTodoList() { Ektron.Cms.Framework.ToDo.TodoList todoListApi = new Ektron.Cms.Framework.ToDo.TodoList(); TodoListData todoListData = GetGroupTodoList(); if (todoListData != null) { todoListApi.Delete(todoListData.Id); } }
protected TodoListData GetGroupTodoList() { Ektron.Cms.Framework.ToDo.TodoList todoListApi = new Ektron.Cms.Framework.ToDo.TodoList(); TodoListCriteria criteria = new TodoListCriteria(); criteria.AddFilter(TodoListProperty.ObjectType, CriteriaFilterOperator.EqualTo, EkEnumeration.CMSObjectTypes.CommunityGroup); criteria.AddFilter(TodoListProperty.ObjectId, CriteriaFilterOperator.EqualTo, this.m_iID); List<TodoListData> list = todoListApi.GetList(criteria); if (list.Count > 0) { return list[0]; } else { return null; } }
protected void AddGroupTodoList() { Ektron.Cms.Framework.ToDo.TodoList todoListApi = new Ektron.Cms.Framework.ToDo.TodoList(); TodoListData todoListData = GetGroupTodoList(); //if todo list doesnt exist, add it if (todoListData == null) { todoListData = new Ektron.Cms.ToDo.TodoListData() { Name = this.GroupName_TB.Text, ObjectType = Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.CommunityGroup, ObjectId = this.m_iID }; todoListApi.Add(todoListData); } }