|
|
@@ -61,7 +61,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services |
|
|
|
try |
|
|
|
{ |
|
|
|
_db.Ado.BeginTran(); |
|
|
|
var resEntity = _db.Queryable<BPA_GoodsEnergyConfig>().First(it => it.Name == dto.Name); |
|
|
|
var resEntity = _db.Queryable<BPA_GoodsEnergyConfig>().First(it => it.Name == dto.Name && it.GoodsId != dto.GoodsId); |
|
|
|
if (resEntity != null) throw Oops.Oh("配置名称已存在"); |
|
|
|
var newType = new BPA_GoodsEnergyConfig |
|
|
|
{ |
|
|
@@ -105,7 +105,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services |
|
|
|
// 查询数据库中是否存在未删除的商品类型 |
|
|
|
var resEntity = _db.Queryable<BPA_GoodsEnergyConfig>().First(it => it.Id == dto.Id); |
|
|
|
if (null == resEntity) throw Oops.Oh("配置不存在"); |
|
|
|
var resEntity1 = _db.Queryable<BPA_GoodsEnergyConfig>().First(it => it.Name == dto.Name && it.Id != dto.Id); |
|
|
|
var resEntity1 = _db.Queryable<BPA_GoodsEnergyConfig>().First(it => it.Name == dto.Name && it.Id != dto.Id && it.GoodsId!= dto.GoodsId); |
|
|
|
if (resEntity1 != null) throw Oops.Oh("配置名称已存在"); |
|
|
|
resEntity.Name = dto.Name; |
|
|
|
resEntity.Uint = dto.Uint; |
|
|
|