Methods
- Last UpdatedJun 23, 2017
- 2 minute read
This section describes the methods available for the wwMaterialDB class.
AddMaterial()
This method adds a material to the database. The return code is a Short integer value that can be used for error handling.
For more information on the error codes returned, see "Error Return Values".
Syntax
ReturnCode = MaterialDBVar.AddMaterial (Id, Name, Desc, Type, UofM, HiDev, LoDev)
Parameters
Id
Data Type: String
New material ID
Name
Data Type: String
New material name
Desc
Data Type: String
New material description
Type
Data Type: Integer
New enumeration type. For Type enumeration constants, see "Enumerated Constants".
UofM
Data Type: String
New unit of measure
HiDev
Data Type: Double
New high deviation
LoDev
Data Type: Double
New low deviation
GetMtrlAssignedToUnit()
This method queries the material currently assigned to the specified unit. The Material ID is returned. If no material was assigned to the unit, a blank string is returned.
Syntax
String = MaterialDBVar.GetMtrlAssignedToUnit (Unit)
Parameters
Unit
Data Type: String
Name of unit for which material is desired
QueryAvailableUnits()
This method updates the AvailableUnits collection with the latest set of unassigned units.
Syntax
MaterialDBVar.QueryAvailableUnits ()
QueryMaterials()
This method updates the Materials collection with the latest set of materials.
Syntax
MaterialDBVar.QueryMaterials ()
QueryMaterialsById()
This method updates the Materials collection with the single material that has the specified material identification.
Syntax
MaterialDBVar.QueryMaterialsById (MaterialId)
Parameters
MaterialId
Data Type: String
Material ID to find
QueryMaterialsByType()
This method updates the Materials collection with the latest set of materials that have the specified type.
Syntax
MaterialDBVar.QueryMaterialsByType (MaterialType)
String = MaterialDBVar.GetMtrlAssignedToUnit (Unit)
Parameters
MaterialType
Data Type: wwMtrlTypeEnum
Material type enumeration. For Type enumeration constants, see "Enumerated Constants".
TestConnection()
This method tests to see if the fundamental batch services (Environment Manager and the database lock manager) are running. A Long return value provides the status of the services. The value can be interpreted as follows:
0 = Services are not running
1 = Services are running
Syntax
ReturnValue = MaterialDBVar.TestConnection ()