public IHttpActionResult Post(TMS_Machine_Status ad) { if (ad == null) { return(Json(new { Msg = "0" })); } try { int s = _msBll.Insert(ad); if (s == 1) { return(Json(new { Msg = "1" })); } return(Json(new { Msg = "0" })); } catch (DbUpdateConcurrencyException) { return(Json(new { Msg = "0", Reason = "No row affected!" })); } }
public IHttpActionResult UpdateMachineProfilling(int id, TMS_Machine_Status ac) { if (!ModelState.IsValid) { //return BadRequest(ModelState); return(Json(new { Msg = "0" })); } if (id != ac.Id) { //return BadRequest(); return(Json(new { Msg = "0" })); } try { int s = _msBll.Update(ac); if (s == 1) { return(Json(new { Msg = "1" })); } return(Json(new { Msg = "0" })); } catch (DbUpdateConcurrencyException) { if (!TmsAdvertiseCashExists(id)) { //return NotFound(); return(Json(new { Msg = "0", Reason = "No row affected!" })); } else { throw; } } }
public int Update(TMS_Machine_Status obj) { int d = _repository.Update(obj); return(d); }
public int Insert(TMS_Machine_Status obj) { return(_repository.Insert(obj)); }