Exemplo n.º 1
0
        public override void doUpdate()
        {
                CswNbtSchemaUpdateImportMgr UnitMgr = new CswNbtSchemaUpdateImportMgr( _CswNbtSchemaModTrnsctn, "CAF" );

                UnitMgr.CAFimportOrder( "Unit_Each", "units_of_measure", "each_view", "unitofmeasureid" );

                UnitMgr.importBinding( "unitofmeasurename", CswNbtObjClassUnitOfMeasure.PropertyName.Name, "" );
                UnitMgr.importBinding( "conversionfactor", CswNbtObjClassUnitOfMeasure.PropertyName.ConversionFactor, CswEnumNbtSubFieldName.Base.ToString() );
                UnitMgr.importBinding( "conversionfactorexp", CswNbtObjClassUnitOfMeasure.PropertyName.ConversionFactor, CswEnumNbtSubFieldName.Exponent.ToString() );
                UnitMgr.importBinding( "unittype", CswNbtObjClassUnitOfMeasure.PropertyName.UnitType, "" );


                UnitMgr.CAFimportOrder( "Unit_Volume", "units_of_measure", "volume_view", "unitofmeasureid" );

                UnitMgr.importBinding( "unitofmeasurename", CswNbtObjClassUnitOfMeasure.PropertyName.Name, "" );
                UnitMgr.importBinding( "conversionfactor", CswNbtObjClassUnitOfMeasure.PropertyName.ConversionFactor, CswEnumNbtSubFieldName.Base.ToString() );
                UnitMgr.importBinding( "conversionfactorexp", CswNbtObjClassUnitOfMeasure.PropertyName.ConversionFactor, CswEnumNbtSubFieldName.Exponent.ToString() );
                UnitMgr.importBinding( "unittype", CswNbtObjClassUnitOfMeasure.PropertyName.UnitType, "" );


                UnitMgr.CAFimportOrder( "Unit_Weight", "units_of_measure", "weight_view", "unitofmeasureid" );

                UnitMgr.importBinding( "unitofmeasurename", CswNbtObjClassUnitOfMeasure.PropertyName.Name, "" );
                UnitMgr.importBinding( "conversionfactor", CswNbtObjClassUnitOfMeasure.PropertyName.ConversionFactor, CswEnumNbtSubFieldName.Base.ToString() );
                UnitMgr.importBinding( "conversionfactorexp", CswNbtObjClassUnitOfMeasure.PropertyName.ConversionFactor, CswEnumNbtSubFieldName.Exponent.ToString() );
                UnitMgr.importBinding( "unittype", CswNbtObjClassUnitOfMeasure.PropertyName.UnitType, "" );

                UnitMgr.finalize();

        } // update()
        public override void update()
        {
            if (CswNbtImportDef.checkForDefinitionEntries(_CswNbtSchemaModTrnsctn, "CAF"))
            {
                CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr(_CswNbtSchemaModTrnsctn, "CAF");

                ImpMgr.CAFimportOrder("Equipment", "materials", "equipment_view", "legacyid", createLegacyId: true);

                //Simple props
                ImpMgr.importBinding("serialno", CswNbtObjClassEquipment.PropertyName.SerialNo, "");
                ImpMgr.importBinding("barcodeid", CswNbtObjClassEquipment.PropertyName.EquipmentId, "");
                ImpMgr.importBinding("expirationdate", CswNbtObjClassEquipment.PropertyName.ServiceEndsOn, "");
                ImpMgr.importBinding("model", CswNbtObjClassEquipment.PropertyName.Model, "");
                ImpMgr.importBinding("manufacturer", CswNbtObjClassEquipment.PropertyName.Manufacturer, "");
                ImpMgr.importBinding("description", CswNbtObjClassEquipment.PropertyName.Description, "");

                //Relationships and Locations
                ImpMgr.importBinding("ownerid", CswNbtObjClassEquipment.PropertyName.User, CswEnumNbtSubFieldName.NodeID.ToString());
                ImpMgr.importBinding("locationid", CswNbtObjClassEquipment.PropertyName.Location, CswEnumNbtSubFieldName.NodeID.ToString());
                ImpMgr.importBinding("materialsubclassid", CswNbtObjClassEquipment.PropertyName.Type, CswEnumNbtSubFieldName.NodeID.ToString());

                //LOB data
                ImpMgr.importBinding("struct_pict", CswNbtObjClassEquipment.PropertyName.Picture, CswEnumNbtSubFieldName.Blob.ToString(), BlobTableName: "materials", LobDataPkColOverride: "materialid");

                ImpMgr.finalize();
            }
        }
