Beispiel #1
0
        protected void lbDeleteSelected_Click(object sender, EventArgs e)
        {
            GridView activeGridView = mvGridViews.GetActiveView() == vwGridViewsNotFound ? gvNotFound : gvUrlTracker;

            foreach (GridViewRow row in activeGridView.Rows.OfType <GridViewRow>().Where(x => x.RowType == DataControlRowType.DataRow))
            {
                CheckBox cbSelect = (CheckBox)row.FindControl("cbSelect");
                if (cbSelect.Checked)
                {
                    HiddenField hfId = row.FindControl("hfId") as HiddenField;
                    if (hfId != null)
                    {
                        UrlTrackerRepository.DeleteUrlTrackerEntry(int.Parse(hfId.Value));
                    }
                    else
                    {
                        HiddenField hfOldUrl = row.FindControl("hfOldUrl") as HiddenField;
                        if (hfOldUrl != null)
                        {
                            UrlTrackerRepository.DeleteNotFoundEntriesByOldUrl(hfOldUrl.Value);
                        }
                    }
                }
            }
            activeGridView.DataBind();
            if (activeGridView == gvNotFound && !UrlTrackerRepository.HasNotFoundEntries())
            {
                lbUrlTrackerView_Click(this, EventArgs.Empty);
                mvSwitchButtons.Visible = false;
            }
        }
Beispiel #2
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            if (!_earlyErrorDetected)
            {
                liDetails.Visible = mvUrlTracker.GetActiveView() == vwUrlTrackerDetail;
                liNew.Visible     = mvUrlTracker.GetActiveView() == vwUrlTrackerNew;

                bool hasNotFoundEntries = UrlTrackerRepository.HasNotFoundEntries();
                ltlNotFoundText.Visible  = mvSwitchButtons.Visible = hasNotFoundEntries;
                lbDeleteSelected.Visible = (_isNotFoundView ? gvNotFound : gvUrlTracker).Rows.Count > 0;

                mvUrlTrackerEntries.SetActiveView(vwUrlTrackerEntriesTable);
                pnlFilter.Visible = true;
                if (gvUrlTracker.Rows.Count == 0 && !_gridviewFiltered)
                {
                    mvUrlTrackerEntries.SetActiveView(vwUrlTrackerEntriesNone);
                    pnlFilter.Visible = false;
                }

                if (gvUrlTracker.PageSize != PageSize)
                {
                    gvUrlTracker.PageSize = PageSize;
                }
                if (gvNotFound.PageSize != PageSize)
                {
                    gvNotFound.PageSize = PageSize;
                }
                ddlPageSize.SelectedValue = PageSize.ToString();
            }
        }
Beispiel #3
0
        protected void gvNotFound_RowDeleted(object sender, GridViewDeletedEventArgs e)
        {
            if (!UrlTrackerRepository.HasNotFoundEntries())
            {
                lbUrlTrackerView_Click(this, EventArgs.Empty);
                mvSwitchButtons.Visible = false;
            }

            gvUrlTracker.DataBind();
            if (gvUrlTracker.Rows.Count == 0)
            {
                lbDeleteSelected.Visible = false;
            }
        }
Beispiel #4
0
 protected void lbSave_Click(object sender, EventArgs e)
 {
     if (icAdvancedView.Visible)
     {
         icAdvancedView.Save();
     }
     else
     {
         GetActiveView().Save();
     }
     pnlBreadcrumb.Visible = false;
     ResetViews();
     mvUrlTracker.SetActiveView(vwUrlTrackerOverview);
     gvUrlTracker.DataBind();
     gvNotFound.DataBind();
     if (mvGridViews.GetActiveView() == vwGridViewsNotFound && !UrlTrackerRepository.HasNotFoundEntries())
     {
         lbUrlTrackerView_Click(this, EventArgs.Empty);
         mvSwitchButtons.Visible = false;
     }
 }