Ver a proveniência

opt:增加判空操作

ingredientmanage
zhaoy há 7 meses
ascendente
cometimento
825467d7dd
1 ficheiros alterados com 11 adições e 8 eliminações
  1. +11
    -8
      BPA.SAAS.Manage.Application/DataBase/Services/GoodsAttributeService.cs

+ 11
- 8
BPA.SAAS.Manage.Application/DataBase/Services/GoodsAttributeService.cs Ver ficheiro

@@ -123,15 +123,18 @@ namespace BPA.Franchisee.Application.FranchiseeCenter.GoodsServices
foreach (var item in dto.GoodsAttributeValueList)
{
var updateselect = dellist.FirstOrDefault(x => x.Id == item.Id);
if (updateselect.AttributeValue!=item.AttributeValue|| updateselect.Sort!=item.Sort)
if (updateselect!=null)
{
//更新
BPA_GoodsAttributeValue GoodsAttributeValue = new();
GoodsAttributeValue.Id = item.Id;
GoodsAttributeValue.AttributeValue =item.AttributeValue;
GoodsAttributeValue.GoodsAttributeId = dto.Id;
GoodsAttributeValue.Sort = item.Sort;
res = await _db.Updateable(GoodsAttributeValue).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
if (updateselect.AttributeValue != item.AttributeValue || updateselect.Sort != item.Sort)
{
//更新
BPA_GoodsAttributeValue GoodsAttributeValue = new();
GoodsAttributeValue.Id = item.Id;
GoodsAttributeValue.AttributeValue = item.AttributeValue;
GoodsAttributeValue.GoodsAttributeId = dto.Id;
GoodsAttributeValue.Sort = item.Sort;
res = await _db.Updateable(GoodsAttributeValue).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
}
//查询id是否存在
if (string.IsNullOrWhiteSpace(item.GoodsAttributeId))


Carregando…
Cancelar
Guardar