private CswNbtView _getReconciliationScansForOutOfScopeContainersView(ContainerData.ReconciliationRequest Request) { Collection <CswPrimaryKey> LocationIds = _getLocationIds(Request); CswNbtMetaDataObjectClass LocationOC = _CswNbtResources.MetaData.getObjectClass(CswEnumNbtObjectClass.LocationClass); CswNbtMetaDataObjectClass ContainerOC = _CswNbtResources.MetaData.getObjectClass(CswEnumNbtObjectClass.ContainerClass); CswNbtMetaDataObjectClassProp CLocationOCP = ContainerOC.getObjectClassProp(CswNbtObjClassContainer.PropertyName.Location); CswNbtMetaDataObjectClass ContainerLocationOC = _CswNbtResources.MetaData.getObjectClass(CswEnumNbtObjectClass.ContainerLocationClass); CswNbtMetaDataObjectClassProp ContainerOCP = ContainerLocationOC.getObjectClassProp(CswNbtObjClassContainerLocation.PropertyName.Container); CswNbtMetaDataObjectClassProp TypeOCP = ContainerLocationOC.getObjectClassProp(CswNbtObjClassContainerLocation.PropertyName.Type); CswNbtMetaDataObjectClassProp LocationOCP = ContainerLocationOC.getObjectClassProp(CswNbtObjClassContainerLocation.PropertyName.Location); CswNbtMetaDataObjectClassProp ScanDateOCP = ContainerLocationOC.getObjectClassProp(CswNbtObjClassContainerLocation.PropertyName.ScanDate); CswNbtView ContainerLocationsView = new CswNbtView(_CswNbtResources); //Filter to selected location (and all child locations if applicable) CswNbtViewRelationship LocationVR = ContainerLocationsView.AddViewRelationship(LocationOC, false); LocationVR.NodeIdsToFilterIn = LocationIds; CswCommaDelimitedString LocIds = new CswCommaDelimitedString(); foreach (CswPrimaryKey LocId in LocationIds) { LocIds.Add(LocId.PrimaryKey.ToString()); } //Filter to Container Location records of type Reconcile Scans in the current time scope CswNbtViewRelationship ContainerLocationVR = ContainerLocationsView.AddViewRelationship(LocationVR, CswEnumNbtViewPropOwnerType.Second, LocationOCP, false); CswNbtViewProperty TypeVP = ContainerLocationsView.AddViewProperty(ContainerLocationVR, TypeOCP); ContainerLocationsView.AddViewPropertyFilter(TypeVP, FilterMode: CswEnumNbtFilterMode.Equals, Value: CswEnumNbtContainerLocationTypeOptions.ReconcileScans.ToString()); CswNbtViewProperty ScanDateVP = ContainerLocationsView.AddViewProperty(ContainerLocationVR, ScanDateOCP); if (CswConvert.ToDateTime(Request.StartDate) > CswConvert.ToDateTime(Request.EndDate)) { Request.StartDate = Request.EndDate; } ContainerLocationsView.AddViewPropertyFilter(ScanDateVP, FilterMode: CswEnumNbtFilterMode.GreaterThanOrEquals, Value: Request.StartDate); ContainerLocationsView.AddViewPropertyFilter(ScanDateVP, FilterMode: CswEnumNbtFilterMode.LessThanOrEquals, Value: Request.EndDate); ContainerLocationsView.setSortProperty(ScanDateVP, CswEnumNbtViewPropertySortMethod.Descending); //Filter to Containers not matching current location scope CswNbtViewRelationship ContainerVR = ContainerLocationsView.AddViewRelationship(ContainerLocationVR, CswEnumNbtViewPropOwnerType.First, ContainerOCP, false); CswNbtViewProperty CLocVP = ContainerLocationsView.AddViewProperty(ContainerVR, CLocationOCP); ContainerLocationsView.AddViewPropertyFilter(CLocVP, CswEnumNbtSubFieldName.NodeID, CswEnumNbtFilterMode.In, LocIds.ToString()); return(ContainerLocationsView); }
private static ICswNbtTree _getPendingBatchOpsTree(CswNbtResources CswNbtResources) { CswNbtMetaDataObjectClass BatchOpOC = CswNbtResources.MetaData.getObjectClass(CswEnumNbtObjectClass.BatchOpClass); CswNbtMetaDataObjectClassProp StatusOCP = BatchOpOC.getObjectClassProp(CswNbtObjClassBatchOp.PropertyName.Status); CswNbtMetaDataObjectClassProp PriorityOCP = BatchOpOC.getObjectClassProp(CswNbtObjClassBatchOp.PropertyName.Priority); CswNbtView NextBatchOpView = new CswNbtView(CswNbtResources); CswNbtViewRelationship BatchVR = NextBatchOpView.AddViewRelationship(BatchOpOC, false); CswNbtViewProperty StatusVP = NextBatchOpView.AddViewProperty(BatchVR, StatusOCP); NextBatchOpView.AddViewPropertyFilter(StatusVP, FilterMode: CswEnumNbtFilterMode.NotEquals, Value: CswEnumNbtBatchOpStatus.Completed.ToString()); NextBatchOpView.AddViewPropertyFilter(StatusVP, FilterMode: CswEnumNbtFilterMode.NotEquals, Value: CswEnumNbtBatchOpStatus.Error.ToString()); NextBatchOpView.AddViewPropertyFilter(StatusVP, FilterMode: CswEnumNbtFilterMode.NotEquals, Value: CswEnumNbtBatchOpStatus.Unknown.ToString()); CswNbtViewProperty PriorityVP = NextBatchOpView.AddViewProperty(BatchVR, PriorityOCP); NextBatchOpView.setSortProperty(PriorityVP, CswEnumNbtViewPropertySortMethod.Descending); ICswNbtTree BatchOpTree = CswNbtResources.Trees.getTreeFromView(NextBatchOpView, false, true, false); return(BatchOpTree); }
private double _getQuantityToAdd(CswNbtResources _CswNbtResources, CswPrimaryKey ContainerId, CswNbtMetaDataObjectClass ContainerDispTransOC) { double Qty = 0.0; CswNbtMetaDataObjectClassProp CDTContainerOCP = ContainerDispTransOC.getObjectClassProp(CswNbtObjClassContainerDispenseTransaction.PropertyName.DestinationContainer); CswNbtMetaDataObjectClassProp CDTDispensedDateOCP = ContainerDispTransOC.getObjectClassProp(CswNbtObjClassContainerDispenseTransaction.PropertyName.DispensedDate); CswNbtView CDTView = new CswNbtView(_CswNbtResources); CswNbtViewRelationship CDTRel = CDTView.AddViewRelationship(ContainerDispTransOC, false); CDTView.AddViewPropertyAndFilter(CDTRel, CDTContainerOCP, CswEnumNbtFilterConjunction.And, ContainerId.PrimaryKey.ToString(), CswEnumNbtSubFieldName.NodeID, false, CswEnumNbtFilterMode.Equals); CswNbtViewProperty DispensedDateVP = CDTView.AddViewProperty(CDTRel, CDTDispensedDateOCP); CDTView.setSortProperty(DispensedDateVP, CswEnumNbtViewPropertySortMethod.Ascending); ICswNbtTree CDTTree = _CswNbtResources.Trees.getTreeFromView(CDTView, false, false, true); CDTTree.goToRoot(); if (CDTTree.getChildNodeCount() > 0) { CDTTree.goToNthChild(0); CswNbtObjClassContainerDispenseTransaction ContDispTransNode = CDTTree.getNodeForCurrentPosition(); Qty = ContDispTransNode.QuantityDispensed.Quantity + ContDispTransNode.RemainingSourceContainerQuantity.Quantity; } return(Qty); }
private CswNbtView _getReconciliationView(ContainerData.ReconciliationRequest Request) { Collection <CswPrimaryKey> LocationIds = _getLocationIds(Request); CswNbtMetaDataObjectClass LocationOC = _CswNbtResources.MetaData.getObjectClass(CswEnumNbtObjectClass.LocationClass); CswNbtMetaDataObjectClass ContainerOC = _CswNbtResources.MetaData.getObjectClass(CswEnumNbtObjectClass.ContainerClass); CswNbtMetaDataObjectClassProp LocationOCP = ContainerOC.getObjectClassProp(CswNbtObjClassContainer.PropertyName.Location); CswNbtMetaDataObjectClassProp DateCreatedOCP = ContainerOC.getObjectClassProp(CswNbtObjClassContainer.PropertyName.DateCreated); CswNbtMetaDataObjectClassProp DisposedOCP = ContainerOC.getObjectClassProp(CswNbtObjClassContainer.PropertyName.Disposed); CswNbtMetaDataObjectClass ContainerLocationOC = _CswNbtResources.MetaData.getObjectClass(CswEnumNbtObjectClass.ContainerLocationClass); CswNbtMetaDataObjectClassProp ContainerOCP = ContainerLocationOC.getObjectClassProp(CswNbtObjClassContainerLocation.PropertyName.Container); CswNbtMetaDataObjectClassProp ScanDateOCP = ContainerLocationOC.getObjectClassProp(CswNbtObjClassContainerLocation.PropertyName.ScanDate); CswNbtView ContainersView = new CswNbtView(_CswNbtResources); CswNbtViewRelationship LocationVR = ContainersView.AddViewRelationship(LocationOC, false); LocationVR.NodeIdsToFilterIn = LocationIds; CswNbtViewRelationship ContainerVR = ContainersView.AddViewRelationship(LocationVR, CswEnumNbtViewPropOwnerType.Second, LocationOCP, false); CswNbtViewProperty DateCreatedVP = ContainersView.AddViewProperty(ContainerVR, DateCreatedOCP); ContainersView.AddViewPropertyFilter(DateCreatedVP, FilterMode: CswEnumNbtFilterMode.LessThanOrEquals, Value: Request.EndDate); CswNbtViewProperty DisposedVP = ContainersView.AddViewProperty(ContainerVR, DisposedOCP); CswNbtViewRelationship ContainerLocationVR = ContainersView.AddViewRelationship(ContainerVR, CswEnumNbtViewPropOwnerType.Second, ContainerOCP, false); CswNbtViewProperty ScanDateVP = ContainersView.AddViewProperty(ContainerLocationVR, ScanDateOCP); if (CswConvert.ToDateTime(Request.StartDate) > CswConvert.ToDateTime(Request.EndDate)) { Request.StartDate = Request.EndDate; } ContainersView.AddViewPropertyFilter(ScanDateVP, FilterMode: CswEnumNbtFilterMode.GreaterThanOrEquals, Value: Request.StartDate); ContainersView.AddViewPropertyFilter(ScanDateVP, FilterMode: CswEnumNbtFilterMode.LessThanOrEquals, Value: Request.EndDate); ContainersView.setSortProperty(ScanDateVP, CswEnumNbtViewPropertySortMethod.Descending); return(ContainersView); }
public override void update() { // Make the Batch Operation Object Class and default NodeType CswNbtMetaDataObjectClass BatchOpOC = _CswNbtSchemaModTrnsctn.createObjectClass( CswNbtMetaDataObjectClass.NbtObjectClass.BatchOpClass, "clock.gif", false, false ); CswNbtMetaDataObjectClass UserOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswNbtMetaDataObjectClass.NbtObjectClass.UserClass ); CswCommaDelimitedString StatusOptions = new CswCommaDelimitedString() { NbtBatchOpStatus.Pending.ToString(), NbtBatchOpStatus.Processing.ToString(), NbtBatchOpStatus.Completed.ToString(), NbtBatchOpStatus.Error.ToString() }; CswNbtMetaDataObjectClassProp BatchDataOCP = _CswNbtSchemaModTrnsctn.createObjectClassProp( CswNbtMetaDataObjectClass.NbtObjectClass.BatchOpClass, CswNbtObjClassBatchOp.BatchDataPropertyName, CswNbtMetaDataFieldType.NbtFieldType.Memo, ServerManaged: true ); CswNbtMetaDataObjectClassProp EndDateOCP = _CswNbtSchemaModTrnsctn.createObjectClassProp( CswNbtMetaDataObjectClass.NbtObjectClass.BatchOpClass, CswNbtObjClassBatchOp.EndDatePropertyName, CswNbtMetaDataFieldType.NbtFieldType.DateTime, ServerManaged: true ); CswNbtMetaDataObjectClassProp LogOCP = _CswNbtSchemaModTrnsctn.createObjectClassProp( CswNbtMetaDataObjectClass.NbtObjectClass.BatchOpClass, CswNbtObjClassBatchOp.LogPropertyName, CswNbtMetaDataFieldType.NbtFieldType.Comments, ServerManaged: true ); CswNbtMetaDataObjectClassProp OpNameOCP = _CswNbtSchemaModTrnsctn.createObjectClassProp( CswNbtMetaDataObjectClass.NbtObjectClass.BatchOpClass, CswNbtObjClassBatchOp.OpNamePropertyName, CswNbtMetaDataFieldType.NbtFieldType.List, ServerManaged: true ); CswNbtMetaDataObjectClassProp PercentDoneOCP = _CswNbtSchemaModTrnsctn.createObjectClassProp( CswNbtMetaDataObjectClass.NbtObjectClass.BatchOpClass, CswNbtObjClassBatchOp.PercentDonePropertyName, CswNbtMetaDataFieldType.NbtFieldType.Number, ServerManaged: true ); CswNbtMetaDataObjectClassProp PriorityOCP = _CswNbtSchemaModTrnsctn.createObjectClassProp( CswNbtMetaDataObjectClass.NbtObjectClass.BatchOpClass, CswNbtObjClassBatchOp.PriorityPropertyName, CswNbtMetaDataFieldType.NbtFieldType.Number ); CswNbtMetaDataObjectClassProp CreatedDateOCP = _CswNbtSchemaModTrnsctn.createObjectClassProp( CswNbtMetaDataObjectClass.NbtObjectClass.BatchOpClass, CswNbtObjClassBatchOp.CreatedDatePropertyName, CswNbtMetaDataFieldType.NbtFieldType.DateTime, ServerManaged: true ); CswNbtMetaDataObjectClassProp StartDateOCP = _CswNbtSchemaModTrnsctn.createObjectClassProp( CswNbtMetaDataObjectClass.NbtObjectClass.BatchOpClass, CswNbtObjClassBatchOp.StartDatePropertyName, CswNbtMetaDataFieldType.NbtFieldType.DateTime, ServerManaged: true ); CswNbtMetaDataObjectClassProp StatusOCP = _CswNbtSchemaModTrnsctn.createObjectClassProp( CswNbtMetaDataObjectClass.NbtObjectClass.BatchOpClass, CswNbtObjClassBatchOp.StatusPropertyName, CswNbtMetaDataFieldType.NbtFieldType.List, ServerManaged: true, ListOptions: StatusOptions.ToString() ); CswNbtMetaDataObjectClassProp UserOCP = _CswNbtSchemaModTrnsctn.createObjectClassProp( CswNbtMetaDataObjectClass.NbtObjectClass.BatchOpClass, CswNbtObjClassBatchOp.UserPropertyName, CswNbtMetaDataFieldType.NbtFieldType.Relationship, IsFk: true, FkType: NbtViewRelatedIdType.ObjectClassId.ToString(), FkValue: UserOC.ObjectClassId ); PriorityOCP.DefaultValue.Field1_Numeric = 0; PriorityOCP.DefaultValue.Gestalt = "0"; PercentDoneOCP.DefaultValue.Field1_Numeric = 0; PercentDoneOCP.DefaultValue.Gestalt = "0"; _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( CreatedDateOCP, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.extended, CswNbtNodePropDateTime.DateDisplayMode.DateTime.ToString() ); _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( StartDateOCP, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.extended, CswNbtNodePropDateTime.DateDisplayMode.DateTime.ToString() ); _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( EndDateOCP, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.extended, CswNbtNodePropDateTime.DateDisplayMode.DateTime.ToString() ); CswNbtMetaDataNodeType BatchOpNT = _CswNbtSchemaModTrnsctn.MetaData.makeNewNodeType( BatchOpOC.ObjectClassId, "Batch Operation", "System" ); BatchOpNT.setNameTemplateText( CswNbtMetaData.MakeTemplateEntry( OpNameOCP.PropName ) + " " + CswNbtMetaData.MakeTemplateEntry( CreatedDateOCP.PropName ) ); CswNbtMetaDataNodeTypeTab BatchOpTab = BatchOpNT.getFirstNodeTypeTab(); CswNbtMetaDataNodeTypeProp OpNameNTP = BatchOpNT.getNodeTypePropByObjectClassProp( CswNbtObjClassBatchOp.OpNamePropertyName ); CswNbtMetaDataNodeTypeProp UserNTP = BatchOpNT.getNodeTypePropByObjectClassProp( CswNbtObjClassBatchOp.UserPropertyName ); CswNbtMetaDataNodeTypeProp PercentDoneNTP = BatchOpNT.getNodeTypePropByObjectClassProp( CswNbtObjClassBatchOp.PercentDonePropertyName ); CswNbtMetaDataNodeTypeProp PriorityNTP = BatchOpNT.getNodeTypePropByObjectClassProp( CswNbtObjClassBatchOp.PriorityPropertyName ); CswNbtMetaDataNodeTypeProp StatusNTP = BatchOpNT.getNodeTypePropByObjectClassProp( CswNbtObjClassBatchOp.StatusPropertyName ); CswNbtMetaDataNodeTypeProp CreatedDateNTP = BatchOpNT.getNodeTypePropByObjectClassProp( CswNbtObjClassBatchOp.CreatedDatePropertyName ); CswNbtMetaDataNodeTypeProp StartDateNTP = BatchOpNT.getNodeTypePropByObjectClassProp( CswNbtObjClassBatchOp.StartDatePropertyName ); CswNbtMetaDataNodeTypeProp EndDateNTP = BatchOpNT.getNodeTypePropByObjectClassProp( CswNbtObjClassBatchOp.EndDatePropertyName ); CswNbtMetaDataNodeTypeProp BatchDataNTP = BatchOpNT.getNodeTypePropByObjectClassProp( CswNbtObjClassBatchOp.BatchDataPropertyName ); CswNbtMetaDataNodeTypeProp LogNTP = BatchOpNT.getNodeTypePropByObjectClassProp( CswNbtObjClassBatchOp.LogPropertyName ); // Set tab layout OpNameNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, BatchOpTab.TabId, 1, 1 ); UserNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, BatchOpTab.TabId, 2, 1 ); PriorityNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, BatchOpTab.TabId, 3, 1 ); PercentDoneNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, BatchOpTab.TabId, 4, 1 ); StatusNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, BatchOpTab.TabId, 5, 1 ); CreatedDateNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, BatchOpTab.TabId, 6, 1 ); StartDateNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, BatchOpTab.TabId, 7, 1 ); EndDateNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, BatchOpTab.TabId, 8, 1 ); BatchDataNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, BatchOpTab.TabId, 9, 1 ); LogNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, BatchOpTab.TabId, 10, 1 ); _CswNbtSchemaModTrnsctn.MetaData.refreshAll(); // Batch Operations (all) view for chemsw_admin_role CswNbtNode ChemSwAdminRole = _CswNbtSchemaModTrnsctn.Nodes.makeRoleNodeFromRoleName( CswNbtObjClassRole.ChemSWAdminRoleName ); CswNbtView BatchOpView = _CswNbtSchemaModTrnsctn.makeView(); BatchOpView.makeNew( "Batch Operations (all)", NbtViewVisibility.Role, ChemSwAdminRole.NodeId ); BatchOpView.Category = "System"; BatchOpView.SetViewMode( NbtViewRenderingMode.Grid ); CswNbtViewRelationship BatchOpViewRel = BatchOpView.AddViewRelationship( BatchOpOC, true ); BatchOpView.AddViewProperty( BatchOpViewRel, OpNameOCP ); BatchOpView.AddViewProperty( BatchOpViewRel, UserOCP ); CswNbtViewProperty BatchStatusViewProp = BatchOpView.AddViewProperty( BatchOpViewRel, StatusOCP ); CswNbtViewProperty BatchPriorityViewProp = BatchOpView.AddViewProperty( BatchOpViewRel, PriorityOCP ); BatchOpView.AddViewPropertyFilter( BatchStatusViewProp, Value: NbtBatchOpStatus.Completed.ToString(), FilterMode: CswNbtPropFilterSql.PropertyFilterMode.NotEquals, ShowAtRuntime: true ); BatchOpView.setSortProperty( BatchPriorityViewProp, NbtViewPropertySortMethod.Descending ); BatchOpView.save(); // Batch Operations (all) view for Administrator CswNbtNode AdminRole = _CswNbtSchemaModTrnsctn.Nodes.makeRoleNodeFromRoleName( "Administrator" ); if( AdminRole != null ) { CswNbtView BatchOpView2 = _CswNbtSchemaModTrnsctn.makeView(); BatchOpView2.makeNew( "Batch Operations (all)", NbtViewVisibility.Role, AdminRole.NodeId, null, BatchOpView ); BatchOpView2.save(); } // My Batch Operations view for everyone else CswNbtView BatchOpView3 = _CswNbtSchemaModTrnsctn.makeView(); BatchOpView3.makeNew( "My Batch Operations", NbtViewVisibility.Global ); BatchOpView3.Category = "System"; BatchOpView3.SetViewMode( NbtViewRenderingMode.Tree ); CswNbtViewRelationship BatchOpViewRel3 = BatchOpView3.AddViewRelationship( BatchOpOC, true ); BatchOpView3.AddViewPropertyAndFilter( BatchOpViewRel3, StatusOCP, Value: NbtBatchOpStatus.Completed.ToString(), FilterMode: CswNbtPropFilterSql.PropertyFilterMode.NotEquals, ShowAtRuntime: true ); BatchOpView3.AddViewPropertyAndFilter( BatchOpViewRel3, UserOCP, Value: "me", FilterMode: CswNbtPropFilterSql.PropertyFilterMode.Equals ); BatchOpView3.save(); // Batch operation scheduled rule _CswNbtSchemaModTrnsctn.createScheduledRule( Sched.NbtScheduleRuleNames.BatchOp, MtSched.Core.Recurrence.NSeconds, 5 ); // Batch threshold config var _CswNbtSchemaModTrnsctn.createConfigurationVariable( "batchthreshold", "If an operation affects this number of nodes, run as a batch operation instead", "10", false ); // case 26446 - All users should have View permissions to batch ops CswNbtMetaDataObjectClass RoleOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswNbtMetaDataObjectClass.NbtObjectClass.RoleClass ); foreach( CswNbtObjClassRole RoleNode in RoleOC.getNodes( false, false ) ) { _CswNbtSchemaModTrnsctn.Permit.set( Security.CswNbtPermit.NodeTypePermission.View, BatchOpNT, RoleNode, true ); } }//Update()
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()