/// <summary> /// 객체를 생성할 때 생성자에서 호출됩니다. /// </summary> /// <param name="product"></param> protected virtual void Initialize(IProductWrapper product = null) { if (product == null) //새로운 데이터를 추가할 경우 { Stock = new Inventory(); Quantity = 1; } else //기존의 데이터를 수정할 경우 { Stock = product.Product.Clone() as Inventory; var inventory = product as InventoryWrapper; Item = inventory.Item; Specification = inventory.Specification; Warehouse = inventory.Warehouse; } }
protected override void Initialize(IProductWrapper product = null) { if (product == null) { InOutStock = new InOutStock(); Quantity = 1; Date = DateTime.Now; } else { InOutStock = product.Product.Clone() as InOutStock; var stock = product as StockWrapper; Item = stock.Item; Specification = stock.Specification; Warehouse = stock.Warehouse; Quantity = stock.Quantity; Client = stock.Client; Employee = stock.Employee; } }
public InventoryWrapperProperties(IProductWrapper inventoryWrapper) { Initialize(inventoryWrapper); }