public async Task <bool> IncreaseGoods(GoodsActorDto input) { try { instance.IncreaseGoods(input.StockNumber); if (input.SaveChanges) { await base.SaveAll(true);//异步保存 } return(await Task.FromResult(true)); } catch (Exception) { return(await Task.FromResult(false)); } }
public async Task <bool> UpOrDownShelf(GoodsActorDto input) { try { instance.ChangeShelf(input.IsUpShelf); if (input.SaveChanges) { await base.SaveAll(true);//异步保存 } return(await Task.FromResult(true)); } catch (Exception) { return(await Task.FromResult(false)); } }
public async Task <bool> UpdateBaseInfo(GoodsActorDto input) { try { instance.UpdateBaseInfo(input.Name, input.Price); if (input.SaveChanges) { await base.SaveAll(true);//异步保存 } return(await Task.FromResult(true)); } catch (Exception) { return(await Task.FromResult(false)); } }
public async Task <bool> WithholdingGoodsStock(GoodsActorDto input) { try { if (!input.Rollback) { instance.SaleGoods(input.StockNumber); } else { instance.RollbackGoods(input.StockNumber); } if (input.SaveChanges) { await base.SaveAll(true);//异步保存 } return(await Task.FromResult(true)); } catch (Exception) { return(await Task.FromResult(false)); } }