public void Instock(InStore inStock) { _instore.Create(inStock); var stock = GetStockFromInstock(inStock); _stock.Create(stock); }
private Stock GetStockFromInstock(InStore instock) { var stock = new Stock() { Id = Guid.NewGuid().ToString(), Code = instock.Code, CreatedBy = instock.CreatedBy, CreatedDate = DateTime.Now, Department = instock.Department, InstoreId = instock.Id, Number = instock.RemainNumber, TotalPrice = instock.RemainTotalPrice, Type = instock.Type, UnitPrice = instock.UnitPrice, UpdatedBy = instock.UpdatedBy, UpdatedDate = DateTime.Now }; return stock; }
public BizLayer.InStore GetBizModel(InStoreModel dpt) { BizLayer.InStore dbInst = null; if (dpt != null) { dbInst = new BizLayer.InStore(); dbInst.Code = dpt.Code; dbInst.Id = dpt.Id; dbInst.Number = dpt.Number; dbInst.RemainNumber = dpt.RemainNumber; dbInst.RemainTotalPrice = dpt.RemainTotalPrice; dbInst.UnitPrice = dpt.UnitPrice; dbInst.TotalPrice = dpt.TotalPrice; dbInst.Department = dpt.Department; dbInst.Type = dpt.Type; dbInst.CreatedBy = dpt.CreatedBy; dbInst.CreatedDate = dpt.CreatedDate; dbInst.UpdatedBy = dpt.UpdatedBy; dbInst.UpdatedDate = dpt.UpdatedDate; } return dbInst; }