Exemplo n.º 3
0
        public override void doUpdate()
        {
            // CAF bindings definitions for Vendors
            CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr(_CswNbtSchemaModTrnsctn, "CAF");

            ImpMgr.CAFimportOrder("SDS Document", "documents", "sds_view", "legacyid", false);
            //simple props
            ImpMgr.importBinding("acquisitiondate", CswNbtObjClassSDSDocument.PropertyName.AcquiredDate, "");
            ImpMgr.importBinding("description", CswNbtObjClassSDSDocument.PropertyName.Title, "");
            ImpMgr.importBinding("captureddate", CswNbtObjClassSDSDocument.PropertyName.RevisionDate, "");

            //relationships
            ImpMgr.importBinding("packageid", "Material", CswEnumNbtSubFieldName.NodeID.ToString());   //SDS Document NTP "Owner" is changed to "Material"

            //transformed props
            ImpMgr.importBinding("language_trans", CswNbtObjClassSDSDocument.PropertyName.Language, "");
            ImpMgr.importBinding("fileextension_trans", CswNbtObjClassSDSDocument.PropertyName.FileType, "");

            //file specific bindings
            ImpMgr.importBinding("content_type", CswNbtObjClassSDSDocument.PropertyName.File, CswEnumNbtSubFieldName.ContentType.ToString());
            ImpMgr.importBinding("filename", CswNbtObjClassSDSDocument.PropertyName.File, CswEnumNbtSubFieldName.Name.ToString());

            //Link and BlobData are stored in the same column, we're going to import it twice and let the "FileType" property dictate what is shown
            ImpMgr.importBinding("document", CswNbtObjClassSDSDocument.PropertyName.File, CswEnumNbtSubFieldName.Blob.ToString(), BlobTableName: "documents", LobDataPkColOverride: "documentid");
            ImpMgr.importBinding("document", CswNbtObjClassSDSDocument.PropertyName.Link, CswEnumNbtSubFieldName.Href.ToString(), BlobTableName: "documents", LobDataPkColOverride: "documentid");

            //Use the description as the text that displays for links
            ImpMgr.importBinding("description", CswNbtObjClassSDSDocument.PropertyName.Link, CswEnumNbtSubFieldName.Text.ToString());

            //Legacy Id for documents is "<documentid>_<packageid>" (ex: "123_343")
            ImpMgr.importBinding("legacyid", "Legacy Id", "");

            ImpMgr.finalize();
        }
Exemplo n.º 4
0
        public override void update()
        {
            {
                CswNbtSchemaUpdateImportMgr UnitMgr = new CswNbtSchemaUpdateImportMgr( _CswNbtSchemaModTrnsctn, "units_of_measure", ViewName: "each_view", SourceColumn: "unitofmeasureid", DestNodeTypeName: "Unit_Each");

                UnitMgr.importBinding( "unitofmeasurename", CswNbtObjClassUnitOfMeasure.PropertyName.Name, "" );
                UnitMgr.importBinding( "conversionfactor", CswNbtObjClassUnitOfMeasure.PropertyName.ConversionFactor, "" );
                UnitMgr.importBinding( "unittype", CswNbtObjClassUnitOfMeasure.PropertyName.UnitType, "" );

                UnitMgr.finalize( UseView: true );

            }
            {
                CswNbtSchemaUpdateImportMgr UnitMgr = new CswNbtSchemaUpdateImportMgr( _CswNbtSchemaModTrnsctn, "units_of_measure", ViewName : "volume_view", SourceColumn : "unitofmeasureid", DestNodeTypeName : "Unit_Volume" );

                UnitMgr.importBinding( "unitofmeasurename", CswNbtObjClassUnitOfMeasure.PropertyName.Name, "" );
                UnitMgr.importBinding( "conversionfactor", CswNbtObjClassUnitOfMeasure.PropertyName.ConversionFactor, "" );
                UnitMgr.importBinding( "unittype", CswNbtObjClassUnitOfMeasure.PropertyName.UnitType, "" );

                UnitMgr.finalize( UseView : true );

            }
            {
                CswNbtSchemaUpdateImportMgr UnitMgr = new CswNbtSchemaUpdateImportMgr( _CswNbtSchemaModTrnsctn, "units_of_measure", ViewName : "weight_view", SourceColumn : "unitofmeasureid", DestNodeTypeName : "Unit_Weight" );

                UnitMgr.importBinding( "unitofmeasurename", CswNbtObjClassUnitOfMeasure.PropertyName.Name, "" );
                UnitMgr.importBinding( "conversionfactor", CswNbtObjClassUnitOfMeasure.PropertyName.ConversionFactor, "" );
                UnitMgr.importBinding( "unittype", CswNbtObjClassUnitOfMeasure.PropertyName.UnitType, "" );

                UnitMgr.finalize( UseView : true );

            }

        } // update()
        public override void update()
        {
            bool DefinitionExists = CswNbtImportDef.checkForDefinitionEntries( _CswNbtSchemaModTrnsctn, CswScheduleLogicNbtCAFImport.DefinitionName );
            if( DefinitionExists )
            {
            // CAF bindings definitions for Supplies
            CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr( _CswNbtSchemaModTrnsctn, "CAF" );
            ImpMgr.CAFimportOrder( "Supply", "packages", "supplies_view", "packageid" );

            //Simple Props
            ImpMgr.importBinding( "materialid", CswNbtPropertySetMaterial.PropertyName.LegacyMaterialId, "" );
            ImpMgr.importBinding( "productdescription", "Description", "" );
            ImpMgr.importBinding( "materialname", CswNbtPropertySetMaterial.PropertyName.TradeName, "" );
            ImpMgr.importBinding( "productno", CswNbtPropertySetMaterial.PropertyName.PartNumber, "" );
            ImpMgr.importBinding( "approved_trans", CswNbtPropertySetMaterial.PropertyName.ApprovedForReceiving, "" );

            //Relationships
            ImpMgr.importBinding( "vendorid", CswNbtPropertySetMaterial.PropertyName.Supplier, CswEnumNbtSubFieldName.NodeID.ToString() );

            //LOBs
            ImpMgr.importBinding( "struct_pict", CswNbtObjClassNonChemical.PropertyName.Picture, CswEnumNbtSubFieldName.Blob.ToString(), BlobTableName: "materials", LobDataPkColOverride: "materialid" );

            ImpMgr.finalize();
            }
        } // update()
 public override void doUpdate()
 {
     CswNbtSchemaUpdateImportMgr sizeImporter = new CswNbtSchemaUpdateImportMgr( _CswNbtSchemaModTrnsctn, "CAF" );
     sizeImporter.removeImportBinding( "CAF", "upc", "Size", "UPC Barcode", CswEnumNbtSubFieldName.Barcode.ToString() );
     sizeImporter.importBinding( "upc", CswNbtObjClassSize.PropertyName.UPC, "", DestNodeTypeName: "Size" );
     sizeImporter.finalize();
 } // update()
