Example #1
0
        public async Task <Goods> CheckGoods(GoodsRecord input)
        {
            Goods entity = _goodsRepository.FirstOrDefault(input.Id);

            if (entity != null)
            {
                entity.GoodsNum = entity.GoodsNum + input.GoodsNum;
            }

            input.Id          = Guid.NewGuid().ToString();
            input.OperateType = GoodsOperateType.Check;
            GoodsRecord record = await _recordRepository.InsertAsync(input);

            return(await _goodsRepository.UpdateAsync(entity));
        }
Example #2
0
 /// <summary>
 /// 出库
 /// </summary>
 /// <param name="input"></param>
 /// <returns></returns>
 public async Task <string> OutRecord(GoodsRecord input)
 {
     input.Id = Guid.NewGuid().ToString();
     return(await _recordRepository.InsertAndGetIdAsync(input));
 }