当前位置: 首页>>代码示例>>C#>>正文


C# PortalAliasController.DeletePortalAlias方法代码示例

本文整理汇总了C#中DotNetNuke.Entities.Portals.PortalAliasController.DeletePortalAlias方法的典型用法代码示例。如果您正苦于以下问题:C# PortalAliasController.DeletePortalAlias方法的具体用法?C# PortalAliasController.DeletePortalAlias怎么用?C# PortalAliasController.DeletePortalAlias使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DotNetNuke.Entities.Portals.PortalAliasController的用法示例。


在下文中一共展示了PortalAliasController.DeletePortalAlias方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeleteAlias

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// DeleteAlias runs when a delete button is clicked
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// 	[cnurse]	12/12/2008  Created
        /// </history>
        /// -----------------------------------------------------------------------------
        private void DeleteAlias(object source, DataGridCommandEventArgs e)
        {
            var controller = new PortalAliasController();

            //Get the index of the row to delete
            int index = e.Item.ItemIndex;

            //Remove the alias from the aliases collection
            var portalAlias = (PortalAliasInfo) Aliases[index];
            controller.DeletePortalAlias(portalAlias.PortalAliasID);
            //should remove the portal's folder if exist
            var portalFolder = PortalController.GetPortalFolder(portalAlias.HTTPAlias);
            var serverPath = Globals.GetAbsoluteServerPath(Request);
            if(!string.IsNullOrEmpty(portalFolder) && Directory.Exists(serverPath + portalFolder))
            {
                PortalController.DeletePortalFolder(serverPath, portalFolder);
            }
            //Rebind the collection
            _Aliases = null;
            BindAliases();
        }
开发者ID:goedings,项目名称:VendorLink,代码行数:31,代码来源:PortalAliases.ascx.cs

示例2: DeleteAlias

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// DeleteAlias runs when a delete button is clicked
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// 	[cnurse]	12/12/2008  Created
        /// </history>
        /// -----------------------------------------------------------------------------
        private void DeleteAlias(object source, DataGridCommandEventArgs e)
        {
            var controller = new PortalAliasController();

            //Get the index of the row to delete
            int index = e.Item.ItemIndex;

            //Remove the alias from the aliases collection
            var portalAlias = (PortalAliasInfo) Aliases[index];
            controller.DeletePortalAlias(portalAlias.PortalAliasID);

            //Rebind the collection
            _Aliases = null;
            BindAliases();
        }
开发者ID:rickfox,项目名称:Steves,代码行数:25,代码来源:PortalAliases.ascx.cs

示例3: cmdDelete_Click

        /// <summary>
        /// cmdDelete_Click runs when the Delete button is clicked
        /// </summary>
        /// <history>
        /// 	[cnurse]	01/17/2005	documented
        /// </history>
        protected void cmdDelete_Click( Object sender, EventArgs e )
        {
            try
            {
                int intPortalAliasID;
                intPortalAliasID = Convert.ToInt32( ViewState["PortalAliasID"] );
                PortalAliasInfo objPortalAliasInfo;
                PortalAliasController p = new PortalAliasController();
                objPortalAliasInfo = p.GetPortalAliasByPortalAliasID( intPortalAliasID );

                if( ! UserInfo.IsSuperUser )
                {
                    if( objPortalAliasInfo.PortalID != PortalSettings.PortalId )
                    {
                        UI.Skins.Skin.AddModuleMessage( this, Localization.GetString( "AccessDenied", this.LocalResourceFile ), ModuleMessageType.RedError );
                        return;
                    }
                }
                p.DeletePortalAlias( intPortalAliasID );

                Response.Redirect( Convert.ToString( ViewState["UrlReferrer"] ), true );
            }
            catch( Exception exc ) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException( this, exc );
            }
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:33,代码来源:EditPortalAlias.ascx.cs


注:本文中的DotNetNuke.Entities.Portals.PortalAliasController.DeletePortalAlias方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。