Пример #1
0
        /// <summary>
        /// Update logic
        /// </summary>
        public override void update()
        {
            CswNbtMetaDataNodeType TimeNT = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "Unit (Time)" );
            if( null != TimeNT )
            {
                foreach( CswNbtObjClassUnitOfMeasure TimeNode in TimeNT.getNodes( false, false ) )
                {
                    if( "Months" == TimeNode.Name.Text )
                    {
                        //According to Google, 1 month = 30.4368 days (based on averages, I'm assuming)
                        TimeNode.ConversionFactor.Base = 3.285496;
                        TimeNode.ConversionFactor.Exponent = -2;
                        TimeNode.postChanges( false );
                    }
                }
            }

            CswNbtMetaDataObjectClass MaterialOc = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.MaterialClass );
            foreach( CswNbtMetaDataNodeType MaterialNt in MaterialOc.getNodeTypes() )
            {
                CswNbtMetaDataNodeTypeProp SpecificGravityNtp = MaterialNt.getNodeTypePropByObjectClassProp( CswNbtObjClassMaterial.PropertyName.SpecificGravity );
                if( null != SpecificGravityNtp )
                {
                    SpecificGravityNtp.Attribute1 = CswConvert.ToDbVal( true ).ToString();
                }
            }
        }
 /// <summary>
 /// Update logic
 /// </summary>
 public override void update()
 {
     CswNbtMetaDataObjectClass MaterialOc = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswNbtMetaDataObjectClass.NbtObjectClass.MaterialClass );
     foreach( CswNbtMetaDataNodeType MaterialNt in MaterialOc.getNodeTypes() )
     {
         MaterialNt.setNameTemplateText(
             CswNbtMetaData.MakeTemplateEntry( MaterialNt.getNodeTypePropByObjectClassProp( CswNbtObjClassMaterial.PropertyName.Tradename ).PropName ) + " " +
             CswNbtMetaData.MakeTemplateEntry( CswNbtObjClassMaterial.PropertyName.Supplier ) + " " +
             CswNbtMetaData.MakeTemplateEntry( CswNbtObjClassMaterial.PropertyName.PartNumber )
             );
     }
 }//Update()
