/// <summary> /// 绑定车型图片 /// </summary> /// <param name="list"></param> /// <param name="dt"></param> /// <param name="type">1.品牌,2.车系,3.车型,4.车型细分</param> private void BindCarImg(List <CarInfo> list, DataTable dt, int type) { var imgList = _resFileMstrRepository.GetAllList(m => m.CREATE_ORG_NO == AbpSession.ORG_NO); for (int i = 0; i < dt.Rows.Count; i++) { CarInfo model = new CarInfo(); model.CLASS_LEVEL = type; switch (type) { case 1: model.ChildInfo = new List <CarInfo>(); model.CLASS_ID = dt.Rows[i]["BRAND_ID"].ToString(); model.CLASS_NO = dt.Rows[i]["BRAND_CODE"].ToString(); model.CLASS_NAME = dt.Rows[i]["BRAND_NAME"].ToString(); model.PARENT_ID = "0"; break; case 2: model.CLASS_ID = dt.Rows[i]["CLASS_ID"].ToString(); model.CLASS_NO = dt.Rows[i]["CLASS_CODE"].ToString(); model.CLASS_NAME = dt.Rows[i]["CLASS_NAME"].ToString(); model.PARENT_ID = dt.Rows[i]["BRAND_ID"].ToString(); break; case 3: model.CLASS_ID = dt.Rows[i]["TYPE_ID"].ToString(); model.CLASS_NO = dt.Rows[i]["TYPE_CODE"].ToString(); model.CLASS_NAME = dt.Rows[i]["TYPE_NAME"].ToString(); model.PARENT_ID = dt.Rows[i]["CLASS_ID"].ToString(); break; case 4: model.CLASS_ID = dt.Rows[i]["SUBTYPE_ID"].ToString(); model.CLASS_NO = dt.Rows[i]["SUBTYPE_CODE"].ToString(); model.CLASS_NAME = dt.Rows[i]["SUBTYPE_NAME"].ToString(); model.PARENT_ID = dt.Rows[i]["TYPE_ID"].ToString(); break; default: break; } var img = imgList.FindAll(f => f.BIZ_NO == model.CLASS_ID); model.FILE_ID = img != null && img.Count > 0 ? img[0].Id : ""; model.imgName = img != null && img.Count > 0 ? img[0].FILE_NAME : ""; list.Add(model); } }
/// <summary> /// 根据id获取商品信息 /// </summary> /// <param name="id"></param> /// <returns></returns> public MdmGoodsListDto GetGoodsInfoById(string id) { string files = ""; var dto = _mdmGoodsListRepository.Get(id).ToDto(); var filesList = _resFileMstrRepository.GetAllList(m => m.BIZ_NO == id); foreach (var item in filesList) { files += (string.IsNullOrEmpty(files) ? "" : "|") + item.FILE_NAME; } dto.files = files; return(dto); }