|
|
@@ -93,13 +93,13 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
var old = await _db.Queryable<BPA_GoodsType>().FirstAsync(t => t.Name == dto.Name); |
|
|
|
if (old != null) |
|
|
|
throw Oops.Oh($"已存在{dto.Name},添加失败!"); |
|
|
|
var res = 0; |
|
|
|
if (string.IsNullOrWhiteSpace(dto.Id)) |
|
|
|
{ |
|
|
|
_db.Ado.BeginTran(); |
|
|
|
var old = await _db.Queryable<BPA_GoodsType>().FirstAsync(t => t.Name == dto.Name); |
|
|
|
if (old != null) |
|
|
|
throw Oops.Oh($"已存在{dto.Name},添加失败!"); |
|
|
|
var newType = new BPA_GoodsType |
|
|
|
{ |
|
|
|
Pid = dto.Pid ?? "0", |
|
|
|