Exemplo n.º 7
0
        public override void update()
        {
            bool DefinitionExists = CswNbtImportDef.checkForDefinitionEntries( _CswNbtSchemaModTrnsctn, CswScheduleLogicNbtCAFImport.DefinitionName );
            if( DefinitionExists )
            {
                // CAF bindings definitions for Biologicals
                CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr( _CswNbtSchemaModTrnsctn, "CAF" );
                ImpMgr.CAFimportOrder( "Biological", "packages", "biologicals_view", "packageid" );

                //Simple Props
                ImpMgr.importBinding( "materialid", CswNbtPropertySetMaterial.PropertyName.LegacyMaterialId, "" );
                ImpMgr.importBinding( "refno", CswNbtObjClassBiological.PropertyName.ReferenceNumber, "" );
                ImpMgr.importBinding( "type", CswNbtObjClassBiological.PropertyName.Type, "" );
                ImpMgr.importBinding( "species", CswNbtObjClassBiological.PropertyName.SpeciesOrigin, "" );
                ImpMgr.importBinding( "biosafety", CswNbtObjClassBiological.PropertyName.BiosafetyLevel, "" );
                ImpMgr.importBinding( "vectors", CswNbtObjClassBiological.PropertyName.Vectors, "" );
                ImpMgr.importBinding( "storage_conditions", CswNbtObjClassBiological.PropertyName.StorageCondition, "" );
                ImpMgr.importBinding( "materialname", "Biological Name", "" );
                ImpMgr.importBinding( "productno", CswNbtPropertySetMaterial.PropertyName.PartNumber, "" );
                ImpMgr.importBinding( "approved_trans", CswNbtPropertySetMaterial.PropertyName.ApprovedForReceiving, "" );

                //Relationships
                ImpMgr.importBinding( "vendorid", CswNbtPropertySetMaterial.PropertyName.Supplier, CswEnumNbtSubFieldName.NodeID.ToString() );

                //LOBs
                ImpMgr.importBinding( "struct_pict", CswNbtObjClassNonChemical.PropertyName.Picture, CswEnumNbtSubFieldName.Blob.ToString(), BlobTableName: "materials", LobDataPkColOverride: "materialid" );

                ImpMgr.finalize();
            }
        } // update()
Exemplo n.º 8
0
        public override void doUpdate()
        {
            // CAF bindings definitions for Vendors
            CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr( _CswNbtSchemaModTrnsctn, "CAF" );

            //This is only necessary for the very first CAF script, to create the caf definition
            ImpMgr.importDef( 1, "CAF" );

            ImpMgr.CAFimportOrder( "Vendor", "vendors", PkColumnName: "vendorid" );
            // Binding
            ImpMgr.importBinding( "accountno", CswNbtObjClassVendor.PropertyName.AccountNo, "" );
            ImpMgr.importBinding( "city", CswNbtObjClassVendor.PropertyName.City, "" );
            ImpMgr.importBinding( "contactname", CswNbtObjClassVendor.PropertyName.ContactName, "" );
            ImpMgr.importBinding( "fax", CswNbtObjClassVendor.PropertyName.Fax, "" );
            ImpMgr.importBinding( "phone", CswNbtObjClassVendor.PropertyName.Phone, "" );
            ImpMgr.importBinding( "state", CswNbtObjClassVendor.PropertyName.State, "" );
            ImpMgr.importBinding( "street1", CswNbtObjClassVendor.PropertyName.Street1, "" );
            ImpMgr.importBinding( "street2", CswNbtObjClassVendor.PropertyName.Street2, "" );
            ImpMgr.importBinding( "vendorname", CswNbtObjClassVendor.PropertyName.VendorName, "" );
            ImpMgr.importBinding( "zip", CswNbtObjClassVendor.PropertyName.Zip, "" );

            // Relationship
            // Vendor has no relationships

            ImpMgr.finalize();
        } // update()
        public override void update()
        {
            CswNbtMetaDataObjectClass ComponentOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass(CswEnumNbtObjectClass.MaterialComponentClass);

            // Make new NumericRange property on MaterialComponent
            _CswNbtSchemaModTrnsctn.createObjectClassProp(ComponentOC, new CswNbtWcfMetaDataModel.ObjectClassProp()
            {
                PropName        = CswNbtObjClassMaterialComponent.PropertyName.PercentageRange,
                FieldType       = CswEnumNbtFieldType.NumericRange,
                NumberMinValue  = 0,
                NumberMaxValue  = 100,
                NumberPrecision = 3,
                IsRequired      = true,
                SetValOnAdd     = true,
                AuditLevel      = CswEnumAuditLevel.PlainAudit
            });


            // Fix CAF bindings
            CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr(_CswNbtSchemaModTrnsctn, "CAF");

            ImpMgr.removeImportBinding(CswScheduleLogicNbtCAFImport.DefinitionName, "quantity", "Material Component", oldTargetPercentageValue, "Value");
            ImpMgr.removeImportBinding(CswScheduleLogicNbtCAFImport.DefinitionName, "quantity", "Material Component", oldHighPercentageValue, "Value");

            ImpMgr.importBinding("quantity", CswNbtObjClassMaterialComponent.PropertyName.PercentageRange, CswNbtFieldTypeRuleNumericRange.SubFieldName.Target.ToString());
            ImpMgr.importBinding("quantity", CswNbtObjClassMaterialComponent.PropertyName.PercentageRange, CswNbtFieldTypeRuleNumericRange.SubFieldName.Upper.ToString());

            ImpMgr.finalize();
        }
