public SanPhamModel UpdateItem([FromBody] SanPhamModel model) { if (model.Hinhanh != null) { var arrData = model.Hinhanh.Split(';'); if (arrData.Length == 3) { var savePath = $@"assets/images/{arrData[0]}"; model.Hinhanh = $"{savePath}"; SaveFileFromBase64String(savePath, arrData[2]); } } _itemBusiness.Update(model); return(model); }
public SanPhamModel UpdateSanPham([FromBody] SanPhamModel model) { if (model.item_image != null) { var arrData = model.item_image.Split(';'); if (arrData.Length == 3) { var savePath = $@"{arrData[0]}"; model.item_image = $"{savePath}"; SaveFileFromBase64String(savePath, arrData[2]); } } _itemBusiness.Update(model); return(model); }
public SanPhamModel UpdateSP([FromBody] SanPhamModel model) { if (model.image != null) { var arrData = model.image.Split(';'); if (arrData.Length == 3) { var savePath = $@"assets/Upload/SanPham/{arrData[0]}"; var savePathh = $@"assets/Upload/SanPham/{arrData[0]}"; model.image = $"{savePath}"; SaveFileFromBase64String(savePath, arrData[2]); SaveFileFromBase64(savePathh, arrData[2]); } } sanpham.Update(model); return(model); }