private bool HomePageRedirectExists()
 {
     var redirectionController = new RedirectionController();
     var homeRedirects = redirectionController.GetRedirectionsByPortal(ModuleContext.PortalId).Where(r => r.SourceTabId == ModuleContext.PortalSettings.HomeTabId);
     return (homeRedirects.Any());
 }
예제 #2
0
        private void lnkSave_OnClick(object sender, EventArgs e)
        {
                     
            var redirectionController = new RedirectionController();
            var name = txtRedirectName.Text;
            int nameCount;
            // Checks for duplicate names   
            if (RedirectId > Null.NullInteger)
            {
                nameCount = redirectionController.GetRedirectionsByPortal(ModuleContext.PortalId).Where(r =>( r.Id != RedirectId && r.Name.ToLower() == name.ToLower())).Count();
            }
            else
            {
                nameCount = redirectionController.GetRedirectionsByPortal(ModuleContext.PortalId).Where(r => r.Name.ToLower() == name.ToLower()).Count();
            }

            if (nameCount < 1)
            {
                SaveRedirection();
                Response.Redirect(Globals.NavigateURL("", "type=RedirectionSettings"), true);
            }
            else
            {
                DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("DuplicateNameError.Text", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError);                
            }            
        }