Exemplo n.º 10
0
        public override void doUpdate()
        {
            // Case 30043 - CAF Migration: Sites/Locations/Work Units

            // View creation script
            //select w.*, s.sitename || ' ' || b.businessunitname as workunitname from work_units w
            //left outer join business_units b on (b.businessunitid = w.businessunitid)
            //left outer join sites s on (s.siteid = w.siteid)

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

            importMgr.CAFimportOrder( "Work Unit", "work_units", "workunits_view", "workunitid" );
            // Binding
            importMgr.importBinding( "workunitname", CswNbtObjClassWorkUnit.PropertyName.Name, "" );

            // Relationship
            //none

            importMgr.finalize();

            // Columns in work_units table
            //deleted
            //retestwarndays
            //workunitid
            //siteid
            //businessunitid
            //stdapprovalmode
            //skiplotcodedefault
            //expiryinterval
            //retestintervaldefault
            //messagetext
            //expiryintervalunits
            //retaincount
            //retainkeepyears
            //retainquantity
            //retainunitofmeasureid
            //mininventorylevel
            //mininventoryunitofmeasureid
            //homeinventorygroupid
            //stdexpiryinterval
            //stdexpiryintervalunits
            //autolotapproval
            //samplecollectionrequired
            //dispense_percent
            //canorderdraft
            //canoverreq
            //cansynchcontainers
            //srireviewgroupid
            //def_reqaschild
            //amountenable
            //alloc1
            //alloc2
            //alloc3
            //alloc4
            //alloc5
            //removegroupondispense
            //removegrouponmove

        } // update()
        public override void doUpdate()
        {
            CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr(_CswNbtSchemaModTrnsctn, "CAF");

            ImpMgr.importBinding("manufacturerlotno", CswNbtObjClassReceiptLot.PropertyName.ManufacturerLotNo, "", DestNodeTypeName: "Receipt Lot");

            ImpMgr.finalize();
        }
        public override void doUpdate()
        {
            CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr(_CswNbtSchemaModTrnsctn, "CAF");

            ImpMgr.importBinding("country", CswNbtObjClassVendor.PropertyName.Country, "", DestNodeTypeName: "Vendor");

            ImpMgr.finalize();
        }
        } // update()


        #region import script

        private void _createImportBindings()
        {
            CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr( _CswNbtSchemaModTrnsctn, "CAF" );

            ImpMgr.CAFimportOrder( "Receipt Lot", "receipt_lots", "receipt_lots_view", "receiptlotid" );

            ImpMgr.importBinding( "ReceiptLotNo", CswNbtObjClassReceiptLot.PropertyName.ReceiptLotNo, "" );
            ImpMgr.importBinding( "CreatedDate", CswNbtObjClassReceiptLot.PropertyName.ManufacturedDate, "" );
            ImpMgr.importBinding( "PackageId", CswNbtObjClassReceiptLot.PropertyName.Material, CswEnumNbtSubFieldName.NodeID.ToString() );



            ImpMgr.CAFimportOrder( "C of A Document", "receipt_lots", "cofa_docs_view", "receiptlotid" );

            ImpMgr.importBinding( "ReceiptLotId", "Receipt Lot", CswEnumNbtSubFieldName.NodeID.ToString() );
            ImpMgr.importBinding( "CA_FileName", CswNbtObjClassCofADocument.PropertyName.Title, "" );
            ImpMgr.importBinding( "CA_AcquisitionDate", CswNbtObjClassCofADocument.PropertyName.AcquiredDate, "" );
            ImpMgr.importBinding( "CA_FileExtension", CswNbtObjClassCofADocument.PropertyName.FileType, "" );
            ImpMgr.importBinding( "CA_Content_Type", CswNbtObjClassCofADocument.PropertyName.File, CswEnumNbtSubFieldName.ContentType.ToString() );
            ImpMgr.importBinding( "CA_Document", CswNbtObjClassCofADocument.PropertyName.File, CswEnumNbtSubFieldName.Blob.ToString(), BlobTableName: "receipt_lots", LobDataPkColOverride: "receiptlotid" );



            ImpMgr.CAFimportOrder( "Container Group", "container_groups", PkColumnName: "ContainerGroupId" );

            ImpMgr.importBinding( "ContainerGroupCode", CswNbtObjClassContainerGroup.PropertyName.Name, "" );



            ImpMgr.CAFimportOrder( "Container", "containers", "containers_view", "containerid" );

            ImpMgr.importBinding( "BarcodeId", CswNbtObjClassContainer.PropertyName.Barcode, "" );
            ImpMgr.importBinding( "PackDetailId", CswNbtObjClassContainer.PropertyName.Size, CswEnumNbtSubFieldName.NodeID.ToString() );
            ImpMgr.importBinding( "ParentId", CswNbtObjClassContainer.PropertyName.SourceContainer, CswEnumNbtSubFieldName.NodeID.ToString() );
            ImpMgr.importBinding( "ContainerGroupId", CswNbtObjClassContainer.PropertyName.ContainerGroup, CswEnumNbtSubFieldName.NodeID.ToString() );
            ImpMgr.importBinding( "OwnerId", CswNbtObjClassContainer.PropertyName.Owner, CswEnumNbtSubFieldName.NodeID.ToString() );
            ImpMgr.importBinding( "ContainerStatus", CswNbtObjClassContainer.PropertyName.Status, "" );
            ImpMgr.importBinding( "ReceiptLotId", CswNbtObjClassContainer.PropertyName.ReceiptLot, CswEnumNbtSubFieldName.NodeID.ToString() );
            ImpMgr.importBinding( "PackageId", CswNbtObjClassContainer.PropertyName.Material, CswEnumNbtSubFieldName.NodeID.ToString() );
            ImpMgr.importBinding( "NetQuantity", CswNbtObjClassContainer.PropertyName.Quantity, CswEnumNbtSubFieldName.Value.ToString() );
            ImpMgr.importBinding( "UnitOfMeasureId", CswNbtObjClassContainer.PropertyName.Quantity, CswEnumNbtSubFieldName.NodeID.ToString() );
            ImpMgr.importBinding( "ExpirationDate", CswNbtObjClassContainer.PropertyName.ExpirationDate, "" );
            ImpMgr.importBinding( "LocationId", CswNbtObjClassContainer.PropertyName.Location, CswEnumNbtSubFieldName.NodeID.ToString() );
            ImpMgr.importBinding( "StorPress", CswNbtObjClassContainer.PropertyName.StoragePressure, "" );
            ImpMgr.importBinding( "StorTemp", CswNbtObjClassContainer.PropertyName.StorageTemperature, "" );
            ImpMgr.importBinding( "UseType", CswNbtObjClassContainer.PropertyName.UseType, "" );
            ImpMgr.importBinding( "ReceivedDate", CswNbtObjClassContainer.PropertyName.DateCreated, "" );
            ImpMgr.importBinding( "OpenedDate", CswNbtObjClassContainer.PropertyName.OpenedDate, "" );
            ImpMgr.importBinding( "Concentration", CswNbtObjClassContainer.PropertyName.Concentration, "" );
            ImpMgr.importBinding( "HomeLocation", CswNbtObjClassContainer.PropertyName.HomeLocation, CswEnumNbtSubFieldName.NodeID.ToString() );
            ImpMgr.importBinding( "Notes", CswNbtObjClassContainer.PropertyName.Notes, "" );
            ImpMgr.importBinding( "ProjectId", CswNbtObjClassContainer.PropertyName.Project, "" );
            ImpMgr.importBinding( "SpecificActivity", CswNbtObjClassContainer.PropertyName.SpecificActivity, "" );
            ImpMgr.importBinding( "TareQuantity", CswNbtObjClassContainer.PropertyName.TareQuantity, CswEnumNbtSubFieldName.Value.ToString() );
            ImpMgr.importBinding( "UnitOfMeasureId", CswNbtObjClassContainer.PropertyName.TareQuantity, CswEnumNbtSubFieldName.NodeID.ToString() );

            ImpMgr.finalize();
        }
