Example #1
0
        } // _addSystemViewPropFilter()

        private void _addSystemViewBarcodeFilter(object FilterValue, CswEnumNbtFilterMode FilterMode = null, CswEnumNbtFieldType FieldType = null)
        {
            FilterMode = FilterMode ?? CswEnumNbtFilterMode.Contains;
            foreach (CswNbtViewRelationship RootLevelRelationship in _NbtSystemView.SystemView.Root.ChildRelationships)
            {
                //CswNbtMetaDataObjectClass InstanceOc = null;
                //CswNbtMetaDataObjectClassProp BarcodeOcp = null;

                //if( NbtViewRelatedIdType.ObjectClassId == RootLevelRelationship.SecondType )
                //{
                //    InstanceOc = _CswNbtResources.MetaData.getObjectClass( RootLevelRelationship.SecondId );
                //    if( null != InstanceOc )
                //    {
                //        BarcodeOcp = (CswNbtMetaDataObjectClassProp) InstanceOc.getBarcodeProperty();

                //    }
                //}
                //else if( NbtViewRelatedIdType.NodeTypeId == RootLevelRelationship.SecondType )
                //{
                //    CswNbtMetaDataNodeType InstanceNt = _CswNbtResources.MetaData.getNodeType( RootLevelRelationship.SecondId );
                //    if( null != InstanceNt )
                //    {
                //        InstanceOc = InstanceNt.getObjectClass();
                //        CswNbtMetaDataNodeTypeProp BarcodeNtp = (CswNbtMetaDataNodeTypeProp) InstanceNt.getBarcodeProperty();
                //        if( null != BarcodeNtp )
                //        {
                //            BarcodeOcp = BarcodeNtp.getObjectClassProp();
                //        }
                //    }
                //}
                //else if( NbtViewRelatedIdType.PropertySetId == RootLevelRelationship.SecondType )
                //{
                //    // Not much we can do...
                //}

                ICswNbtMetaDataDefinitionObject secondObj   = _CswNbtResources.MetaData.getDefinitionObject(RootLevelRelationship.SecondType, RootLevelRelationship.SecondId);
                ICswNbtMetaDataProp             BarcodeProp = secondObj.getBarcodeProperty();

                if (null != BarcodeProp && null != secondObj)
                {
                    string FilterValueString = CswConvert.ToString(FilterValue);
                    CswNbtActSystemViews.SystemViewPropFilterDefinition ViewPropertyFilter = _NbtSystemView.makeSystemViewFilter(BarcodeProp, FilterValueString, FilterMode, FieldType: FieldType);
                    _NbtSystemView.addSystemViewFilter(ViewPropertyFilter, secondObj);
                }
            }
        } // _addSystemViewBarcodeFilter()
Example #2
0
 private void _addSystemViewPropFilter(CswEnumNbtObjectClass ObjectClass, string PropertyName, object FilterValue, CswEnumNbtFilterMode FilterMode = null, CswEnumNbtFieldType FieldType = null)
 {
     if (ObjectClass != CswNbtResources.UnknownEnum)
     {
         FilterMode = FilterMode ?? CswEnumNbtFilterMode.Contains;
         CswNbtMetaDataObjectClass InstanceOc = _CswNbtResources.MetaData.getObjectClass(ObjectClass);
         if (null != InstanceOc)
         {
             CswNbtMetaDataObjectClassProp InstancePropertyOcp = InstanceOc.getObjectClassProp(PropertyName);
             if (null != InstancePropertyOcp)
             {
                 string FilterValueString = CswConvert.ToString(FilterValue);
                 CswNbtActSystemViews.SystemViewPropFilterDefinition ViewPropertyFilter = _NbtSystemView.makeSystemViewFilter(InstancePropertyOcp, FilterValueString, FilterMode, FieldType: FieldType);
                 _NbtSystemView.addSystemViewFilter(ViewPropertyFilter, InstanceOc);
             }
         }
     }
 } // _addSystemViewPropFilter()