Example #1
0
 public void Save()
 {
     UrlTrackerModel.Is404    = false;
     UrlTrackerModel.Referrer = string.Empty;
     if (!string.IsNullOrEmpty(cpRedirectNode.Value))
     {
         UrlTrackerModel.RedirectNodeId = int.Parse(cpRedirectNode.Value);
     }
     else
     {
         UrlTrackerModel.RedirectNodeId = null;
     }
     UrlTrackerModel.RedirectUrl      = tbRedirectUrl.Text;
     UrlTrackerModel.RedirectHttpCode = rbPermanent.Checked ? 301 : 302;
     UrlTrackerModel.RedirectPassThroughQueryString = cbRedirectPassthroughQueryString.Checked;
     UrlTrackerModel.Notes = tbNotes.Text;
     UrlTrackerRepository.UpdateUrlTrackerEntry(UrlTrackerModel);
     UrlTrackerRepository.DeleteNotFoundEntriesByRootAndOldUrl(UrlTrackerModel.RedirectRootNodeId, UrlTrackerModel.OldUrl);
 }
Example #2
0
        public void Save()
        {
            List <UrlTrackerDomain> domains = UmbracoHelper.GetDomains();

            UrlTrackerModel.OldUrl             = UrlTrackerHelper.ResolveShortestUrl(tbOldUrl.Text);
            UrlTrackerModel.OldUrlQueryString  = tbOldUrlQueryString.Text;
            UrlTrackerModel.OldRegex           = tbOldRegex.Text;
            UrlTrackerModel.RedirectRootNodeId = domains.Count > 1 ? int.Parse(ddlRootNode.SelectedValue) : domains.Any() ? domains.Single().NodeId : new Node(-1).ChildrenAsList.First().Id;
            if (!string.IsNullOrEmpty(cpRedirectNode.Value))
            {
                UrlTrackerModel.RedirectNodeId = int.Parse(cpRedirectNode.Value);
            }
            else
            {
                UrlTrackerModel.RedirectNodeId = null;
            }
            UrlTrackerModel.RedirectUrl      = tbRedirectUrl.Text;
            UrlTrackerModel.RedirectHttpCode = rbPermanent.Checked ? 301 : 302;
            UrlTrackerModel.RedirectPassThroughQueryString = cbRedirectPassthroughQueryString.Checked;
            UrlTrackerModel.ForceRedirect = cbForceRedirect.Checked;
            UrlTrackerModel.Notes         = tbNotes.Text;
            UrlTrackerRepository.UpdateUrlTrackerEntry(UrlTrackerModel);
        }
Example #3
0
 public void Save()
 {
     UrlTrackerModel.RedirectHttpCode = rbPermanent.Checked ? 301 : 302;
     UrlTrackerModel.RedirectPassThroughQueryString = cbRedirectPassthroughQueryString.Checked;
     UrlTrackerRepository.UpdateUrlTrackerEntry(UrlTrackerModel);
 }