Example
- Last UpdatedAug 18, 2016
- 1 minute read
The following C# sample code illustrates how to define, query, and use the wwMaterials object to populate a list of finished goods.
private void QueryMats()
{
wwMaterialDBClass mdbc = new wwMaterialDBClass();
wwMaterialUnits MatUnits=null;
wwMaterials mats;
wwMaterial Material;
if (MatStatus.GetMaterialType() == "Ingradiants" mdbc.QueryMaterialsByType(wwMtrlTypeEnum.wwTypeIngredient);
mdbc.QueryMaterialsById(MatStatus.GetMaterialId())
mats = (wwMaterials)mdbc.Materials;
if (mats.Count != 0)
{
Material = (wwMaterial)mats.Item(1);
MessageBox.Show(Material.Id);
MessageBox.Show(Material.Name);
}
}