public override void update()
        {
            // CISPro
            if ( _CswNbtSchemaModTrnsctn.isMaster() ){
                CswNbtMetaDataNodeType SiteNT = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "Site" );
                
                CswNbtSchemaUpdateImportMgr ImpMgrCIS = new CswNbtSchemaUpdateImportMgr( _CswNbtSchemaModTrnsctn, "CISPro" );

                ImpMgrCIS.importDef( 1, "chemicals" );

                ImpMgrCIS.importOrder( 1, "Inventory Group", "chemicals" );
                ImpMgrCIS.importOrder( 2, "Department", "chemicals" );
                if( null != SiteNT ) // case 31306
                {
                    ImpMgrCIS.importOrder( 3, "Site", "chemicals", 1 );
                }
                ImpMgrCIS.importOrder( 4, "Building", "chemicals", 2 );
                ImpMgrCIS.importOrder( 5, "Room", "chemicals", 3 );
                ImpMgrCIS.importOrder( 6, "Cabinet", "chemicals", 4 );
                ImpMgrCIS.importOrder( 7, "Vendor", "chemicals" );
                ImpMgrCIS.importOrder( 8, "Chemical", "chemicals" );
                ImpMgrCIS.importOrder( 9, "Unit_Weight", "chemicals" );
                ImpMgrCIS.importOrder( 10, "Unit_Volume", "chemicals" );
                ImpMgrCIS.importOrder( 11, "Unit_Each", "chemicals" );
                ImpMgrCIS.importOrder( 12, "Role", "chemicals" );
                ImpMgrCIS.importOrder( 13, "User", "chemicals" );
                ImpMgrCIS.importOrder( 14, "Size", "chemicals" );
                ImpMgrCIS.importOrder( 15, "Container", "chemicals" );

                ImpMgrCIS.importBinding( "inventorygroupname", "Name", "", "chemicals", "inventory group" );
                ImpMgrCIS.importBinding( "department", "Department Name", "", "chemicals", "department" );
                if( null != SiteNT ) // case 31306
                {
                    ImpMgrCIS.importBinding( "site", "Name", "", "chemicals", "site", 1 );
                }
                ImpMgrCIS.importBinding( "building", "Name", "", "chemicals", "building", 2 );
                ImpMgrCIS.importBinding( "room", "Name", "", "chemicals", "room", 3 );
                ImpMgrCIS.importBinding( "cabinet", "Name", "", "chemicals", "cabinet", 4 );
                ImpMgrCIS.importBinding( "vendorname", "Vendor Name", "", "chemicals", "vendor" );
                ImpMgrCIS.importBinding( "materialname", "Tradename", "", "chemicals", "chemical" );
                ImpMgrCIS.importBinding( "catalogno", "Part Number", "", "chemicals", "chemical" );
                ImpMgrCIS.importBinding( "casno", "CAS No", "", "chemicals", "chemical" );
                ImpMgrCIS.importBinding( "Unit_Weight", "Name", "", "chemicals", "Unit_Weight" );
                ImpMgrCIS.importBinding( "Unit_Volume", "Name", "", "chemicals", "Unit_Volume" );
                ImpMgrCIS.importBinding( "Unit_Each", "Name", "", "chemicals", "Unit_Each" );
                ImpMgrCIS.importBinding( "ConvFactExp", "Conversion Factor", "exponent", "chemicals", "Unit_Weight" );
                ImpMgrCIS.importBinding( "ConvFactExp", "Conversion Factor", "exponent", "chemicals", "Unit_Volume" );
                ImpMgrCIS.importBinding( "ConvFactExp", "Conversion Factor", "exponent", "chemicals", "Unit_Each" );
                ImpMgrCIS.importBinding( "ConvFactBase", "Conversion Factor", "base", "chemicals", "Unit_Weight" );
                ImpMgrCIS.importBinding( "ConvFactBase", "Conversion Factor", "base", "chemicals", "Unit_Volume" );
                ImpMgrCIS.importBinding( "ConvFactBase", "Conversion Factor", "base", "chemicals", "Unit_Each" );
                ImpMgrCIS.importBinding( "UnitOfMeasureName", "Quantity", "name", "chemicals", "container" );
                ImpMgrCIS.importBinding( "netquantity", "Quantity", "value", "chemicals", "container" );
                ImpMgrCIS.importBinding( "UnitOfMeasureName", "Initial Quantity", "name", "chemicals", "size" );
                ImpMgrCIS.importBinding( "barcodeid", "Barcode", "", "chemicals", "container" );
                ImpMgrCIS.importBinding( "responsible", "Username", "", "chemicals", "user" );
                ImpMgrCIS.importBinding( "expirationdate", "expiration date", "", "chemicals", "container" );
                ImpMgrCIS.importBinding( "rolename", "Name", "", "chemicals", "role" );

                ImpMgrCIS.importRelationship( "chemicals", "Building", "Location", 1 );
                ImpMgrCIS.importRelationship( "chemicals", "Room", "Location", 2 );
                ImpMgrCIS.importRelationship( "chemicals", "Room", "Department" );
                ImpMgrCIS.importRelationship( "chemicals", "Cabinet", "Location", 3 );
                ImpMgrCIS.importRelationship( "chemicals", "Chemical", "Supplier" );
                ImpMgrCIS.importRelationship( "chemicals", "Size", "Material" );
                ImpMgrCIS.importRelationship( "chemicals", "Container", "Size" );
                ImpMgrCIS.importRelationship( "chemicals", "Container", "Material" );
                ImpMgrCIS.importRelationship( "chemicals", "Container", "Location", 1 );
                ImpMgrCIS.importRelationship( "chemicals", "Container", "Location", 2 );
                ImpMgrCIS.importRelationship( "chemicals", "Container", "Location", 3 );
                ImpMgrCIS.importRelationship( "chemicals", "Container", "Location", 4 );
                ImpMgrCIS.importRelationship( "chemicals", "Container", "Owner" );
                if( null != SiteNT ) // case 31306
                {
                    ImpMgrCIS.importRelationship( "chemicals", "Site", "Inventory Group" );
                }
                ImpMgrCIS.importRelationship( "chemicals", "Room", "Inventory Group" );
                ImpMgrCIS.importRelationship( "chemicals", "Building", "Inventory Group" );
                ImpMgrCIS.importRelationship( "chemicals", "Cabinet", "Inventory Group" );
                ImpMgrCIS.importRelationship( "chemicals", "User", "Role" );

                ImpMgrCIS.finalize();
            }

            //// SI
            //{
            //    CswNbtSchemaUpdateImportMgr ImpMgrSI = new CswNbtSchemaUpdateImportMgr( _CswNbtSchemaModTrnsctn, "SI" );

            //    ImpMgrSI.importDef( 1, "InspectionTarget" );

            //    ImpMgrSI.importOrder( 1, "Site", "InspectionTarget", 1 );
            //    ImpMgrSI.importOrder( 2, "Building", "InspectionTarget", 2 );
            //    ImpMgrSI.importOrder( 3, "Room", "InspectionTarget", 3 );
            //    ImpMgrSI.importOrder( 4, "InspectionTarget Group", "InspectionTarget" );
            //    ImpMgrSI.importOrder( 5, "InspectionTarget", "InspectionTarget" );
            //    ImpMgrSI.importOrder( 6, "Inspection Schedule", "InspectionTarget" );

            //    ImpMgrSI.importBinding( "site", "Name", "", "InspectionTarget", "site", 1 );
            //    ImpMgrSI.importBinding( "building", "Name", "", "InspectionTarget", "building", 2 );
            //    ImpMgrSI.importBinding( "room", "Name", "", "InspectionTarget", "room", 3 );
            //    ImpMgrSI.importBinding( "inspectiongroup", "Name", "", "InspectionTarget", "inspectiontarget group" );
            //    ImpMgrSI.importBinding( "UniqueTargetName", "Description", "", "InspectionTarget", "inspectiontarget" );
            //    ImpMgrSI.importBinding( "schedule_summary", "Summary", "", "InspectionTarget", "Inspection Schedule" );
            //    ImpMgrSI.importBinding( "checklist name", "Inspection Type", "", "InspectionTarget", "Inspection Schedule" );
            //    ImpMgrSI.importBinding( "Next Due Date", "Next Due Date", "", "InspectionTarget", "Inspection Schedule" );
            //    ImpMgrSI.importBinding( "DueDateInterval", "Due Date Interval", "", "InspectionTarget", "Inspection Schedule" );
            //    ImpMgrSI.importBinding( "WarningDays", "Warning Days", "", "InspectionTarget", "Inspection Schedule" );

            //    ImpMgrSI.importRelationship( "InspectionTarget", "InspectionTarget", "Location", 3 );
            //    ImpMgrSI.importRelationship( "InspectionTarget", "InspectionTarget", "Location", 2 );
            //    ImpMgrSI.importRelationship( "InspectionTarget", "InspectionTarget", "Location", 1 );
            //    ImpMgrSI.importRelationship( "InspectionTarget", "InspectionTarget", "InspectionTarget Group" );
            //    ImpMgrSI.importRelationship( "InspectionTarget", "Inspection Schedule", "Inspection Group" );
            //    ImpMgrSI.importRelationship( "InspectionTarget", "Building", "Location", 1 );
            //    ImpMgrSI.importRelationship( "InspectionTarget", "Room", "Location", 2 );

            //    ImpMgrSI.finalize();
            //}
        } // update()
