/// <summary> /// For creating a property filter /// </summary> public CswNbtViewPropertyFilter(CswNbtResources CswNbtResources, CswNbtView View, CswEnumNbtSubFieldName inSubFieldName, CswEnumNbtFilterMode inFilterMode, string inValue, CswEnumNbtFilterResultMode inResultMode, CswEnumNbtFilterConjunction PropertyFilterConjunction, bool inCaseSensitive = false, bool inShowAtRuntime = false) : base(CswNbtResources, View) { _constructor(CswNbtResources, View, inSubFieldName, inFilterMode, inValue, inResultMode, inCaseSensitive, inShowAtRuntime, PropertyFilterConjunction); }
private void _constructor(CswNbtResources CswNbtResources, CswNbtView View, CswEnumNbtSubFieldName inSubFieldName, CswEnumNbtFilterMode inFilterMode, string inValue, CswEnumNbtFilterResultMode inResultMode, bool inCaseSensitive, bool inShowAtRuntime, CswEnumNbtFilterConjunction inPropertyFilterConjunction) { SubfieldName = inSubFieldName; FilterMode = inFilterMode; Value = inValue; CaseSensitive = inCaseSensitive; ShowAtRuntime = inShowAtRuntime; ResultMode = inResultMode; Conjunction = inPropertyFilterConjunction; }
public static CswNbtView LocationPropertyView(CswNbtResources CswNbtResources, CswNbtMetaDataNodeTypeProp Prop, CswPrimaryKey NodeId = null, IEnumerable <CswPrimaryKey> InventoryGroupIds = null, CswEnumNbtFilterResultMode ResultMode = null, string FullPathFilter = "") { CswNbtMetaDataObjectClass ContainerOC = CswNbtResources.MetaData.getObjectClass(CswEnumNbtObjectClass.ContainerClass); CswNbtMetaDataObjectClass UserOC = CswNbtResources.MetaData.getObjectClass(CswEnumNbtObjectClass.UserClass); CswNbtMetaDataObjectClass RequestItemOC = CswNbtResources.MetaData.getObjectClass(CswEnumNbtObjectClass.RequestItemClass); //TODO (Case 31016): This is pretty hack-a-delic - we should convert these into prop attributes (like RespectAllowInventory, DisableLowestLevel, and IncludeRoot) bool IsLocationNode = (null != Prop && Prop.getNodeType().getObjectClass().ObjectClass == CswEnumNbtObjectClass.LocationClass); bool IsContainerNode = (null != Prop && null != ContainerOC && Prop.getNodeType().ObjectClassId == ContainerOC.ObjectClassId); bool IsUserNode = (null != Prop && null != UserOC && Prop.getNodeType().ObjectClassId == UserOC.ObjectClassId); bool IsRequestItemNode = (null != Prop && null != RequestItemOC && Prop.getNodeType().ObjectClassId == RequestItemOC.ObjectClassId); CswNbtView Ret = new CswNbtView(CswNbtResources); Ret.ViewName = GetTopLevelName(CswNbtResources); Ret.Root.Included = IsLocationNode; CswNbtObjClassLocation.makeLocationsTreeView(ref Ret, CswNbtResources, NodeIdToFilterOut: NodeId, RequireAllowInventory: (CswNbtResources.Modules.IsModuleEnabled(CswEnumNbtModuleName.Containers) && (IsContainerNode || IsUserNode || IsRequestItemNode)), InventoryGroupIds: InventoryGroupIds, DisableLowestLevel: IsLocationNode, ResultMode: ResultMode, FullPathFilter: FullPathFilter); return(Ret); }
private static void _makeLocationsTreeView(ref CswNbtView LocationsView, CswNbtMetaData MetaData, CswConfigurationVariables ConfigVbls, Int32 loc_max_depth, CswPrimaryKey NodeIdToFilterOut, bool RequireAllowInventory, IEnumerable <CswPrimaryKey> InventoryGroupIds, bool DisableLowestLevel, CswEnumNbtFilterResultMode ResultMode, string FullPathFilter = "") { if (null != LocationsView) { CswNbtMetaDataObjectClass LocationOC = MetaData.getObjectClass(CswEnumNbtObjectClass.LocationClass); CswNbtMetaDataObjectClassProp LocationLocationOCP = LocationOC.getObjectClassProp(PropertyName.Location); CswNbtMetaDataObjectClassProp LocationOrderOCP = LocationOC.getObjectClassProp(PropertyName.Order); CswNbtMetaDataObjectClassProp LocationAllowInventoryOCP = LocationOC.getObjectClassProp(PropertyName.AllowInventory); CswNbtMetaDataObjectClassProp LocationInventoryGroupOCP = LocationOC.getObjectClassProp(PropertyName.InventoryGroup); CswNbtMetaDataObjectClassProp LocationNameOCP = LocationOC.getObjectClassProp(PropertyName.Name); CswNbtMetaDataObjectClassProp LocationFullPathOCP = LocationOC.getObjectClassProp(PropertyName.FullPath); LocationsView.Root.ChildRelationships.Clear(); CswNbtViewRelationship LocReln = LocationsView.AddViewRelationship(LocationOC, true); LocationsView.AddViewProperty(LocReln, LocationLocationOCP); if (null != NodeIdToFilterOut) { LocReln.NodeIdsToFilterOut.Add(NodeIdToFilterOut); } CswNbtViewProperty InGroupVp = LocationsView.AddViewProperty(LocReln, LocationInventoryGroupOCP); InGroupVp.Width = 100; if (null != InventoryGroupIds) { CswCommaDelimitedString Pks = new CswCommaDelimitedString(); foreach (CswPrimaryKey InventoryGroupId in InventoryGroupIds) { Pks.Add(InventoryGroupId.PrimaryKey.ToString()); } LocationsView.AddViewPropertyFilter(InGroupVp, Conjunction: CswEnumNbtFilterConjunction.And, ResultMode: ResultMode, FilterMode: CswEnumNbtFilterMode.In, SubFieldName: CswNbtFieldTypeRuleRelationship.SubFieldName.NodeID, Value: Pks.ToString()); } CswNbtViewProperty OrderVPn = LocationsView.AddViewProperty(LocReln, LocationOrderOCP); LocationsView.setSortProperty(OrderVPn, CswEnumNbtViewPropertySortMethod.Ascending, false); if (RequireAllowInventory) { LocationsView.AddViewPropertyAndFilter(LocReln, LocationAllowInventoryOCP, Conjunction: CswEnumNbtFilterConjunction.And, ResultMode: ResultMode, FilterMode: CswEnumNbtFilterMode.Equals, Value: CswEnumTristate.True.ToString()); } // Filter on Full Path property if (false == string.IsNullOrEmpty(FullPathFilter)) { LocationsView.AddViewPropertyAndFilter(LocReln, LocationFullPathOCP, Conjunction: CswEnumNbtFilterConjunction.And, SubFieldName: CswEnumNbtSubFieldName.Value, FilterMode: CswEnumNbtFilterMode.Contains, Value: FullPathFilter); } else { LocationsView.AddViewProperty(LocReln, LocationFullPathOCP); } // Add the Name property to the view LocationsView.AddViewProperty(LocReln, LocationNameOCP); } // if( null != LocationsView ) } // makeLocationsTreeView()
public static void makeLocationsTreeView(ref CswNbtView LocationsView, CswNbtResources CswNbtResources, Int32 loc_max_depth = Int32.MinValue, CswPrimaryKey NodeIdToFilterOut = null, bool RequireAllowInventory = false, IEnumerable <CswPrimaryKey> InventoryGroupIds = null, bool DisableLowestLevel = false, CswEnumNbtFilterResultMode ResultMode = null, string FullPathFilter = "") { _makeLocationsTreeView(ref LocationsView, CswNbtResources.MetaData, CswNbtResources.ConfigVbls, loc_max_depth, NodeIdToFilterOut, RequireAllowInventory, InventoryGroupIds, DisableLowestLevel, ResultMode ?? CswEnumNbtFilterResultMode.Disabled, FullPathFilter); }