/// <summary>
 /// Deprecated Method for adding a new object to the StockItems EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToStockItems(StockItem stockItem)
 {
     base.AddObject("StockItems", stockItem);
 }
 /// <summary>
 /// Create a new StockItem object.
 /// </summary>
 /// <param name="code">Initial value of the Code property.</param>
 /// <param name="terminalCode">Initial value of the TerminalCode property.</param>
 /// <param name="stockHeaderCode">Initial value of the StockHeaderCode property.</param>
 /// <param name="terminalToCode">Initial value of the TerminalToCode property.</param>
 /// <param name="batch">Initial value of the Batch property.</param>
 /// <param name="productCode">Initial value of the ProductCode property.</param>
 /// <param name="productMasterCode">Initial value of the ProductMasterCode property.</param>
 /// <param name="productByWeight">Initial value of the ProductByWeight property.</param>
 /// <param name="priceValue">Initial value of the PriceValue property.</param>
 /// <param name="quantity">Initial value of the Quantity property.</param>
 public static StockItem CreateStockItem(global::System.Int32 code, global::System.Int32 terminalCode, global::System.Int32 stockHeaderCode, global::System.Int32 terminalToCode, global::System.String batch, global::System.Int32 productCode, global::System.String productMasterCode, global::System.Boolean productByWeight, global::System.Double priceValue, global::System.Double quantity)
 {
     StockItem stockItem = new StockItem();
     stockItem.Code = code;
     stockItem.TerminalCode = terminalCode;
     stockItem.StockHeaderCode = stockHeaderCode;
     stockItem.TerminalToCode = terminalToCode;
     stockItem.Batch = batch;
     stockItem.ProductCode = productCode;
     stockItem.ProductMasterCode = productMasterCode;
     stockItem.ProductByWeight = productByWeight;
     stockItem.PriceValue = priceValue;
     stockItem.Quantity = quantity;
     return stockItem;
 }
 public StockItem AddNewStockItem(Product prod, double qty, string lot)
 {
     StockItem item = new StockItem(this, prod, qty, lot);
     StockItems.Add(item);
     return item;
 }