Beispiel #1
0
        public void afterCreateNodeTypeProp(CswNbtMetaDataNodeTypeProp NodeTypeProp)
        {
            //Case 53001 - grid properties need to have the the current NT set as the root
            CswNbtView propView = _CswNbtFieldResources.CswNbtResources.ViewSelect.restoreView(NodeTypeProp.ViewId);

            propView.SetViewMode(CswEnumNbtViewRenderingMode.Grid);
            propView.AddViewRelationship(NodeTypeProp.getNodeType(), true);
            propView.save();

            _CswNbtFieldTypeRuleDefault.afterCreateNodeTypeProp(NodeTypeProp);
        }
        public void afterCreateNodeTypeProp(CswNbtMetaDataNodeTypeProp NodeTypeProp)
        {
            //NodeTypeProp.ListOptions = "Yes,No,N/A";
            //NodeTypeProp.ValueOptions = "Yes";        // case 20297
            NodeTypeProp.DesignNode.AttributeProperty[AttributeName.PossibleAnswers].AsText.Text        = "Yes,No,N/A";
            NodeTypeProp.DesignNode.AttributeProperty[AttributeName.CompliantAnswers].AsMultiList.Value = new CswCommaDelimitedString()
            {
                "Yes"
            };
            // shouldn't need to do this?
            //NodeTypeProp.DesignNode.postChanges( false );

            _CswNbtFieldTypeRuleDefault.afterCreateNodeTypeProp(NodeTypeProp);
        }
        public void afterCreateNodeTypeProp(CswNbtMetaDataNodeTypeProp NodeTypeProp)
        {
            // Enforce only one Barcode property per nodetype
            CswTableSelect ProbeSelect          = _CswNbtFieldResources.CswNbtResources.makeCswTableSelect("barcode_check", "nodetype_props");
            Int32          ExistingBarcodeCount = ProbeSelect.getRecordCount("where nodetypeid=" + NodeTypeProp.NodeTypeId.ToString() +
                                                                             " and nodetypepropid <> " + NodeTypeProp.PropId +
                                                                             " and fieldtypeid=" + NodeTypeProp.FieldTypeId.ToString());

            if (ExistingBarcodeCount > 0)
            {
                throw (new CswDniException(CswEnumErrorType.Warning, "Nodetype already has a barcode", "Unable to add barcode node type property because the nodetype (" + NodeTypeProp.NodeTypeId.ToString() + ") already has a barcode"));
            }

            _CswNbtFieldTypeRuleDefault.afterCreateNodeTypeProp(NodeTypeProp);
        }
Beispiel #4
0
        public void afterCreateNodeTypeProp(CswNbtMetaDataNodeTypeProp NodeTypeProp)
        {
            //Schema Updater will trigger afterCreateNodeTypeProp(), but it won't call setFk
            //if( null != NodeTypeProp && null != NodeTypeProp.DesignNode )
            //{
            //    string FkType = NodeTypeProp.FKType;
            //    Int32 FkValue = NodeTypeProp.FKValue;

            //    if( false == string.IsNullOrEmpty( FkType ) &&
            //        Int32.MinValue != FkValue )
            //    {
            //        //NodeTypeProp.SetFK( FkType, FkValue );
            //        NodeTypeProp.DesignNode.AttributeProperty[AttributeName.Target].AsMetaDataList.setValue( FkType, FkValue );
            //        NodeTypeProp.DesignNode.postChanges( false );
            //    }
            _CswNbtFieldTypeRuleDefault.afterCreateNodeTypeProp(NodeTypeProp);
            //}
        }
        public void afterCreateNodeTypeProp(CswNbtMetaDataNodeTypeProp NodeTypeProp)
        {
            if (null != NodeTypeProp && null != NodeTypeProp.DesignNode)
            {
                string FkType  = NodeTypeProp.FKType;
                Int32  FkValue = NodeTypeProp.FKValue;

                if (false == string.IsNullOrEmpty(FkType) &&
                    Int32.MinValue != FkValue)
                {
                    //NodeTypeProp.SetFK( FkType, FkValue );
                    NodeTypeProp.DesignNode.AttributeProperty[AttributeName.UnitTarget].AsMetaDataList.setValue(FkType, FkValue);
                    NodeTypeProp.DesignNode.postChanges(false);
                }

                _CswNbtFieldTypeRuleDefault.afterCreateNodeTypeProp(NodeTypeProp);
            }
        }
Beispiel #6
0
        public void afterCreateNodeTypeProp(CswNbtMetaDataNodeTypeProp NodeTypeProp)
        {
            // Enforce only one Location property per nodetype
            foreach (CswNbtMetaDataNodeTypeProp OtherNodeTypeProp in _CswNbtFieldResources.CswNbtResources.MetaData.getNodeTypeProps(NodeTypeProp.NodeTypeId))
            {
                if (OtherNodeTypeProp != NodeTypeProp &&
                    OtherNodeTypeProp.getFieldTypeValue() == CswEnumNbtFieldType.Location)
                {
                    throw (new CswDniException(CswEnumErrorType.Warning, "Nodetype already has a location", "Unable to add location node type property because the nodetype (" + NodeTypeProp.NodeTypeId.ToString() + ") already has a location"));
                }
            }

            // Locations have fixed fk relationship fields:
            if (null != NodeTypeProp.DesignNode)
            {
                Int32 LocationObjectClassId = _CswNbtFieldResources.CswNbtResources.MetaData.getObjectClass(CswEnumNbtObjectClass.LocationClass).ObjectClassId;
                //NodeTypeProp.SetFK( CswEnumNbtViewRelatedIdType.ObjectClassId.ToString(), LocationObjectClassId, string.Empty, Int32.MinValue );
                NodeTypeProp.DesignNode.AttributeProperty[AttributeName.FKType].AsText.Text     = CswEnumNbtViewRelatedIdType.ObjectClassId.ToString();
                NodeTypeProp.DesignNode.AttributeProperty[AttributeName.FKValue].AsNumber.Value = LocationObjectClassId;
                NodeTypeProp.DesignNode.postChanges(false);
            }
            _CswNbtFieldTypeRuleDefault.afterCreateNodeTypeProp(NodeTypeProp);
        }
Beispiel #7
0
 public void afterCreateNodeTypeProp(CswNbtMetaDataNodeTypeProp NodeTypeProp)
 {
     _CswNbtFieldTypeRuleDefault.afterCreateNodeTypeProp(NodeTypeProp);
 }