Exemplo n.º 14
0
        public override void doUpdate()
        {
            CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr(_CswNbtSchemaModTrnsctn, "CAF");

            ImpMgr.removeImportBinding("CAF", "CA_FileExtension", "C of A Document", "File Type", "Value");
            ImpMgr.importBinding("FileExtension", CswNbtObjClassCofADocument.PropertyName.FileType, "", "CAF", "C of A Document");

            ImpMgr.finalize();
        }
        public override void doUpdate()
        {
            CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr(_CswNbtSchemaModTrnsctn, "CAF");

            //RegList CAS No
            ImpMgr.importBinding("approved_trans", CswNbtObjClassChemical.PropertyName.ApprovedForReceiving, "", DestNodeTypeName: "Chemical");

            ImpMgr.finalize();
        }
        public override void doUpdate()
        {
                CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr( _CswNbtSchemaModTrnsctn, "CAF" );
                ImpMgr.CAFimportOrder( "Role", "roles", PkColumnName: "roleid" );

                ImpMgr.importBinding( "roledescription", CswNbtObjClassRole.PropertyName.Description, "" );
                ImpMgr.importBinding( "rolename", CswNbtObjClassRole.PropertyName.Name, "" );
                ImpMgr.importBinding( "timeout", CswNbtObjClassRole.PropertyName.Timeout, "" );



                ImpMgr.CAFimportOrder( "User", "users", "users_view", "userid" );

                ImpMgr.importBinding( "disabled", CswNbtObjClassUser.PropertyName.Archived, "" );
                ImpMgr.importBinding( "namefirst", CswNbtObjClassUser.PropertyName.FirstName, "" );
                ImpMgr.importBinding( "namelast", CswNbtObjClassUser.PropertyName.LastName, "" );
                ImpMgr.importBinding( "password", CswNbtObjClassUser.PropertyName.Password, "" );
                ImpMgr.importBinding( "email", CswNbtObjClassUser.PropertyName.Email, "" );
                ImpMgr.importBinding( "employeeid", CswNbtObjClassUser.PropertyName.EmployeeId, "" );
                ImpMgr.importBinding( "navrows", CswNbtObjClassUser.PropertyName.PageSize, "" );
                ImpMgr.importBinding( "locked", CswNbtObjClassUser.PropertyName.AccountLocked, "" );
                ImpMgr.importBinding( "failedlogincount", CswNbtObjClassUser.PropertyName.FailedLoginCount, "" );
                ImpMgr.importBinding( "defaultlanguage", CswNbtObjClassUser.PropertyName.Language, "" );
                ImpMgr.importBinding( "phone", CswNbtObjClassUser.PropertyName.Phone, "" );
                ImpMgr.importBinding( "username", CswNbtObjClassUser.PropertyName.Username, "" );

                ImpMgr.importBinding( "defaultlocationid", CswNbtObjClassUser.PropertyName.DefaultLocation, CswEnumNbtSubFieldName.NodeID.ToString() );
                ImpMgr.importBinding( "roleid", CswNbtObjClassUser.PropertyName.Role, CswEnumNbtSubFieldName.NodeID.ToString() );
                ImpMgr.importBinding( "workunitid", CswNbtObjClassUser.PropertyName.CurrentWorkUnit, CswEnumNbtSubFieldName.NodeID.ToString() );

                /*
                   +defaultlocationid, 
                   +disabled, 
                   homeinventorygroupid, - We dont' have an inventory group property on Users
                   +namefirst, 
                   +namelast, 
                   +navrows, 
                   +password,
                   +roleid, 
                   +userid, 
                   +username, 
                   +workunitid, 
                   +locked, 
                   +failedlogincount, 
                   +email, 
                   +phone, 
                   +defaultlanguage,
                   ?? pending TDU investigation supervisorid, 
                   +employeeid
             
                */

                // Exclude issystemuser
                ImpMgr.finalize();

        } // update()
        public override void doUpdate()
        {
            CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr(_CswNbtSchemaModTrnsctn, "CAF");

            ImpMgr.importBinding("flash_point", CswNbtObjClassChemical.PropertyName.FlashPoint, "", DestNodeTypeName: "Chemical");
            ImpMgr.importBinding("materialid", CswNbtObjClassChemical.PropertyName.LegacyMaterialId, "", DestNodeTypeName: "Chemical");
            ImpMgr.importBinding("productdescription", CswNbtObjClassChemical.PropertyName.ProductDescription, "", DestNodeTypeName: "Chemical");

            ImpMgr.finalize();
        }
        public override void doUpdate()
        {
            CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr(_CswNbtSchemaModTrnsctn, "CAF");

            ImpMgr.importBinding("classes", CswNbtObjClassChemical.PropertyName.HazardClasses, "", DestNodeTypeName: "Chemical");
            ImpMgr.importBinding("categories", CswNbtObjClassChemical.PropertyName.HazardCategories, "", DestNodeTypeName: "Chemical");
            ImpMgr.importBinding("chemtype", CswNbtObjClassChemical.PropertyName.MaterialType, "", DestNodeTypeName: "Chemical");
            ImpMgr.importBinding("special_flags", CswNbtObjClassChemical.PropertyName.SpecialFlags, "", DestNodeTypeName: "Chemical");

            ImpMgr.finalize();
        }
