private void importBOM(string bom) { int cntExist = Convert.ToInt32(Program.objHrmsUI.getScallerValue("Select count(*) from OITT where Code = '" + bom + "'")); if (cntExist == 0) { SAPbobsCOM.ProductTrees BOM; BOM = (SAPbobsCOM.ProductTrees)oCompany.GetBusinessObject(BoObjectTypes.oProductTrees); BOM.TreeCode = bom; string strChilds = "Select * from BOM_LINE where FATHER = '" + bom + "'"; System.Data.DataTable dtChild = dsWEB.getDataTable(strChilds, "getting childeren"); foreach (DataRow dr in dtChild.Rows) { BOM.Items.ItemCode = dr["Code"].ToString(); BOM.Items.Quantity = Convert.ToDouble(dr["Quantity"]); BOM.Items.Add(); } int result = BOM.Add(); if (result == 0) { oApplication.SetStatusBarMessage("BOM " + bom + " Imported Successfully", BoMessageTime.bmt_Short, false); } else { int erroCode = 0; string errDescr = ""; string Errmsg = ""; oCompany.GetLastError(out erroCode, out errDescr); oApplication.SetStatusBarMessage("BOM " + bom + " Failed to import: " + errDescr, BoMessageTime.bmt_Short, true); } } }
public void AddPart(Part newPart, uint positionNumber, uint quantity) { BOM.Add(new BOMItem(newPart, positionNumber, quantity)); }