/// <summary>
 /// Add a new item to an invoice, this version is used when the invoice ID is known
 /// </summary>
 /// <param name="invID"></param>
 /// <param name="itryID"></param>
 /// <param name="qty"></param>
 /// <param name="price"></param>
 public Database.inventory addNewItem(int invID, int itryID, int qty, decimal? price = null, decimal discount = 0)
 {
     Database.inventory item = m_itryMgr.getItemByID(itryID);
     price = (price == null) ? item.itrySellingPrive : price;
     Database.inv_line inv_line = new Database.inv_line();
     inv_line.invID = invID;
     inv_line.itryQty = qty;
     inv_line.itryID = itryID;
     inv_line.linePrice = price;
     inv_line.line_discount = discount;
     m_lstInvLine.AddLast(inv_line);
     return item;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the inv_line EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToinv_line(inv_line inv_line)
 {
     base.AddObject("inv_line", inv_line);
 }
 /// <summary>
 /// Create a new inv_line object.
 /// </summary>
 /// <param name="invID">Initial value of the invID property.</param>
 /// <param name="itryID">Initial value of the itryID property.</param>
 /// <param name="itryQty">Initial value of the itryQty property.</param>
 /// <param name="line_discount">Initial value of the line_discount property.</param>
 public static inv_line Createinv_line(global::System.Int32 invID, global::System.Int32 itryID, global::System.Int32 itryQty, global::System.Decimal line_discount)
 {
     inv_line inv_line = new inv_line();
     inv_line.invID = invID;
     inv_line.itryID = itryID;
     inv_line.itryQty = itryQty;
     inv_line.line_discount = line_discount;
     return inv_line;
 }
 /// <summary>
 /// Add new line to invoice from pre defined object
 /// </summary>
 /// <param name="lineobj"></param>
 public void addLineToInvoice(inv_line lineobj)
 {
     Context.AddToinv_line(lineobj);
     saveChanges();
 }
 /// <summary>
 /// Add a new line to an existing invoice
 /// </summary>
 /// <param name="invID">ID of the invoice to add a new line to</param>
 /// <param name="itryID">If of the inventory item to add</param>
 /// <param name="qty">Quantity of inventory item to add</param>
 public void addLineToInvoice(int invID, int itryID, int qty, decimal? price, decimal discount)
 {
     inv_line line = new inv_line();
     line.invID = invID;
     line.itryQty = qty;
     line.itryID = itryID;
     line.linePrice = price;
     Context.AddToinv_line(line);
     saveChanges();
 }