/// <summary>
        /// Handles the Click event of the DeleteConnectionOpportunity control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Rock.Web.UI.Controls.RowEventArgs" /> instance containing the event data.</param>
        protected void DeleteConnectionOpportunity_Click(object sender, Rock.Web.UI.Controls.RowEventArgs e)
        {
            using (RockContext rockContext = new RockContext())
            {
                ConnectionOpportunityService connectionOpportunityService = new ConnectionOpportunityService(rockContext);
                ConnectionOpportunity        connectionOpportunity        = connectionOpportunityService.Get(e.RowKeyId);
                if (connectionOpportunity != null)
                {
                    if (_canEdit || connectionOpportunity.IsAuthorized(Authorization.EDIT, CurrentPerson))
                    {
                        string errorMessage;
                        if (!connectionOpportunityService.CanDelete(connectionOpportunity, out errorMessage))
                        {
                            mdGridWarning.Show(errorMessage, ModalAlertType.Information);
                            return;
                        }

                        int connectionTypeId = connectionOpportunity.ConnectionTypeId;
                        connectionOpportunityService.Delete(connectionOpportunity);
                        rockContext.SaveChanges();

                        ConnectionWorkflowService.RemoveCachedTriggers();
                    }
                    else
                    {
                        mdGridWarning.Show("You are not authorized to delete this calendar item", ModalAlertType.Warning);
                    }
                }
            }
            BindConnectionOpportunitiesGrid();
        }
        /// <summary>
        /// Returns breadcrumbs specific to the block that should be added to navigation
        /// based on the current page reference.  This function is called during the page's
        /// oninit to load any initial breadcrumbs.
        /// </summary>
        /// <param name="pageReference">The <see cref="Rock.Web.PageReference" />.</param>
        /// <returns>
        /// A <see cref="System.Collections.Generic.List{BreadCrumb}" /> of block related <see cref="Rock.Web.UI.BreadCrumb">BreadCrumbs</see>.
        /// </returns>
        public override List <BreadCrumb> GetBreadCrumbs(PageReference pageReference)
        {
            var breadCrumbs = new List <BreadCrumb>();

            int?opportunityId = PageParameter(pageReference, "OpportunityId").AsIntegerOrNull();

            if (opportunityId != null)
            {
                _connectionOpportunity = new ConnectionOpportunityService(new RockContext()).Get(opportunityId.Value);
                if (_connectionOpportunity != null && _connectionOpportunity.IsAuthorized(Authorization.VIEW, CurrentPerson))
                {
                    breadCrumbs.Add(new BreadCrumb(_connectionOpportunity.Name, pageReference));
                }
                else
                {
                    _connectionOpportunity = null;
                }
            }

            return(breadCrumbs);
        }