/// <summary> /// Get BOM Lines for Product. Default to Current Active, Master BOM /// BOM Lines are Ordered By Ascending Order of Product Names. /// </summary> /// <param name="product">product</param> /// <param name="bomType">bomtype</param> /// <param name="bomUse">bomuse</param> /// <param name="isAscending">true if ascending, false if descending</param> /// <returns>array of BOMs</returns> /// <writer>raghu</writer> /// <date>08-march-2011</date> public static MBOMProduct[] GetBOMLinesOrderByProductName(MProduct product, String bomType, String bomUse, Boolean isAscending) { // return lines for Current Active, Master BOM String sql = "SELECT M_BOM_ID FROM M_BOM WHERE M_Product_ID= " + product.GetM_Product_ID() + "AND BOMType ='" + bomType + "' AND BOMUse ='" + bomUse + "' AND IsActive = 'Y'"; Trx trx = product.Get_Trx(); int bomID = 0; IDataReader idr = null; try { idr = DB.ExecuteReader(sql, null, trx); if (idr.Read()) { bomID = Util.GetValueOfInt(idr[0]); } idr.Close(); } catch (Exception e) { _log.Log(Level.SEVERE, sql, e); } finally { if (idr != null) { idr.Close(); idr = null; } } return(GetBOMLinesOrderByProductName(MBOM.Get(product.GetCtx(), bomID), isAscending)); }
/// <summary> /// Get Component BOM /// </summary> /// <returns>MBOM</returns> /// <writer>raghu</writer> /// <date>08-march-2011</date> public MBOM GetComponentBOM() { if (_componentBOM == null && GetM_ProductBOMVersion_ID() != 0) { _componentBOM = MBOM.Get(GetCtx(), GetM_ProductBOMVersion_ID()); } return(_componentBOM); }
/// <summary> /// Get Parent /// </summary> /// <returns>parent</returns> public MBOM GetBOM() { if (_bom == null && GetM_BOM_ID() != 0) { _bom = MBOM.Get(GetCtx(), GetM_BOM_ID()); } return(_bom); }