private static void AddLineToStockAdjustmentPurchaseTransaction(StockAdjustmentTransactionLine line, PurchaseTransaction stockAdjustmentPurchaseTransaction) { var stockAdjustmentPurchaseLine = new PurchaseTransactionLine { PurchaseTransaction = stockAdjustmentPurchaseTransaction, Item = line.Item, Warehouse = line.Warehouse, PurchasePrice = 0, Discount = 0, Quantity = line.Quantity, Total = 0, SoldOrReturned = 0 }; stockAdjustmentPurchaseTransaction.PurchaseTransactionLines.Add(stockAdjustmentPurchaseLine); }
private static void AttachLineToDatabaseContext(ERPContext context, StockAdjustmentTransactionLine line) { line.Item = context.Inventory.Single(e => e.ID.Equals(line.Item.ID)); line.Warehouse = context.Warehouses.Single(e => e.ID.Equals(line.Warehouse.ID)); }