/// <summary>修改品牌 /// </summary> /// <param name="goodsBrandInfo"></param> /// <param name="errorMessage"></param> /// <returns></returns> public bool UpdateBrand(GoodsBrandInfo goodsBrandInfo, out string errorMessage) { List <BrandQualificationDetailInfo> informationList = null; if (goodsBrandInfo.GoodsInformationList != null) { if (goodsBrandInfo.GoodsInformationList.Any()) { informationList = goodsBrandInfo.GoodsInformationList.Select(ConvertToBrandInformationInfo).ToList(); foreach (var informationInfo in informationList) { informationInfo.BrandID = goodsBrandInfo.BrandId; informationInfo.BrandQualificationName = goodsBrandInfo.Brand; } } } var request = new BrandRequestModel { BrandInfo = ConvertToBrandInfo(goodsBrandInfo), BrandQualificationList = informationList }; var result = GoodsServerClient.UpdateBrand(request); errorMessage = string.Empty; if (result == null) { errorMessage = "GMS连接异常"; } else if (!result.IsSuccess) { errorMessage = result.ErrorMsg; } return(result != null && result.IsSuccess); }
public IActionResult PostUpdate(BrandRequestModel brandRequestModel) { return(Ok(_brandService.Update(_mapper.Map <Brands>(brandRequestModel)))); }