Exemplo n.º 19
0
        public static void updateImportDefinition(ICswResources CswResources, CswWebSvcReturn Ret, CswNbtImportWcf.DefinitionUpdateRow[] Params)
        {
            //NOTE: if we decide to use definitions other than CAF in the future, we're going to need a way to discern what definition we're working with
            CswNbtSchemaUpdateImportMgr ImportUpdater = new CswNbtSchemaUpdateImportMgr(new CswNbtSchemaModTrnsctn((CswNbtResources)CswResources), "CAF", ImporterSetUpMode: CswEnumSetupMode.NbtWeb);

            foreach (CswNbtImportWcf.DefinitionUpdateRow Row in Params)
            {
                ImportUpdater.updateDefinitionElementByPK(Row.definitionType, Row.editMode, Row.row);
            }

            ImportUpdater.finalize();
        }
Exemplo n.º 20
0
        public override void doUpdate()
        {
            CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr(_CswNbtSchemaModTrnsctn, "CAF");

            //RegList CAS No
            ImpMgr.importBinding("regulatorylistid", CswNbtObjClassRegulatoryListCasNo.PropertyName.RegulatoryList, CswEnumNbtSubFieldName.NodeID.ToString(), DestNodeTypeName: "Regulatory List CAS");

            //RegList
            ImpMgr.importBinding("reglistcode", CswNbtObjClassRegulatoryList.PropertyName.ListCode, "", DestNodeTypeName: "Regulatory List");

            ImpMgr.finalize();
        }
        public override void update()
        {
            if( CswNbtImportDef.checkForDefinitionEntries( _CswNbtSchemaModTrnsctn, "CAF" ) )
            {
                CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr( _CswNbtSchemaModTrnsctn, "CAF" );

                ImpMgr.removeImportBinding( "CAF", "controlzonename", "Control Zone", "Name", "Text" );
                ImpMgr.importBinding( "controlzonename", CswNbtObjClassControlZone.PropertyName.ControlZoneName, "", "CAF", "Control Zone" );

                ImpMgr.finalize();
            }
        } // update()
        public override void doUpdate()
        {
            CswNbtSchemaUpdateImportMgr RoleMgr = new CswNbtSchemaUpdateImportMgr( _CswNbtSchemaModTrnsctn, "CAF" );

            RoleMgr.removeImportOrder( "CAF", "Role" );
            RoleMgr.CAFimportOrder( "Role", "roles", "roles_view", "roleid" );

            RoleMgr.importBinding( "administrator", CswNbtObjClassRole.PropertyName.Administrator, "" );

            RoleMgr.finalize();

        } // update()
