public IHttpActionResult Post(TMS_MachineBags accountsMachineBagsDetails) { if (ModelState.IsValid) { int c = _machineBagsBll.Insert(accountsMachineBagsDetails); if (c == 1) { return(Json(new { Msg = "1" })); } return(Json(new { Msg = "0" })); } else { return(Json(new { Msg = "0" })); } }
public IHttpActionResult UpdateMachineBags(int id, TMS_MachineBags mb) { if (!ModelState.IsValid) { //return BadRequest(ModelState); return(Json(new { Msg = "0" })); } if (id != mb.Id) { //return BadRequest(); return(Json(new { Msg = "0" })); } try { int s = _machineBagsBll.Update(mb); if (s == 1) { return(Json(new { Msg = "1" })); } return(Json(new { Msg = "0" })); } catch (DbUpdateConcurrencyException) { if (!MachineBagsMappingExists(id)) { //return NotFound(); return(Json(new { Msg = "0", Reason = "No row affected!" })); } else { throw; } } }
public int Update(TMS_MachineBags mb) { return(_reposirory.Update(mb)); }
public int Insert(TMS_MachineBags mb) { return(_reposirory.Insert(mb)); }