public string StockOutUpdate(StockOut stock) { Item model = new Item(); model = stockIOutGateway.GetItemInfo(stock.ItemName); stock.ItemId = model.Sl; stock.CompanyId = model.CompanyName; int available = model.AvailableQuantity; available = available - stock.StockOutQuantity; model.AvailableQuantity = available; int rowAffect = stockIOutGateway.StockOutSave(stock); stockIOutGateway.StockUpdate(available, model.Sl); if (rowAffect > 0) { return("Stock Update"); } else { return("! Faild"); } }
public string StockOutUpdate(StockOut stock) { Item item = new Item(); item = stockOutGateway.GetItemInfo(stock.ItemName); stock.ItemId = item.Sl; stock.CompanyId = item.CompanyName; int available = item.AvailableQuantity; available = available - stock.StockOutQuantity; item.AvailableQuantity = available; int rowAffect = stockOutGateway.StockOutSave(stock); stockOutGateway.StockUpdate(available, item.Sl); if (available > 0) { return("Stock Update"); } else { return("Stock Update Failed"); } }