コード例 #1
0
 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);
 }
コード例 #2
0
ファイル: SanPhamController.cs プロジェクト: anhhieu1234/api
 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);
 }
コード例 #3
0
 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);
 }