private bool SubmitPO(POInformation p) { string queue = BuildQueue.buildQueuePO(p); mPurchasers = new List <Purchaser>(); try { var command = new OleDbCommand(); command.Connection = connection; command.CommandText = queue; connection.Open(); command.ExecuteNonQuery(); } catch (Exception ex) { MessageBox.Show("Error Submitting PO Information"); connection.Close(); return(false); } finally { connection.Close(); } int materialcount = 0; for (int i = 0; i < mOrderItems.Count; i++) { SubmitMaterialItem(mOrderItems[i], p); materialcount++; /*if (OrderItems[i].isMaterial) * { * SubmitMaterialItem(OrderItems[i], p); * materialcount++; * }*/ } MessageBox.Show("Purchase Order submitted (" + materialcount + ")"); return(true); }
private void SubmitMaterialItem(InventoryOrderItem ioi, POInformation p) { string queue = BuildQueue.buildQueueMaterial(ioi, p); mPurchasers = new List <Purchaser>(); try { var command = new OleDbCommand(); command.Connection = connection; command.CommandText = queue; connection.Open(); command.ExecuteNonQuery(); } catch (Exception ex) { MessageBox.Show("Error Submitting Material Item. " + ex); } finally { connection.Close(); } }