protected void rGrid_Delete(object sender, RowEventArgs e) { Rock.Model.Auth auth = authService.Get((int)rGrid.DataKeys[e.RowIndex]["id"]); if (auth != null) { authService.Delete(auth, CurrentPersonId); authService.Save(auth, CurrentPersonId); Authorization.ReloadAction(iSecured.TypeId, iSecured.Id, CurrentAction); } BindGrid(); }
protected void rGrid_Delete(object sender, RowEventArgs e) { var rockContext = new RockContext(); var authService = new Rock.Model.AuthService(rockContext); Rock.Model.Auth auth = authService.Get((int)rGrid.DataKeys[e.RowIndex]["id"]); if (auth != null) { authService.Delete(auth); rockContext.SaveChanges(); Authorization.ReloadAction(iSecured.TypeId, iSecured.Id, CurrentAction); } BindGrid(); }
/// <summary> /// Handles the Delete event of the rGrid control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RowEventArgs"/> instance containing the event data.</param> protected void rGrid_Delete( object sender, RowEventArgs e ) { var rockContext = new RockContext(); var authService = new Rock.Model.AuthService( rockContext ); Rock.Model.Auth auth = authService.Get( e.RowKeyId ); if ( auth != null ) { authService.Delete( auth ); rockContext.SaveChanges(); Authorization.ReloadAction( iSecured.TypeId, iSecured.Id, CurrentAction ); } BindGrid(); }