/// <summary> /// Validate BOM /// </summary> /// <param name="bom">bom</param> /// <returns>true if valid</returns> private bool ValidateBOM(VAdvantage.Model.MBOM bom) { //count = Util.GetValueOfInt(DB.ExecuteScalar(@"SELECT COUNT(*) FROM AD_MODULEINFO WHERE IsActive = 'Y' AND PREFIX ='VAMFG_'")); VAdvantage.Model.MBOMProduct[] BOMproducts = VAdvantage.Model.MBOMProduct.GetOfBOM(bom); // if manufacturing module exist and BOM Componet not contain any record against this BOM then not to verify Product //if (count > 0 && BOMproducts.Length == 0) // JID_0690: If manufaturing Module is not downloaded validate BOM Process was not working. if (BOMproducts.Length == 0) { return(false); } for (int i = 0; i < BOMproducts.Length; i++) { VAdvantage.Model.MBOMProduct BOMproduct = BOMproducts[i]; //VAdvantage.Model.MProduct pp = new VAdvantage.Model.MProduct(GetCtx(), BOMproduct.GetM_BOMProduct_ID(), Get_Trx()); VAdvantage.Model.MProduct pp = new VAdvantage.Model.MProduct(GetCtx(), BOMproduct.GetM_ProductBOM_ID(), Get_Trx()); if (pp.IsBOM() && BOMproduct.GetM_ProductBOMVersion_ID() > 0) { //return ValidateProduct(pp, bom.GetBOMType(), bom.GetBOMUse()); if (_products.Contains(pp)) { log.Warning(_product.GetName() + " recursively includes " + pp.GetName()); return(false); } _products.Add(pp); if (!pp.IsVerified()) { return(false); } } } return(true); }