public IHttpActionResult UpdateSendCommand(int id, TMS_SendCommand sendCommand) { if (!ModelState.IsValid) { return(Json(new { Msg = "0" })); } if (id != sendCommand.Id) { //return BadRequest(); return(Json(new { Msg = "0" })); } try { int s = _sendCommandBll.Update(sendCommand); if (s == 1) { return(Json(new { Msg = "1" })); } return(Json(new { Msg = "0" })); } catch (DbUpdateConcurrencyException) { if (!DeleteSendCommandExists(id)) { //return NotFound(); return(Json(new { Msg = "0", Reason = "Exception!" })); } else { throw; } } }
public IHttpActionResult Post(TMS_SendCommand sendCommand) { if (ModelState.IsValid) { int c = _sendCommandBll.Insert(sendCommand); if (c == 1) { return(Json(new { Msg = "1" })); } return(Json(new { Msg = "0" })); } else { return(Json(new { Msg = "0" })); } }
public int Update(TMS_SendCommand sendCommand) { return(_repository.Update(sendCommand)); }
public int Insert(TMS_SendCommand sendCommand) { return(_repository.Insert(sendCommand)); }