public LoaispModel Updateloaisp([FromBody] LoaispModel model) { if (model.anhloai != null) { var arrData = model.anhloai.Split(';'); if (arrData.Length == 3) { var savePath = $@"assets/images/{arrData[0]}"; model.anhloai = $"{savePath}"; SaveFileFromBase64String(savePath, arrData[2]); } } _loaispBusiness.Update(model); return(model); }
public bool Update(LoaispModel model) { string msgError = ""; try { var result = _dbHelper.ExecuteScalarSProcedureWithTransaction(out msgError, "sp_loaisp_update", "@maloai", model.maloai, "@anhloai", model.anhloai, "@tenloai", model.tenloai); if ((result != null && !string.IsNullOrEmpty(result.ToString())) || !string.IsNullOrEmpty(msgError)) { throw new Exception(Convert.ToString(result) + msgError); } return(true); } catch (Exception ex) { throw ex; } }
public bool Create(LoaispModel model) { string msgError = ""; try { var result = _dbHelper.ExecuteScalarSProcedureWithTransaction(out msgError, "themloaisp", "@MALOAI", model.MALOAI, "@TENLOAI", model.TENLOAI, "@PARENTID", model.PARENTID, "@HINH", model.HINH, "@KEYWORD", model.KEYWORD, "@URL", model.URL); if ((result != null && !string.IsNullOrEmpty(result.ToString())) || !string.IsNullOrEmpty(msgError)) { throw new Exception(Convert.ToString(result) + msgError); } return(true); } catch (Exception ex) { throw ex; } }
public bool Update(LoaispModel model) { return(_res.Update(model)); }
//admin public bool Create(LoaispModel model) { return(_res.Create(model)); }
public LoaispModel UpdateLSP([FromBody] LoaispModel model) { _LoaispBusiness.Create(model); return(model); }