void gPersonBadge_GridReorder( object sender, GridReorderEventArgs e )
        {
            var rockContext = new RockContext();
            var service = new PersonBadgeService( rockContext );
            var badges = service.Queryable().OrderBy( b => b.Order );
            service.Reorder( badges.ToList(), e.OldIndex, e.NewIndex );
            rockContext.SaveChanges();

            BindGrid();
        }
Ejemplo n.º 2
0
        void gPersonBadge_GridReorder( object sender, GridReorderEventArgs e )
        {
            var rockContext = new RockContext();
            var service = new PersonBadgeService( rockContext );
            var personBadges = service.Queryable().OrderBy( b => b.Order );
            service.Reorder( personBadges.ToList(), e.OldIndex, e.NewIndex );
            rockContext.SaveChanges();

            foreach ( var personBadge in personBadges )
            {
                PersonBadgeCache.Flush( personBadge.Id );
            }

            BindGrid();
        }