Exemple #2
0
        public override void doUpdate()
        {
            // Case 30043 - CAF Migration: Sites/Locations/Work Units
            const string SiteNTName = "Site";
            const string BuildingNTName = "Building";
            const string RoomNTName = "Room";
            const string CabinetNTName = "Cabinet";
            const string ShelfNTName = "Shelf";
            const string BoxNTName = "Box";
            const string LocationSheetName = "CAF";


            CswNbtSchemaUpdateImportMgr LocationsMgr = new CswNbtSchemaUpdateImportMgr( _CswNbtSchemaModTrnsctn, "CAF" );

            // Bindings

            #region Site
            LocationsMgr.CAFimportOrder( SiteNTName, "locations", "locations_view", "locationid", false, 1 );
            LocationsMgr.importBinding( "sitename", CswNbtObjClassLocation.PropertyName.Name, "", LocationSheetName, SiteNTName, 1 );
            LocationsMgr.importBinding( "sitecode", CswNbtObjClassLocation.PropertyName.LocationCode, "", LocationSheetName, SiteNTName, 1 );
            LocationsMgr.importBinding( "siteid", "Legacy Id", "", LocationSheetName, SiteNTName, 1 );
            LocationsMgr.importBinding( "controlzoneid", CswNbtObjClassLocation.PropertyName.ControlZone, CswEnumNbtSubFieldName.NodeID.ToString(), LocationSheetName, SiteNTName, 1 );
            LocationsMgr.importBinding( "allowinventory", CswNbtObjClassLocation.PropertyName.AllowInventory, "", LocationSheetName, SiteNTName, 1 );
            #endregion

            #region Building
            LocationsMgr.CAFimportOrder( BuildingNTName, "locations", "locations_view", "locationid", false, 2 );

            LocationsMgr.importBinding( "locationlevel1name", CswNbtObjClassLocation.PropertyName.Name, "", LocationSheetName, BuildingNTName, 2 );
            LocationsMgr.importBinding( "locationcode", CswNbtObjClassLocation.PropertyName.LocationCode, "", LocationSheetName, BuildingNTName, 2 );
            LocationsMgr.importBinding( "buildingid", "Legacy Id", "", LocationSheetName, BuildingNTName, 2 );
            LocationsMgr.importBinding( "inventorygroupid", CswNbtObjClassLocation.PropertyName.InventoryGroup, CswEnumNbtSubFieldName.NodeID.ToString(), LocationSheetName, BuildingNTName, 2 );
            LocationsMgr.importBinding( "controlzoneid", CswNbtObjClassLocation.PropertyName.ControlZone, CswEnumNbtSubFieldName.NodeID.ToString(), LocationSheetName, BuildingNTName, 2 );
            LocationsMgr.importBinding( "allowinventory", CswNbtObjClassLocation.PropertyName.AllowInventory, "", LocationSheetName, BuildingNTName, 2 );
            #endregion

            #region Room
            LocationsMgr.CAFimportOrder( RoomNTName, "locations", "locations_view", "locationid", false, 3 );

            LocationsMgr.importBinding( "locationlevel2name", CswNbtObjClassLocation.PropertyName.Name, "", LocationSheetName, RoomNTName, 3 );
            LocationsMgr.importBinding( "locationcode", CswNbtObjClassLocation.PropertyName.LocationCode, "", LocationSheetName, RoomNTName, 3 );
            LocationsMgr.importBinding( "roomid", "Legacy Id", "", LocationSheetName, RoomNTName, 3 );
            LocationsMgr.importBinding( "inventorygroupid", CswNbtObjClassLocation.PropertyName.InventoryGroup, CswEnumNbtSubFieldName.NodeID.ToString(), LocationSheetName, RoomNTName, 3 );
            LocationsMgr.importBinding( "controlzoneid", CswNbtObjClassLocation.PropertyName.ControlZone, CswEnumNbtSubFieldName.NodeID.ToString(), LocationSheetName, RoomNTName, 3 );
            LocationsMgr.importBinding( "allowinventory", CswNbtObjClassLocation.PropertyName.AllowInventory, "", LocationSheetName, RoomNTName, 3 );
            #endregion

            #region Cabinet
            LocationsMgr.CAFimportOrder( CabinetNTName, "locations", "locations_view", "locationid", false, 4 );

            LocationsMgr.importBinding( "locationlevel3name", CswNbtObjClassLocation.PropertyName.Name, "", LocationSheetName, CabinetNTName, 4 );
            LocationsMgr.importBinding( "locationcode", CswNbtObjClassLocation.PropertyName.LocationCode, "", LocationSheetName, CabinetNTName, 4 );
            LocationsMgr.importBinding( "cabinetid", "Legacy Id", "", LocationSheetName, CabinetNTName, 4 );
            LocationsMgr.importBinding( "inventorygroupid", CswNbtObjClassLocation.PropertyName.InventoryGroup, CswEnumNbtSubFieldName.NodeID.ToString(), LocationSheetName, CabinetNTName, 4 );
            LocationsMgr.importBinding( "controlzoneid", CswNbtObjClassLocation.PropertyName.ControlZone, CswEnumNbtSubFieldName.NodeID.ToString(), LocationSheetName, CabinetNTName, 4 );
            LocationsMgr.importBinding( "allowinventory", CswNbtObjClassLocation.PropertyName.AllowInventory, "", LocationSheetName, CabinetNTName, 4 );
            #endregion

            #region Shelf
            LocationsMgr.CAFimportOrder( ShelfNTName, "locations", "locations_view", "locationid", false, 5 );

            LocationsMgr.importBinding( "locationlevel4name", CswNbtObjClassLocation.PropertyName.Name, "", LocationSheetName, ShelfNTName, 5 );
            LocationsMgr.importBinding( "locationcode", CswNbtObjClassLocation.PropertyName.LocationCode, "", LocationSheetName, ShelfNTName, 5 );
            LocationsMgr.importBinding( "shelfid", "Legacy Id", "", LocationSheetName, ShelfNTName, 5 );
            LocationsMgr.importBinding( "inventorygroupid", CswNbtObjClassLocation.PropertyName.InventoryGroup, CswEnumNbtSubFieldName.NodeID.ToString(), LocationSheetName, ShelfNTName, 5 );
            LocationsMgr.importBinding( "controlzoneid", CswNbtObjClassLocation.PropertyName.ControlZone, CswEnumNbtSubFieldName.NodeID.ToString(), LocationSheetName, ShelfNTName, 5 );
            LocationsMgr.importBinding( "allowinventory", CswNbtObjClassLocation.PropertyName.AllowInventory, "", LocationSheetName, ShelfNTName, 5 );
            #endregion

            #region Box
            LocationsMgr.CAFimportOrder( BoxNTName, "locations", "locations_view", "locationid", false, 6 );

            LocationsMgr.importBinding( "locationlevel5name", CswNbtObjClassLocation.PropertyName.Name, "", LocationSheetName, BoxNTName, 6 );
            LocationsMgr.importBinding( "locationcode", CswNbtObjClassLocation.PropertyName.LocationCode, "", LocationSheetName, BoxNTName, 6 );
            LocationsMgr.importBinding( "boxid", "Legacy Id", "", LocationSheetName, BoxNTName, 6 );
            LocationsMgr.importBinding( "inventorygroupid", CswNbtObjClassLocation.PropertyName.InventoryGroup, CswEnumNbtSubFieldName.NodeID.ToString(), LocationSheetName, BoxNTName, 6 );
            LocationsMgr.importBinding( "controlzoneid", CswNbtObjClassLocation.PropertyName.ControlZone, CswEnumNbtSubFieldName.NodeID.ToString(), LocationSheetName, BoxNTName, 6 );
            LocationsMgr.importBinding( "allowinventory", CswNbtObjClassLocation.PropertyName.AllowInventory, "", LocationSheetName, BoxNTName, 6 );
            #endregion

            //Relationships
            LocationsMgr.importRelationship( LocationSheetName, BuildingNTName, CswNbtObjClassLocation.PropertyName.Location, 1, "siteid" );

            LocationsMgr.importRelationship( LocationSheetName, RoomNTName, CswNbtObjClassLocation.PropertyName.Location, 2, "buildingid" );

            LocationsMgr.importRelationship( LocationSheetName, CabinetNTName, CswNbtObjClassLocation.PropertyName.Location, 3, "roomid" );

            LocationsMgr.importRelationship( LocationSheetName, ShelfNTName, CswNbtObjClassLocation.PropertyName.Location, 4, "cabinetid" );

            LocationsMgr.importRelationship( LocationSheetName, BoxNTName, CswNbtObjClassLocation.PropertyName.Location, 5, "shelfid" );

            LocationsMgr.finalize();

        } // update()