盘点添加箱信息
This commit is contained in:
@@ -44,6 +44,36 @@ namespace WMS.Web.Repositories
|
||||
_erpBasicDataExtendService = erpBasicDataExtendService;
|
||||
_erpService = erpServic;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <param name="isTransaction"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<Box> Add(Box entity, bool isTransaction = true)
|
||||
{
|
||||
IDbContextTransaction _transaction = null;
|
||||
if (isTransaction)
|
||||
_transaction = _context.Database.BeginTransaction();
|
||||
try
|
||||
{
|
||||
await _context.Box.AddAsync(entity);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
if (_transaction != null)
|
||||
_transaction.Commit();
|
||||
return entity;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_transaction != null)
|
||||
_transaction.Rollback();
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public async Task<Box> Get(int id)
|
||||
{
|
||||
var entity = await _context.Box.Include(x => x.Details)
|
||||
|
||||
Reference in New Issue
Block a user