void CreateGoods() { var product = DBContext.Products.FirstOrDefault(p => p.ScanCode == scancode_tb.Text); if (product == null) { product = new ProductOperation.ProductMgmtModule() .CallAddProductPopup(scancode_tb.Text, "未发现此产品,请先录入产品信息",DBContext); } Goods newgoods = null; if (product != null) { newgoods = new WarehouseOperationModule() .CallRegisterGoodsPopup(product, DBContext); } if (newgoods != null) { var inbound = this.DataContext as WarehouseInbound; if (inbound != null) { if (inbound.InboundGoods == null) inbound.InboundGoods = new List<Goods>(); inbound.InboundGoods.Add(newgoods); } } LoadDataGrid(); }
void CreateGoods() { var product = DBContext.Products.FirstOrDefault(p => p.ScanCode == scancode_tb.Text); if (product == null) { product = new ProductOperation.ProductMgmtModule() .CallAddProductPopup(scancode_tb.Text, "未发现此产品,请先录入产品信息", DBContext); } Goods newgoods = null; if (product != null) { newgoods = new WarehouseOperationModule() .CallRegisterGoodsPopup(product, DBContext); } if (newgoods != null) { var inbound = this.DataContext as WarehouseInbound; if (inbound != null) { if (inbound.InboundGoods == null) { inbound.InboundGoods = new List <Goods>(); } inbound.InboundGoods.Add(newgoods); } } LoadDataGrid(); }