Exemplo n.º 23
0
        public override void update()
        {
            if (CswNbtImportDef.checkForDefinitionEntries(_CswNbtSchemaModTrnsctn, "CAF"))
            {
                CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr(_CswNbtSchemaModTrnsctn, "CAF");

                ImpMgr.CAFimportOrder("Equipment Type", "materials_subclass", "equipment_type_view", "materialsubclassid");

                //Simple props
                ImpMgr.importBinding("subclassname", CswNbtObjClassEquipmentType.PropertyName.TypeName, "");

                ImpMgr.finalize();
            }
        }
Exemplo n.º 24
0
        public override void doUpdate()
        {
            CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr( _CswNbtSchemaModTrnsctn, "CAF" );
            ImpMgr.CAFimportOrder( "Regulatory List", "regulatory_lists", "reglists_view", "regulatorylistid" );
            ImpMgr.importBinding( "displayname", CswNbtObjClassRegulatoryList.PropertyName.Name, "" );
            ImpMgr.importBinding( "listmode", CswNbtObjClassRegulatoryList.PropertyName.ListMode, "" );


            ImpMgr.CAFimportOrder( "Regulatory List CAS", "regulated_casnos", PkColumnName : "regulatedcasnoid" );
            ImpMgr.importBinding( "casno", CswNbtObjClassRegulatoryListCasNo.PropertyName.CASNo, "" );

            ImpMgr.finalize();

        } // update()
Exemplo n.º 25
0
        public static void CreateCafProps(CswNbtResources NbtResources, List <string> NodeTypes, string PropsValsTblName, string PropsValsPKName, CswEnumSetupMode SetupMode)
        {
            CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr(new CswNbtSchemaModTrnsctn(NbtResources), "CAF", ImporterSetUpMode: SetupMode);

            string             sql            = GetCAFPropertiesSQL(PropsValsTblName, NodeTypes);
            CswArbitrarySelect cafChemPropAS  = NbtResources.makeCswArbitrarySelect("cafProps_" + PropsValsPKName, sql);
            DataTable          cafChemPropsDT = cafChemPropAS.getTable();

            foreach (DataRow row in cafChemPropsDT.Rows)
            {
                foreach (string nt in NodeTypes)
                {
                    CswNbtMetaDataNodeType NodeType = NbtResources.MetaData.getNodeType(nt);

                    string PropName = row["propertyname"].ToString();
                    int    PropId   = CswConvert.ToInt32(row["propertyid"]);
                    PropName = GetUniquePropName(NodeType, PropName);   //keep appending numbers until we have a unique prop name

                    CswEnumNbtFieldType        propFT  = GetFieldTypeFromCAFPropTypeCode(row["propertytype"].ToString());
                    CswNbtMetaDataNodeTypeProp newProp = NbtResources.MetaData.makeNewProp(new CswNbtWcfMetaDataModel.NodeTypeProp(NodeType, NbtResources.MetaData.getFieldType(propFT), PropName)
                    {
                        IsRequired  = CswConvert.ToBoolean(row["required"]),
                        ReadOnly    = CswConvert.ToBoolean(row["readonly"]),
                        ListOptions = CswConvert.ToString(row["listopts"])
                    });
                    newProp.removeFromAllLayouts();

                    string cafColPropName = "prop" + row["propertyid"];
                    string cafSourceCol   = "propvaltext";
                    if (CswEnumNbtFieldType.DateTime == propFT)
                    {
                        cafSourceCol = "propvaldate";
                    }
                    else if (CswEnumNbtFieldType.Number == propFT)
                    {
                        cafSourceCol = "propvalnumber";
                    }

                    ImpMgr.importBinding(cafSourceCol, PropName, "", "CAF", NodeType.NodeTypeName,
                                         ClobTableName: PropsValsTblName,
                                         LobDataPkColOverride: cafColPropName,
                                         LobDataPkColName: PropsValsPKName,
                                         LegacyPropId: PropId);
                }
            }

            NbtResources.commitTransaction();
            ImpMgr.finalize();
        }
