示例#1
0
        private void gList_GridReorder(object sender, GridReorderEventArgs e)
        {
            var            rockContext    = new RockContext();
            ChapterService chapterService = new ChapterService(rockContext);
            var            courseId       = PageParameter(PageParameterKey.CourseId).AsInteger();
            var            items          = chapterService.Queryable().Where(p => p.CourseId == courseId).OrderBy(i => i.Order).ToList();

            chapterService.Reorder(items, e.OldIndex, e.NewIndex);
            rockContext.SaveChanges();
            BindGrid();
        }