public Protocols.ToolkitResultProtocol UpdatePart(Protocols.Interfaces.UpdatePartSetupProtocol setupParam) { ClarifySession session = Global.GetSession( AuthHeader ); FChoice.Toolkits.Clarify.Interfaces.InterfacesToolkit toolkit = new FChoice.Toolkits.Clarify.Interfaces.InterfacesToolkit( session ); FChoice.Toolkits.Clarify.Interfaces.UpdatePartSetup setup; switch( setupParam.ConstructorCue ) { case 0: setup = new FChoice.Toolkits.Clarify.Interfaces.UpdatePartSetup(setupParam.PartNumber, setupParam.PartDomain, setupParam.WarrantyDays); break; default: throw new InvalidOperationException(string.Format("Constructor index '{0}' does not exist.", setupParam.ConstructorCue)); } if( Global.IsPropertyDirty(1, setupParam.DirtyFieldFlags) ) { setup.PartNumber = setupParam.PartNumber; } if( Global.IsPropertyDirty(2, setupParam.DirtyFieldFlags) ) { setup.PartDomain = setupParam.PartDomain; } if( Global.IsPropertyDirty(4, setupParam.DirtyFieldFlags) ) { setup.Notes = setupParam.Notes; } if( Global.IsPropertyDirty(8, setupParam.DirtyFieldFlags) ) { setup.Description = setupParam.Description; } if( Global.IsPropertyDirty(16, setupParam.DirtyFieldFlags) ) { setup.ModelNumber = setupParam.ModelNumber; } if( Global.IsPropertyDirty(32, setupParam.DirtyFieldFlags) ) { setup.WarrantyDays = setupParam.WarrantyDays; } if( Global.IsPropertyDirty(64, setupParam.DirtyFieldFlags) ) { setup.WarrantyStartOnShipment = setupParam.WarrantyStartOnShipment; } if( Global.IsPropertyDirty(128, setupParam.DirtyFieldFlags) ) { setup.UnitMeasure = setupParam.UnitMeasure; } if( Global.IsPropertyDirty(256, setupParam.DirtyFieldFlags) ) { setup.Family = setupParam.Family; } if( Global.IsPropertyDirty(512, setupParam.DirtyFieldFlags) ) { setup.Line = setupParam.Line; } if( Global.IsPropertyDirty(1024, setupParam.DirtyFieldFlags) ) { setup.RepairType = setupParam.RepairType; } if( Global.IsPropertyDirty(2048, setupParam.DirtyFieldFlags) ) { setup.PartType = setupParam.PartType; } if( Global.IsPropertyDirty(4096, setupParam.DirtyFieldFlags) ) { setup.Weight = setupParam.Weight; } if( Global.IsPropertyDirty(8192, setupParam.DirtyFieldFlags) ) { setup.Dimension = setupParam.Dimension; } if( Global.IsPropertyDirty(16384, setupParam.DirtyFieldFlags) ) { setup.PartClass = setupParam.PartClass; } if( Global.IsPropertyDirty(32768, setupParam.DirtyFieldFlags) ) { foreach(Protocols.AdditionalFieldProtocol field in setupParam.AdditionalFields){setup.AdditionalFields.Append( field.FieldName, field.FieldType, field.FieldValue);} } return new Protocols.ToolkitResultProtocol( toolkit.UpdatePart(setup) ); }
public Protocols.ToolkitResultProtocol UpdatePart(System.String partNumber, System.String partDomain, System.Int32 warrantyDays) { ClarifySession session = Global.GetSession( AuthHeader ); FChoice.Toolkits.Clarify.Interfaces.InterfacesToolkit toolkit = new FChoice.Toolkits.Clarify.Interfaces.InterfacesToolkit( session ); return new Protocols.ToolkitResultProtocol( toolkit.UpdatePart(partNumber, partDomain, warrantyDays) ); }