public override void update() { CswNbtMetaDataObjectClass PrintLabelOc = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.PrintLabelClass ); CswNbtMetaDataNodeType PrintLabelNt = PrintLabelOc.getLatestVersionNodeTypes().FirstOrDefault(); CswNbtMetaDataObjectClass LocationOc = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.LocationClass ); if( null != PrintLabelNt ) { CswNbtObjClassPrintLabel LocationLabel = _CswNbtSchemaModTrnsctn.Nodes.makeNodeFromNodeTypeId( PrintLabelNt.NodeTypeId, CswNbtNodeCollection.MakeNodeOperation.WriteNode ); LocationLabel.IsDemo = true; LocationLabel.LabelName.Text = "Location Label"; foreach( CswNbtMetaDataNodeType LocationNt in LocationOc.getLatestVersionNodeTypes() ) { LocationLabel.NodeTypes.SelectedNodeTypeIds.Add( LocationNt.NodeTypeId.ToString() ); } string EplText = @"I8,1,001 q664 S2 OD JF WN D7 ZB Q300,37 N B41,85,0,3,3,8,50,N,""{Barcode}"" A41,140,0,3,1,1,N,""{Barcode}"" P1"; LocationLabel.EplText.Text = EplText; LocationLabel.postChanges( ForceUpdate: false ); } }
public override void update() { // Default GHS label CswNbtMetaDataObjectClass ContainerOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.ContainerClass ); CswNbtMetaDataObjectClass PrintLabelOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.PrintLabelClass ); if( null != PrintLabelOC ) { CswNbtMetaDataNodeType PrintLabelNT = PrintLabelOC.FirstNodeType; if( null != PrintLabelNT ) { CswNbtObjClassPrintLabel GhsLabel = _CswNbtSchemaModTrnsctn.Nodes.makeNodeFromNodeTypeId( PrintLabelNT.NodeTypeId ); GhsLabel.LabelName.Text = "Example GHS Label"; if( null != ContainerOC ) { foreach(CswNbtMetaDataNodeType ContainerNT in ContainerOC.getNodeTypes()) { GhsLabel.NodeTypes.SelectedNodeTypeIds.Add( ContainerNT.NodeTypeId.ToString() ); } } GhsLabel.EplText.Text = @"I8,0,001 S2 OD JF WN D12 ZB q375 N A25,15,0,2,1,1,N,""{Material}"" B25,45,0,1,3,6,40,N,""{Barcode}"" A25,80,0,2,1,1,N,""{Barcode}"" A25,130,0,2,1,1,N,""{NBTGHSB}"" GW0,160,{NBTGHSPICTOS} GW128,160,{NBTGHSPICTOS_2} GW256,160,{NBTGHSPICTOS_3} P1"; GhsLabel.postChanges( false ); } } } // update()
public override void update() { // Fix DSD Picto Paths CswNbtMetaDataObjectClass ChemicalOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.ChemicalClass ); foreach( CswNbtMetaDataNodeType ChemicalNT in ChemicalOC.getNodeTypes() ) { CswDelimitedString PictoPaths = new CswDelimitedString( '\n' ) { "Images/cispro/DSD/512/none.gif", "Images/cispro/DSD/512/e.gif", "Images/cispro/DSD/512/o.gif", "Images/cispro/DSD/512/f.gif", "Images/cispro/DSD/512/f_plus.gif", "Images/cispro/DSD/512/t.gif", "Images/cispro/DSD/512/t_plus.gif", "Images/cispro/DSD/512/xn.gif", "Images/cispro/DSD/512/xi.gif", "Images/cispro/DSD/512/c.gif", "Images/cispro/DSD/512/n.gif" }; CswNbtMetaDataNodeTypeProp PictogramsNTP = ChemicalNT.getNodeTypePropByObjectClassProp( CswNbtObjClassChemical.PropertyName.Pictograms ); PictogramsNTP.DesignNode.AttributeProperty[CswNbtFieldTypeRuleImageList.AttributeName.ImageUrls].AsMemo.Text = PictoPaths.ToString(); PictogramsNTP.DesignNode.AttributeProperty[CswNbtFieldTypeRuleImageList.AttributeName.HeightInPixels].AsNumber.Value = 77; PictogramsNTP.DesignNode.AttributeProperty[CswNbtFieldTypeRuleImageList.AttributeName.WidthInPixels].AsNumber.Value = 77; PictogramsNTP.DesignNode.postChanges( false ); foreach( CswNbtObjClassChemical ChemicalNode in ChemicalNT.getNodes( false, true ) ) { CswDelimitedString oldVals = ChemicalNode.Pictograms.Value; CswDelimitedString newVals = new CswDelimitedString( CswNbtNodePropImageList.Delimiter ); foreach( string oldVal in oldVals ) { if( oldVal.IndexOf( "/DSD/" ) >= 0 && oldVal.IndexOf( "/DSD/512" ) == 0 ) { newVals.Add( oldVal.Replace( "/DSD/", "/DSD/512/" ) ); } else { newVals.Add( oldVal ); } } ChemicalNode.Pictograms.Value = newVals; ChemicalNode.postChanges( false ); } // foreach( CswNbtObjClassChemical ChemicalNode in ChemicalNT.getNodes( false, true ) ) } // foreach( CswNbtMetaDataNodeType ChemicalNT in ChemicalOC.getNodeTypes() ) // Example DSD Print Label CswNbtMetaDataObjectClass ContainerOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.ContainerClass ); CswNbtMetaDataObjectClass PrintLabelOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.PrintLabelClass ); if( null != PrintLabelOC ) { CswNbtMetaDataNodeType PrintLabelNT = PrintLabelOC.FirstNodeType; if( null != PrintLabelNT ) { CswNbtObjClassPrintLabel DsdLabel = _CswNbtSchemaModTrnsctn.Nodes.makeNodeFromNodeTypeId( PrintLabelNT.NodeTypeId ); DsdLabel.LabelName.Text = "Example DSD Label"; if( null != ContainerOC ) { foreach(CswNbtMetaDataNodeType ContainerNT in ContainerOC.getNodeTypes()) { DsdLabel.NodeTypes.SelectedNodeTypeIds.Add( ContainerNT.NodeTypeId.ToString() ); } } DsdLabel.EplText.Text = @"I8,0,001 S2 OD JF WN D12 ZB q375 N A25,15,0,2,1,1,N,""{Material}"" B25,45,0,1,3,6,40,N,""{Barcode}"" A25,80,0,2,1,1,N,""{Barcode}"" A25,130,0,2,1,1,N,""{NBTDSDB}"" GW0,160,{NBTDSDPICTOS} GW128,160,{NBTDSDPICTOS_2} GW256,160,{NBTDSDPICTOS_3} P1"; DsdLabel.postChanges( false ); } } } // update()
/// <summary> /// Update /// </summary> public override void update() { CswNbtMetaDataObjectClass PrintLabelOc = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass(CswNbtMetaDataObjectClass.NbtObjectClass.PrintLabelClass); CswNbtMetaDataObjectClassProp ControlTypeOcp = _CswNbtSchemaModTrnsctn.createObjectClassProp(new CswNbtWcfMetaDataModel.ObjectClassProp(PrintLabelOc) { PropName = CswNbtObjClassPrintLabel.PropertyName.ControlType, FieldType = CswNbtMetaDataFieldType.NbtFieldType.List, ListOptions = CswNbtObjClassPrintLabel.ControlTypes.Options.ToString(), IsRequired = true }); _CswNbtSchemaModTrnsctn.MetaData.SetObjectClassPropDefaultValue(ControlTypeOcp, ControlTypeOcp.getFieldTypeRule().SubFields.Default.Name, CswNbtObjClassPrintLabel.ControlTypes.jZebra); foreach (CswNbtObjClassPrintLabel PrintLabel in PrintLabelOc.getNodes(forceReInit: true, includeSystemNodes: false)) { if (null != PrintLabel) { PrintLabel.ControlType.Value = CswNbtObjClassPrintLabel.ControlTypes.jZebra; PrintLabel.postChanges(ForceUpdate: false); } } _CswNbtSchemaModTrnsctn.MetaData.SetObjectClassPropDefaultValue(ControlTypeOcp, ControlTypeOcp.getFieldTypeRule().SubFields.Default.Name, CswNbtObjClassPrintLabel.ControlTypes.jZebra); _CswNbtSchemaModTrnsctn.createObjectClassProp(new CswNbtWcfMetaDataModel.ObjectClassProp(PrintLabelOc) { PropName = CswNbtObjClassPrintLabel.PropertyName.LabelName, FieldType = CswNbtMetaDataFieldType.NbtFieldType.Text, SetValOnAdd = true }); foreach (CswNbtObjClassPrintLabel PrintLabel in PrintLabelOc.getNodes(forceReInit: true, includeSystemNodes: false)) { if (null != PrintLabel) { PrintLabel.ControlType.Value = CswNbtObjClassPrintLabel.ControlTypes.jZebra; } } CswNbtMetaDataNodeType PrintLabelNt = PrintLabelOc.getLatestVersionNodeTypes().FirstOrDefault(); if (null != PrintLabelNt) { CswNbtObjClassPrintLabel PrintLabel = _CswNbtSchemaModTrnsctn.Nodes.makeNodeFromNodeTypeId(PrintLabelNt.NodeTypeId, CswNbtNodeCollection.MakeNodeOperation.WriteNode, OverrideUniqueValidation: false); if (null != PrintLabel) { PrintLabel.ControlType.Value = CswNbtObjClassPrintLabel.ControlTypes.jZebra; //Whitespace is treated literally PrintLabel.EplText.Text = @"I8,1,001 q664 S2 OD JF WN D7 ZB Q300,37 N B41,85,0,3,3,8,50,N,""{Barcode}"" A41,140,0,3,1,1,N,""{Barcode}"" P1"; try { PrintLabel.LabelName.Text = "Default Barcode Label"; } catch (Exception Ex) { CswNbtMetaDataNodeTypeProp LabelNameNtp = PrintLabelNt.getNodeTypeProp("Label Name"); if (null != LabelNameNtp) { PrintLabel.Node.Properties[LabelNameNtp].AsText.Text = "Default Barcode Label"; } } CswNbtMetaDataObjectClass ContainerOc = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass(CswNbtMetaDataObjectClass.NbtObjectClass.ContainerClass); foreach (Int32 ContainerId in ContainerOc.getNodeTypeIds()) { PrintLabel.NodeTypes.SelectedNodeTypeIds.Add(ContainerId.ToString()); } PrintLabel.postChanges(ForceUpdate: false); } } } //Update()