Exemplo n.º 1
0
        public override void update()
        {
            // Remove the "Define Sizes for this Material" landing page item for the Create Material wizard
            // Originally added in CswUpdateSchema_01T_Case27881

            CswNbtLandingPageTable LandingPageObj = _CswNbtSchemaModTrnsctn.getLandingPageTable();
            string CreateMaterialActionId = _CswNbtSchemaModTrnsctn.Actions[CswEnumNbtActionName.Create_Material].ActionId.ToString();
            string RoleId = "nodes_1";
            CswNbtObjClassRole AdminRole = _CswNbtSchemaModTrnsctn.Nodes.makeRoleNodeFromRoleName( "Administrator" );
            if( null != AdminRole )
            {
                RoleId = AdminRole.NodeId.ToString();
            }

            LandingPageData Items = LandingPageObj.getLandingPageItems( new LandingPageData.Request()
                {
                    RoleId = RoleId,
                    ActionId = CreateMaterialActionId
                } );
            foreach( LandingPageData.LandingPageItem Item in Items.LandingPageItems )
            {
                if( Item.Text == "Define Sizes for this Material" )
                {
                    LandingPageObj.deleteLandingPageItem( new LandingPageData.Request()
                        {
                            LandingPageId = CswConvert.ToInt32( Item.LandingPageId )
                        } );
                }
            } // foreach
        } // update()
        /// <summary>
        /// Removes a LandingPage item from the specified LandingPage
        /// </summary>
        public static void deleteLandingPageItem(ICswResources CswResources, LandingPageItemsReturn Return, LandingPageData.Request Request)
        {
            CswNbtLandingPageTable _CswNbtLandingPageTable = new CswNbtLandingPageTable((CswNbtResources)CswResources);

            _CswNbtLandingPageTable.deleteLandingPageItem(Request);
        }