Exemplo n.º 26
0
        } // update()


        #region import script

        private void _createImportBindings()
        {
            CswNbtSchemaUpdateImportMgr sizeImporter = new CswNbtSchemaUpdateImportMgr( _CswNbtSchemaModTrnsctn, "CAF" );

            sizeImporter.CAFimportOrder( "Size", "packdetail", "packdetail_view", "packdetailid" );

            sizeImporter.importBinding( "packagedescription", CswNbtObjClassSize.PropertyName.Description, "" );
            sizeImporter.importBinding( "packageid", CswNbtObjClassSize.PropertyName.Material, CswEnumNbtSubFieldName.NodeID.ToString() );
            sizeImporter.importBinding( "catalogno", CswNbtObjClassSize.PropertyName.CatalogNo, "" );
            sizeImporter.importBinding( "capacity", CswNbtObjClassSize.PropertyName.InitialQuantity, CswEnumNbtSubFieldName.Value.ToString() );
            sizeImporter.importBinding( "unitofmeasureid", CswNbtObjClassSize.PropertyName.InitialQuantity, CswEnumNbtSubFieldName.NodeID.ToString() );
            //sizeImporter.importBinding( "upc", "UPC Barcode", "" );//Case 31264 invalidates this binding
            sizeImporter.importBinding( "containertype", CswNbtObjClassSize.PropertyName.ContainerType, "" );

            sizeImporter.finalize();
        }
Exemplo n.º 27
0
        public override void update()
        {
            bool DefinitionExists = CswNbtImportDef.checkForDefinitionEntries( _CswNbtSchemaModTrnsctn, CswScheduleLogicNbtCAFImport.DefinitionName );
            if( DefinitionExists )
            {
            // CAF bindings definitions for Biologicals
            CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr( _CswNbtSchemaModTrnsctn, "CAF" );
            ImpMgr.CAFimportOrder( "Constituent", "materials", "constituents_view", "legacyid" );

            //Simple Props
            ImpMgr.importBinding( "name", CswNbtObjClassChemical.PropertyName.TradeName, "" );
            ImpMgr.importBinding( "casno", CswNbtObjClassChemical.PropertyName.CasNo, "" );
            ImpMgr.importBinding( "einecs", CswNbtObjClassChemical.PropertyName.EINECS, "" );

            ImpMgr.finalize();
            }
        } // update()
        public override void doUpdate()
        {
            CswNbtSchemaUpdateImportMgr InventoryLevelBindings =
                new CswNbtSchemaUpdateImportMgr(
                    _CswNbtSchemaModTrnsctn,
                    "CAF" );

            InventoryLevelBindings.CAFimportOrder( "Inventory Level", "mininventory_basic", "inventory_view", "inventorybasicid" ); //SPECIAL CASE: maxinventory_basic is also in the view

            InventoryLevelBindings.importBinding( "inventorybasicid", CswNbtObjClassInventoryLevel.PropertyName.LegacyId, "" );
            InventoryLevelBindings.importBinding( "inventorylevel", CswNbtObjClassInventoryLevel.PropertyName.Level, CswEnumNbtSubFieldName.Value.ToString() );
            InventoryLevelBindings.importBinding( "unitofmeasureid", CswNbtObjClassInventoryLevel.PropertyName.Level, CswEnumNbtSubFieldName.NodeID.ToString() );
            InventoryLevelBindings.importBinding( "locationid", CswNbtObjClassInventoryLevel.PropertyName.Location, CswEnumNbtSubFieldName.NodeID.ToString() );
            InventoryLevelBindings.importBinding( "packageid", CswNbtObjClassInventoryLevel.PropertyName.Material, CswEnumNbtSubFieldName.NodeID.ToString() );
            InventoryLevelBindings.importBinding( "inventorytype", CswNbtObjClassInventoryLevel.PropertyName.Type, CswEnumNbtSubFieldName.Value.ToString() );

            InventoryLevelBindings.finalize();
        }
        public override void doUpdate()
        {
            // Case 30043 - CAF Migration: Sites/Locations/Work Units
            CswNbtSchemaUpdateImportMgr ImportMgr_ControlZones = new CswNbtSchemaUpdateImportMgr( _CswNbtSchemaModTrnsctn, "CAF" );


            ImportMgr_ControlZones.CAFimportOrder( "Control Zone", "cispro_controlzones", PkColumnName: "controlzoneid" );

            // Binding
            ImportMgr_ControlZones.importBinding( "controlzonename", CswNbtObjClassControlZone.PropertyName.Name, "" );
            ImportMgr_ControlZones.importBinding( "exemptqtyfactor", CswNbtObjClassControlZone.PropertyName.MAQOffset, "" );

            // Relationship
            //none

            ImportMgr_ControlZones.finalize();

        } // update()
        public override void doUpdate()
        {
            // CAF bindings definitions for Vendors
            CswNbtSchemaUpdateImportMgr ImpMgr = new CswNbtSchemaUpdateImportMgr(_CswNbtSchemaModTrnsctn, "CAF");

            ImpMgr.CAFimportOrder("Material Synonym", "materials_synonyms", "synonyms_view", "legacyid", false);

            //simple props
            ImpMgr.importBinding("synonymname", CswNbtObjClassMaterialSynonym.PropertyName.Name, "");
            ImpMgr.importBinding("synonymclass", CswNbtObjClassMaterialSynonym.PropertyName.Type, "");

            //relationships
            ImpMgr.importBinding("packageid", CswNbtObjClassMaterialSynonym.PropertyName.Material, CswEnumNbtSubFieldName.NodeID.ToString());

            //Legacy Id for Synonyms is "<SynonymId>_<PackageId>" (ex: "123_343")
            ImpMgr.importBinding("legacyid", "Legacy Id", "");

            ImpMgr.finalize();
        }