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