Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Overview

Data feeds, such as those form FMAudit can create new machine parts, usually for toners.

The matching procedure

When a message is received from FMAudit the system considers if it would be appropriate to create a new machine part. For example should the system add a new machine part for a toner because FMAudit has sent information about a new toner. The matching procedure is as follows:

If the message received includes a supply name field that is not empty.

if (!string.IsNullOrEmpty(supply.SupplyName))

{

    productCriteria = CriteriaOperator.Parse("ProductID = ? && Status != ?", supply.SupplyName, ProductStatus.Archived);

    product = unitOfWork.FindObject<Product>(productCriteria);


    if (product == null)

    {

        productCriteria = CriteriaOperator.Parse("Model = ? && Status != ?", supply.SupplyName, ProductStatus.Archived);

        product = unitOfWork.FindObject<Product>(productCriteria);

    }


    if (product == null)

    {

        productCriteria = CriteriaOperator.Parse("AlternateProductIDs[ID = ?].Exists && Status != ?", supply.SupplyName, ProductStatus.Archived);

        product = unitOfWork.FindObject<Product>(productCriteria);

    }

}


if (!string.IsNullOrEmpty(supply.OEMPartNo))

{

    if (product == null)

    {

        productCriteria = CriteriaOperator.Parse("ProductID = ? && Status != ?", supply.OEMPartNo, ProductStatus.Archived);

        product = unitOfWork.FindObject<Product>(productCriteria);

    }


    if (product == null)

    {

        productCriteria = CriteriaOperator.Parse("Model = ? && Status != ?", supply.OEMPartNo, ProductStatus.Archived);

        product = unitOfWork.FindObject<Product>(productCriteria);

    }


    if (product == null)

    {

        productCriteria = CriteriaOperator.Parse("AlternateProductIDs[ID = ?].Exists && Status != ?", supply.OEMPartNo, ProductStatus.Archived);

        product = unitOfWork.FindObject<Product>(productCriteria);

    }

}



  • No labels