// DELETE api/values/5 public string Delete(long id) { bool res = new ThuChiDAO().Delete(id); if (res) { return("success"); } return("fail"); }
// PUT api/values/5 public string Put(int id, [FromBody] ThuChi obj) { obj.ID = id; bool res = new ThuChiDAO().Update(obj); if (res) { return("success"); } return("fail"); }
// DELETE api/values/5 public string Delete(int id) { bool res = new ThuChiDAO().Delete(id); if (res) { return("success"); } else { return("failed"); } }
// POST api/values /// <summary> /// Them moi du lieu /// </summary> /// <param name="obj">Du lieu can them moi</param> /// <returns></returns> public long Post([FromBody] ThuChi obj) { long res = new ThuChiDAO().Insert(obj); return(res); }