/// <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); }
static BrandInfo ConvertToBrandInfo(GoodsBrandInfo info) { var brandInfo = new BrandInfo { OrderIndex = info.OrderIndex, Description = info.Description, Brand = info.Brand, BrandId = info.BrandId, BrandLogo = info.BrandLogo, }; return(brandInfo); }