Пример #3
0
        public override void update()
        {
            CswNbtMetaDataObjectClass ContainerOc = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswNbtMetaDataObjectClass.NbtObjectClass.ContainerClass );
            _CswNbtSchemaModTrnsctn.createObjectClassProp(
                ContainerOc, new CswNbtWcfMetaDataModel.ObjectClassProp
                {
                    FieldType = CswNbtMetaDataFieldType.NbtFieldType.Button,
                    PropName = CswNbtObjClassContainer.RequestPropertyName,
                    Extended = CswNbtNodePropButton.ButtonMode.menu,
                    ListOptions = CswNbtObjClassContainer.RequestMenu.Options.ToString(),
                    StaticText = CswNbtObjClassContainer.RequestMenu.Dispense
                } );

            foreach( CswNbtMetaDataNodeType ContainerNt in ContainerOc.getNodeTypes() )
            {
                CswNbtMetaDataNodeTypeTab RequestsTab = ContainerNt.getNodeTypeTab( "Requests" );
                if( null == RequestsTab )
                {
                    RequestsTab = _CswNbtSchemaModTrnsctn.MetaData.makeNewTab( ContainerNt, "Requests", ContainerNt.getNodeTypeTabIds().Count );
                }
                CswNbtMetaDataNodeTypeProp DispenseNtp = ContainerNt.getNodeTypePropByObjectClassProp( CswNbtObjClassContainer.RequestPropertyName );
                DispenseNtp.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, RequestsTab.TabId, 1, 1 );
                DispenseNtp.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Table, true, RequestsTab.TabId, 1, 1 );

                CswNbtMetaDataNodeTypeProp RequestsGridNtp = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( ContainerNt, CswNbtMetaDataFieldType.NbtFieldType.Grid, "Submitted Requests", RequestsTab.TabId );
                CswNbtView GridView = _CswNbtSchemaModTrnsctn.ViewSelect.restoreView( RequestsGridNtp.ViewId );
                makeRequestGridView( GridView, ContainerNt );
            }

            CswNbtMetaDataObjectClass MaterialOc = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswNbtMetaDataObjectClass.NbtObjectClass.MaterialClass );
            CswNbtMetaDataObjectClassProp MaterialRequestOcp = _CswNbtSchemaModTrnsctn.createObjectClassProp(
                MaterialOc, new CswNbtWcfMetaDataModel.ObjectClassProp
                {
                    FieldType = CswNbtMetaDataFieldType.NbtFieldType.Button,
                    PropName = CswNbtObjClassMaterial.RequestPropertyName
                } );
            foreach( CswNbtMetaDataNodeType MaterialNt in MaterialOc.getNodeTypes() )
            {
                CswNbtMetaDataNodeTypeTab IdentityTab = MaterialNt.getNodeTypeTab( "Identity" );
                if( null == IdentityTab )
                {
                    IdentityTab = _CswNbtSchemaModTrnsctn.MetaData.makeNewTab(MaterialNt, "Identity", MaterialNt.getNodeTypeTabIds().Count);
                }
                CswNbtMetaDataNodeTypeProp RequestBtnNtp = MaterialNt.getNodeTypePropByObjectClassProp( CswNbtObjClassMaterial.RequestPropertyName );
                RequestBtnNtp.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, IdentityTab.TabId );
            }

        }//Update()
 public override void update()
 {
     CswNbtMetaDataObjectClass MaterialOc = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswNbtMetaDataObjectClass.NbtObjectClass.MaterialClass );
     foreach( CswNbtMetaDataNodeType MaterialNt in MaterialOc.getNodeTypes() )
     {
         CswNbtMetaDataNodeTypeTab IdentityTab = MaterialNt.getNodeTypeTab( "Identity" );
         if( null == IdentityTab )
         {
             IdentityTab = _CswNbtSchemaModTrnsctn.MetaData.makeNewTab( MaterialNt, "Identity", MaterialNt.getNodeTypeTabIds().Count );
         }
         CswNbtMetaDataNodeTypeProp RequestBtnNtp = MaterialNt.getNodeTypePropByObjectClassProp( CswNbtObjClassMaterial.RequestPropertyName );
         RequestBtnNtp.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, IdentityTab.TabId );
         CswNbtMetaDataNodeTypeProp ReceiveBtnNtp = MaterialNt.getNodeTypePropByObjectClassProp( CswNbtObjClassMaterial.ReceivePropertyName );
         ReceiveBtnNtp.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, IdentityTab.TabId );
     }
 }//Update()
Пример #5
0
 public override void update()
 {
     CswNbtMetaDataObjectClass MaterialOc = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.MaterialClass );
     foreach( CswNbtMetaDataNodeType MaterialNt in MaterialOc.getLatestVersionNodeTypes() )
     {
         CswNbtMetaDataNodeTypeTab IdentityTab = MaterialNt.getIdentityTab();
         if( null != IdentityTab )
         {
             CswNbtMetaDataNodeTypeProp ReceiveNtp = MaterialNt.getNodeTypePropByObjectClassProp( CswNbtObjClassMaterial.PropertyName.Receive );
             ReceiveNtp.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, DoMove : false, DisplayColumn : 2, DisplayRow : 1, TabId : IdentityTab.TabId );
             CswNbtMetaDataNodeTypeProp RequestNtp = MaterialNt.getNodeTypePropByObjectClassProp( CswNbtObjClassMaterial.PropertyName.Request );
             RequestNtp.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, DoMove : false, DisplayColumn : 2, DisplayRow : 2, TabId : IdentityTab.TabId );
             CswNbtMetaDataNodeTypeProp PartNoNtp = MaterialNt.getNodeTypePropByObjectClassProp( CswNbtObjClassMaterial.PropertyName.PartNumber );
             PartNoNtp.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, DoMove : false, DisplayColumn : 1, DisplayRow : 1, TabId : IdentityTab.TabId );
             CswNbtMetaDataNodeTypeProp TradenameNtp = MaterialNt.getNodeTypePropByObjectClassProp( CswNbtObjClassMaterial.PropertyName.Tradename );
             TradenameNtp.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, DoMove : false, DisplayColumn : 1, DisplayRow : 2, TabId : IdentityTab.TabId );
             CswNbtMetaDataNodeTypeProp SupplierNtp = MaterialNt.getNodeTypePropByObjectClassProp( CswNbtObjClassMaterial.PropertyName.Supplier );
             SupplierNtp.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, DoMove : false, DisplayColumn : 1, DisplayRow : 3, TabId : IdentityTab.TabId );
         }
     }
 } //Update()